When an Active node fails a keygen, don't emit a BondCost event.
As an example I present Block 5380199 (network version v1.87.1), in which Active node .zldh and Ready node .heqk both fail a keygen.
For Active node .zldh (Before and After), slash points are added and a "slash_points" event is emitted, with no .k6jt bond change.
For Ready node .heqk (Before and After), the node is jailed for 'failed to perform keygen', the .csgj bond is decreased by 1030760404 tor, and a BondCost event is emitted for that same amount. There is also a single 1030760404 tor "transfer" event from the Bond Module (.ncsv) to the Reserve Module (.xtxt), consistent with this.
However, in the emitted events, there is also a BondCost event which claims a .k6jt bond cost of 1030760404 tor, an identical amount to that of the .csgj BondCost event. (Seemingly using the totalSlash value from the earlier loop of for _, node := range msg.Blame.BlameNodes .)
I propose that in the relevant handler_tss.go code, the seven lines responsible for emitting the BondCost event be moved to within the else parentheses for if na.Status == NodeActive .
(However, I imagine not moving the relative position of the three SetNodeAccount lines currently just above.)
On a related note, I propose that either the below comment be rewritten to match the code's SendFromModuleToModule(ctx, BondName, ReserveName or else the code changed to match the comment. (That is, currently the comment says that the bond cost increments BondRewardRune, while the actual code sends it to the Reserve. Whichever is the desired state, clear consistency is preferable.)
// take out bond from the node account and add it to vault bond reward RUNE
// thus good behaviour node will get reward