Closed
Conversation
JimmyShi22
reviewed
Feb 11, 2026
Contributor
JimmyShi22
left a comment
There was a problem hiding this comment.
Code review of current HEAD.
Vui-Chee
added a commit
that referenced
this pull request
Mar 5, 2026
Port legacy data migration tool from PR #137 into existing bin/tools as a new 'migrate' subcommand. Migrates data from MDBX to RocksDB + static files for TransactionSenders, AccountChangeSets, Receipts, TransactionHashNumbers, AccountsHistory, and StoragesHistory tables. Key changes: - Add migrate.rs: core migration logic for static files and RocksDB - Add migrate_command.rs: CLI command with options (batch-size, skip-static-files, skip-rocksdb, keep-mdbx) - Add progress.rs: progress logging utilities - Update main.rs: add Migrate variant to Commands enum - Update Cargo.toml: add reth-provider/rocksdb, reth-stages/rocksdb, reth-static-file-types, reth-storage-api dependencies - Update .reth-dev.toml: add reth-stages and reth-static-file-types entries for local dev builds Co-Authored-By: vuicheesiew@gmail.com <vuicheesiew@gmail.com>
5 tasks
Vui-Chee
added a commit
that referenced
this pull request
Mar 13, 2026
Port the legacy data migration tool from PR #137 into the existing bin/tools crate as a new 'legacy-migrate' subcommand. Key changes: - Use workspace reth deps (paradigmxyz/reth v1.11.0) instead of pinned okx/reth git deps - Import chain spec from xlayer-chainspec crate instead of duplicating - Add reth-static-file-types to workspace dependencies - Adapt StorageSettings to use v2() API from upstream reth - Add reth-db, reth-node-builder, reth-primitives-traits deps to tools
7 tasks
Contributor
Author
|
Closing in favor of #196. |
louisliu2048
pushed a commit
that referenced
this pull request
Mar 16, 2026
* feat: integrate legacy migrate tool into bin/tools crate Port the legacy data migration tool from PR #137 into the existing bin/tools crate as a new 'legacy-migrate' subcommand. Key changes: - Use workspace reth deps (paradigmxyz/reth v1.11.0) instead of pinned okx/reth git deps - Import chain spec from xlayer-chainspec crate instead of duplicating - Add reth-static-file-types to workspace dependencies - Adapt StorageSettings to use v2() API from upstream reth - Add reth-db, reth-node-builder, reth-primitives-traits deps to tools * fix: add batch_size validation and remove unused num-traits dep - Add clap value_parser range(1..) to prevent batch_size=0 panic - Remove unnecessary num-traits dependency (u64::is_multiple_of is stable in Rust 1.92) * chore: update Cargo.lock after removing num-traits * fix: resolve legacy migrate tool PR review issues - Check prune_modes.receipts.is_none() in addition to receipts_log_filter to prevent migrating incomplete receipt data when general pruning is active - Remove is_some() guard on ensure_at_block in changeset arms to fill leading gap (genesis → first block with data), and add ensure_at_block(to_block) after each changeset loop to fill the trailing gap - Gate StorageSettings::v2() write on both migrations completing; skip it with a warning when --skip-static-files or --skip-rocksdb is passed so the node keeps reading from MDBX until migration is fully finalized Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * fix(tools): gate v2 storage settings and MDBX clearing on can_migrate_receipts StorageSettings::v2() is all-or-nothing: it routes all static-file segment queries (including Receipts) to static files. Writing it when receipts were not migrated (due to pruning) would cause the node to look for receipt data in static files that contain nothing, while the Receipts MDBX table (which was not cleared) becomes unreachable via v1 routing. Two related changes: 1. Add !can_migrate_receipts to the v2-write skip condition so we keep v1 settings when receipts could not be migrated. 2. Guard MDBX static-file table clearing on can_migrate_receipts for the same reason: if v2 was not written, the node reads these tables via v1 routing and they must remain intact. Fixes: JimmyShi22 review comment on mod.rs:151 * fix(tools): add segment context to static file writer init errors get_writer() and latest_writer() failures were propagated bare, making it hard to know which segment caused the error. Wraps both call sites with wrap_err_with so the error chain includes the segment name. Addresses: JimmyShi22 nit on migrate.rs:70 --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
No description provided.