Skip to content

fix(provider): migrate-v2 crash on pruned nodes with no prior changeset static files#23698

Closed
PatrickTulskie wants to merge 1 commit into
paradigmxyz:mainfrom
PatrickTulskie:fix-migrate-v2
Closed

fix(provider): migrate-v2 crash on pruned nodes with no prior changeset static files#23698
PatrickTulskie wants to merge 1 commit into
paradigmxyz:mainfrom
PatrickTulskie:fix-migrate-v2

Conversation

@PatrickTulskie
Copy link
Copy Markdown

Closes #23691

When migrate-v2 runs on a pruned full node, AccountChangeSets has no prior static files. The writer starts at a non-zero block (the block after the prune checkpoint), which lands at the start of a new static-file range. update_index was computing segment_max_block = expected_block_start - 1 to point at the "previous file" — but that file never existed on a v1 node, so NippyJar::load hit ENOENT and the migration crashed.

The fix is to just guard the heuristic behind a check that the segment already has static files in the index. When it doesn't, segment_max_block is None and no load is attempted.

I will add that while this should fix the crash, tests all pass and things look good, I'm not familiar enough with the v2 database format to know if this causes other problems or side effects. Figured it was worth a shot though.

…s exist

Closes paradigmxyz#23691

When migrate-v2 runs on a pruned full node, AccountChangeSets has no
prior static files. update_index was computing segment_max_block =
expected_block_start - 1, pointing to a range that never existed, and
then crashing trying to NippyJar::load it. Guard the heuristic behind a
check that the segment already has files in the index.
@shekhirin
Copy link
Copy Markdown
Member

Superseded by #23716, found a couple more issues and will be merging it soon, thanks!

@shekhirin shekhirin closed this Apr 25, 2026
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Reth Tracker Apr 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

reth 2.1 crash on pruned full node migrate-v2

3 participants