Skip to content

fix(op-reth): propagate MDBX errors in DupSort cursor iterators instead of silently swallowing them#19604

Merged
theochap merged 1 commit intoethereum-optimism:developfrom
ChainSafe:fix/dupsort-iterator-error-propagation
Mar 18, 2026
Merged

fix(op-reth): propagate MDBX errors in DupSort cursor iterators instead of silently swallowing them#19604
theochap merged 1 commit intoethereum-optimism:developfrom
ChainSafe:fix/dupsort-iterator-error-propagation

Conversation

@dhyaniarun1993
Copy link
Contributor

Description

Fixes a bug in define_dup_cursor_iter where MDBX errors from next_no_dup() are silently treated as end-of-table, potentially truncating data during initialization.

If a transient MDBX error occurs mid-iteration, the remaining entries in HashedStorages or StoragesTrie are silently skipped. The batch is committed, init may mark Completed, and the next block execution computes a different state root.

This could be potential root cause for intermittent hash mismatches observed after multi-step initialization (crash mid-init → restart → first block fails state root check). The intermittent nature aligns with transient I/O errors being position-dependent and rare.

Tests

Pending

@dhyaniarun1993 dhyaniarun1993 requested a review from a team as a code owner March 17, 2026 17:57
Copy link
Member

@sebastianst sebastianst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to add a regression test for this that would fail without the fix and that emulates intermittent restarts?

@theochap
Copy link
Member

theochap commented Mar 17, 2026

/ci authorize b1b2633

@theochap theochap added this pull request to the merge queue Mar 18, 2026
Merged via the queue into ethereum-optimism:develop with commit ec3402a Mar 18, 2026
286 checks passed
ClaytonNorthey92 pushed a commit to hemilabs/optimism that referenced this pull request Mar 19, 2026
ClaytonNorthey92 pushed a commit to hemilabs/optimism that referenced this pull request Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants