fix(provider): skip storage changeset writes when routed to static files#21468
Merged
fix(provider): skip storage changeset writes when routed to static files#21468
Conversation
343ef3c to
2092bf7
Compare
joshieDo
reviewed
Jan 27, 2026
2092bf7 to
44e7b81
Compare
44e7b81 to
00abc79
Compare
00abc79 to
95407af
Compare
yongkangc
commented
Jan 27, 2026
Comment on lines
+48
to
+67
| rocksdb: | ||
| name: e2e-rocksdb | ||
| runs-on: depot-ubuntu-latest-4 | ||
| env: | ||
| RUST_BACKTRACE: 1 | ||
| timeout-minutes: 60 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - uses: mozilla-actions/sccache-action@v0.0.9 | ||
| - uses: taiki-e/install-action@nextest | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| cache-on-failure: true | ||
| - name: Run RocksDB e2e tests | ||
| run: | | ||
| cargo nextest run \ | ||
| --locked --features "edge" \ | ||
| -p reth-e2e-test-utils \ | ||
| -E 'binary(rocksdb)' |
Member
Author
There was a problem hiding this comment.
not 100% sure if we want this to run all the time, but makes sense to me
joshieDo
approved these changes
Jan 27, 2026
… to static files When static file storage changesets are enabled, storage changesets were being written twice: 1. Once via write_blocks_data (static file manager) 2. Again via write_state_reverts (database provider via EitherWriter) This caused 'Multiple consecutive append_many calls for same block' errors when persistence_threshold(0) is used in E2E tests, which triggers immediate persistence. The fix adds write_storage_changesets field to StateWriteConfig and guards the storage changeset writes in write_state_reverts, analogous to how account changesets and receipts already work. Additionally, this PR fixes an unrelated bug in the static file manager where per-block iteration over changesets caused multiple appends per block. The fix aggregates all changesets for a block before appending. Fixes the RocksDB E2E tests which use persistence_threshold(0). Amp-Thread-ID: https://ampcode.com/threads/T-019bfe7a-b24a-718e-b938-b941969c8c1a
95407af to
9077463
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Fixed a bug where storage changesets were written twice when static file storage changesets are enabled, causing
UnexpectedStaticFileBlockNumbererrors.Problem
PR #20896 added static file routing for storage changesets but forgot to add
write_storage_changesetstoStateWriteConfig. This caused storage changesets to be written twice:write_blocks_data→ static file managerwrite_state→write_state_reverts→EitherWriter::new_storage_changesets(also routed to static files)The second write fails because block N was already written:
This manifests with
persistence_threshold(0)and static file changesets enabled.Solution
write_storage_changesetsfield toStateWriteConfig!sf_ctx.write_storage_changesetsto the config insave_blockswrite_state_revertswith the configThis matches the existing pattern for
write_receiptsandwrite_account_changesets.Closes #21467