Skip to content

[V128-specific] Consolidate observed_txout slashing in handler_observed_txout

Multipartite requested to merge Multi/consolidate-observed_txout-slashing into develop

[V128-specific]

This is intended to close #1389
'Pool gas is being double-reimbursed (and double-deducted from gas pool Asset balance) for failed transactions'.

Specifically, it is the second of three originally-planned MRs;
the first corrected unintentional (slice-related) voter modification (!2481 (merged)),
and the third I may think more on in future, but currently do not view to be a necessary requirement for closing the Issue.

As this uses errors to signal coverage of gas and transaction with a slash
rather than coverage of gas from the Reserve (or rather both happening with double gas decrementing from the pool record),
a lot of unit tests needed to be updated which assumed no error and downstream slash-implementing.
My main approach to doing this has been to confirm the internal handler error and then to check the result from the ObservedTxOutHandler
(making a MsgObservedTxOut to process).

I believe the only changed Bond prediction was in the handler_yggdrasil_test.go
"yggdrasil return fund to asgard but to address is not asgard should be slashed"
test case, for which handler_yggdrasil.go previously called slashV96 (and thus SlashVault) twice for the same MsgYggdrasil
(once for shouldSlash, then once more downstream in handleYggdrasilReturnV1 for !isAsgardRecipient).

Edited by Multipartite

Merge request reports