Skip operator in do_slash_operators if it is not found #2304
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The fraud proof will slash and remove the malicious operator immediately when the current epoch is ended while the same malicious operator may still get slashed due to invalid bundle later when the ER is confirmed. But at that time, since the malicious operator is already removed, the
do_slash_operators
will returnUnknownOperator
and cause anysubmit_bundle
call fail during execution thus the domain chain is stopped forever.This PR fixes the issue by simply skipping the operator in
do_slash_operators
if it is not found, this is okay since the operator has already slashed previously.This also makes me think about another broader issue that there are staking related operations (i.e. slash/reward/withdraw/epoch transition) performed during the
submit_bundle
call, but the result of these operations is mostly unrelated to the content of thesubmit_bundle
call, which means if the operation is failed it will fail for any bundle it is unrecoverable, so we must avoid any failure! I took a look at all the different operations and it seems to be fine now, but I could miss something, would be great to have @vedhavyas take a look.Code contributor checklist: