Fix: Ensure Isthmus withdrawals root validation for non-canonical parent state in Optimism engine#20016
Fix: Ensure Isthmus withdrawals root validation for non-canonical parent state in Optimism engine#20016petrokamin10 wants to merge 6 commits intoparadigmxyz:mainfrom
Conversation
mattsse
left a comment
There was a problem hiding this comment.
this is a bit more tricky, and the current design for this is a bit of a footgun
I guess we'd need to extend this with like parent_state: BlockState to alway provide access to any parent state
| // FIXME: we don't necessarily have access to the parent block here because the | ||
| // parent block isn't necessarily part of the canonical chain yet. Instead this | ||
| // function should receive the list of in memory blocks as input |
There was a problem hiding this comment.
this is a bit more tricky than that because technically, the block's parent isn't necessarily part of the canonical chain yet
in which case we'd fail to resolve it via the provider which only gives access to the canonical chain + pending block
so this change doesnt fully cover all scenarios, but in almost all cases we ca n assume that this is the case
|
Closing this PR as op-reth has been moved to its own repository. See #21532 and the updated README for the new location. If this is still relevant, please re-open in the new op-reth repository. 🙏 |
Previously, when
state_by_block_hashfailed, the validator returnedOk(()), effectively skipping withdrawals root verification for blocks whose parent was not yet in the canonical chain.This created a window where blocks could bypass a critical consensus check during reorgs or while processing non-canonical branches.
OpEngineValidator::validate_block_post_execution_with_hashed_stateto always validate the Isthmus withdrawals root, even when the parent block state is not yet canonical.