feat: migrate reth dependencies from v1.10.2 to v1.11.0 with optimism…#151
feat: migrate reth dependencies from v1.10.2 to v1.11.0 with optimism…#151louisliu2048 merged 16 commits intomainfrom
Conversation
* main: apply feat to quash compile error (#150)
Vui-Chee
left a comment
There was a problem hiding this comment.
Notes:
- bin/tools/import.rs: defaulting ImportConfig.fail_on_invalid_block to false changes import strictness; is this intentional for all environments or should it be configurable via CLI?
- Cargo.toml: please confirm all op-alloy crates pulled transitively by reth v1.11.0 are redirected to the local optimism workspace to avoid duplicate type definitions.
Vui-Chee
left a comment
There was a problem hiding this comment.
Both notes are not needed:
- fail_on_invalid_block: required field added to match upstream ImportConfig API (not a behavior choice)
- op-alloy patching: comprehensive [patch.crates-io] section already covers all relevant crates
LGTM!
fix: copy dependencies in dockerfile
* main: (25 commits) fix: bump quinn-proto to 0.11.14 to patch CVE-2026-31812 DoS vuln (#183) pre-job authorization (#193) fix: trigger review skill failed to ack (#192) feat: trigger skill review separately (#191) feat: add Claude skills and CLAUDE.md for AI-assisted development (#190) rename ext (#185) supply workflow for claude (#184) feat(builder): incremental trie cache optimization for flashblocks state root (#163) chore(flashblocks-rpc): migrate op-reth flashblocks into xlayer-reth (#175) Feat(chainspec): adding xlayer-devnet chainspec (#167) chore(builder): flatten flashblocks builder, remove unnecessary trait interfaces (#172) rpc: remove unnecessary trait bounds and dependencies from XlayerRpcExtApiServer impl (#171) fix fmt in bin/tools/gen_genesis.rs (#170) fix(builder): Resolve bugs on upstream flashblocks timing scheduler (#169) Feat(tools): Add a tool to generate a custom genesis file based on a template and existing chain data (#159) feat(flashblocks): Add flashblocks sequence persistence logic on RPC and sequence replay flashblock builder (#162) chore(builder): remove unused custom-engine-api feature flag in tests (#168) fix: p2p test hang due to hang on port (#165) fix: update testcontainers to v0.27.0 to remediate CVE-2025-62518 (#164) chore(builder): further clean up builder crate (#161) ...
…ation * origin/xiong/migration: fix: copy dependencies in dockerfile
|
@claude help to review the code |
|
Claude finished @louisliu2048's task in 2m 19s —— View job Code Review —
|
There was a problem hiding this comment.
This is a major dependency migration (reth v1.10.2 → v1.11.0) spanning 26 files with significant architectural changes — switching from the okx/reth fork to upstream paradigmxyz/reth plus a local optimism git submodule — that warrants careful human review.
Extended reasoning...
Overview
This PR migrates ~50+ reth dependencies from the okx/reth fork (pinned by git rev) to upstream paradigmxyz/reth v1.11.0, while moving optimism-specific crates to local path dependencies via a new deps/optimism git submodule. It touches 26 files including Cargo.toml (dependency sources + version bumps + new [patch.crates-io] section), Dockerfile, task spawning APIs across multiple crates, receipt builder API changes (tx → tx_type), test framework infrastructure (TaskManager → Runtime, RollupArgs defaults), new trait bounds (Storage = OpStorage), and two new dead-code scaffolding files.
Security risks
No direct security vulnerabilities were identified. The dependency sources shift from a private fork to upstream + local submodule, which is generally positive for staying current with upstream security fixes. The thiserror upgrade from 1.x to 2.x and secp256k1 default-features change are low-risk but worth verifying compatibility. The [patch.crates-io] section redirecting op-alloy crates to local paths needs careful review to ensure no type mismatches at crate boundaries.
Level of scrutiny
This PR requires thorough human review. It is a foundational dependency migration that affects the entire build graph. The switch from a fork to upstream + submodule is an architectural decision with long-term maintenance implications. The API changes (spawn_blocking → spawn_blocking_task, spawn_critical → spawn_critical_task, spawn → spawn_task) span multiple crates and need verification that the new APIs have equivalent semantics. The test infrastructure changes (dropping enable_tx_conditional, TaskManager → Runtime) could mask regressions.
Other factors
The three bugs found are all nits: dead scaffolding code in builders/, a dropped DA test assertion for tx_hashes[8], and enable_tx_conditional defaulting to false in tests. None are blocking, but they indicate the migration may have some rough edges. The PR description is empty (no checkboxes filled, no testing description), which makes it harder to assess the author's confidence level. The Cargo.lock diff (not shown) would be critical to review for unexpected transitive dependency changes.
The migration to RollupArgs::default() silently disabled conditional transaction support (bool defaults to false) in both OpAddOnsBuilder and OpPoolBuilder for all test node instances. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
alloy-primitives 1.6 introduced a secp256k1 version conflict; pin it at ~1.5 while the rest of the alloy ecosystem stays at ~1.6. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…limit if_standard! always expands to nothing (all tests run in flashblocks mode), so the standard-mode assertions were dead code that could mislead developers into thinking standard DA behavior is tested. Add a comment explaining the known coverage gap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
| # ============================================================================== | ||
| # Reth Dependencies (points to our fork) | ||
| # ============================================================================== | ||
| reth = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-basic-payload-builder = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-chainspec = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-cli = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-cli-commands = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-cli-util = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-db = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-db-api = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-engine-primitives = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-ethereum-forks = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-evm = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-execution-types = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-ipc = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-metrics = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-node-api = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-node-builder = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-node-core = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-node-types = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-optimism-chainspec = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-optimism-cli = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-optimism-consensus = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-optimism-evm = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-optimism-forks = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-optimism-node = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-optimism-payload-builder = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-optimism-primitives = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-optimism-rpc = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-optimism-txpool = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-payload-builder = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-payload-builder-primitives = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-payload-primitives = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-payload-util = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-primitives = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-primitives-traits = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-provider = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-revm = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-rpc = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-rpc-api = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-rpc-convert = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-rpc-engine-api = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-rpc-eth-api = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-rpc-eth-types = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-rpc-layer = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-rpc-server-types = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-storage-api = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-tasks = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-testing-utils = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-tokio-util = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-tracing = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-transaction-pool = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-chain-state = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-errors = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-optimism-flashblocks = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-trie = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| reth-trie-db = { git = "https://github.com/okx/reth", rev = "b6a31f31af91abdecb475f2a991906bff9bbef7f" } | ||
| # Reth Base Dependencies (paradigmxyz/reth v1.11.0) | ||
| # These are chain-agnostic crates from the base reth framework. | ||
| # https://github.com/paradigmxyz/reth/tree/v1.11.0 | ||
| # ============================================================================== |
There was a problem hiding this comment.
🟡 .reth-dev.toml was not updated to reflect the dependency migration from okx/reth to paradigmxyz/reth v1.11.0. The entire [patch."https://github.com/okx/reth"] section (lines 1-61) is now dead config since no Cargo.toml dependency references that URL anymore, both sections reference removed crates (reth-trie-db, reth-db-common, reth-execution-errors, etc.), and new crates added in this PR (reth-optimism-storage, reth-trie-common, reth-optimism-flashblocks) are missing. Any developer running just build-dev after this PR merges will get broken patch resolution.
Extended reasoning...
What the bug is
The .reth-dev.toml file is a template used by the justfile's build-dev command (and related commands like build-docker-dev, validate-reth-dev) to generate .cargo/config.toml for local development builds. It contains [patch] sections that redirect git dependencies to local filesystem paths via sed placeholder substitution. After this PR migrates all reth dependencies from okx/reth to paradigmxyz/reth v1.11.0, the .reth-dev.toml file was not updated to match.
The specific issues
-
Dead config section: The
[patch."https://github.com/okx/reth"]section (lines 1-61) patches a URL that is no longer referenced anywhere inCargo.toml. All base reth dependencies now point toparadigmxyz/reth, making this entire section useless. -
References to removed crates: Both patch sections reference crates that no longer exist in reth v1.11.0:
reth-db-common,reth-execution-errors,reth-evm-ethereum,reth-node-ethereum,reth-trie-db, andreth-trie-parallel. These would cause Cargo patch resolution errors. -
Missing new crates: Several crates added to the workspace in this PR are absent from the template:
reth-optimism-storage,reth-trie-common,reth-optimism-flashblocks, and others. Without these patches, local dev builds would have version conflicts between the git-sourced and local versions of these crates. -
OP crates misplaced: OP-specific crates like
reth-optimism-chainspecare still listed under theparadigmxyz/rethpatch section, but in the PR they now come from localdeps/optimism/path dependencies rather than from the reth git repo.
Step-by-step proof
Cargo.tomlno longer contains any dependency withgit = "https://github.com/okx/reth"— all such entries were replaced withgit = "https://github.com/paradigmxyz/reth"or localpath = "deps/optimism/..."entries..reth-dev.tomlline 1 still declares[patch."https://github.com/okx/reth"]— this patches a URL that no Cargo.toml dependency uses, so Cargo ignores it entirely..reth-dev.tomllines 10, 60-61 referencereth-db-common,reth-trie-db,reth-trie-parallel— crates that don't exist in reth v1.11.0. When a developer runsjust build-dev /path/to/reth-v1.11.0, the generated.cargo/config.tomlwould reference non-existent paths.- The justfile's
validate-reth-devrecipe (line 131) explicitly checks that.reth-dev.tomlstays in sync withCargo.toml, andsync-reth-dev(line 194) is designed to update it. Neither was run as part of this PR.
Impact
This only affects the local development workflow (just build-dev), not production builds which use Cargo.toml directly. However, any developer who uses this workflow after merging this PR will encounter broken builds and will need to manually update the template or run just sync-reth-dev (which itself may need updates since the sync-reth-dev script greps for okx/reth entries that no longer exist).
How to fix
Run just sync-reth-dev /path/to/reth with a v1.11.0 reth checkout to regenerate the file, or manually update .reth-dev.toml to: (1) remove the dead [patch."https://github.com/okx/reth"] section, (2) remove references to deleted crates, (3) add entries for all new crates in the workspace dependencies, and (4) ensure OP-specific crates that now come from deps/optimism/ are handled appropriately.
| use alloy_primitives::{BlockHash, Bytes, U256}; | ||
| use alloy_rpc_types_eth::Withdrawals; | ||
| use op_alloy_consensus::OpDepositReceipt; | ||
| use core::fmt::Debug; |
There was a problem hiding this comment.
🟡 Unused import use core::fmt::Debug; on line 18. The only reference to Debug in this file is #[derive(Debug)] on line 52, which is a derive macro that fully qualifies the trait path internally and does not require an explicit use import. This will trigger an unused_imports warning under clippy.
Extended reasoning...
What the bug is
The PR adds use core::fmt::Debug; at line 18 of crates/builder/src/flashblocks/context.rs. This import is not used anywhere in the file.
How it manifests
The only reference to Debug in this file is the #[derive(Debug)] attribute on line 52 for the FlashblocksBuilderCtx struct. Derive macros in Rust generate trait implementations using fully qualified paths internally (e.g., core::fmt::Debug), so they do not require the trait to be in scope via a use import. A grep for Debug in the file confirms only two occurrences: the import on line 18 and the derive on line 52.
Why existing code does not prevent it
This import was added alongside the OpTxType import on line 19 as part of the migration refactor. It likely was added speculatively during development (perhaps for a trait bound that was later removed) and was not caught before the PR was submitted. The Rust compiler emits an unused_imports warning for this, and under the project’s clippy configuration (-D warnings), this warning becomes a hard error.
Impact
If CI enforces cargo clippy --all-targets --workspace -- -D warnings (as documented in CLAUDE.md), this unused import will cause a build failure. Even without strict CI enforcement, it is dead code that adds noise.
How to fix
Simply remove line 18:
- use core::fmt::Debug;Step-by-step proof
- Line 18:
use core::fmt::Debug;— this is the import under question. - Line 52:
#[derive(Debug)]— this is the only occurrence ofDebugin the file. #[derive(Debug)]expands toimpl core::fmt::Debug for FlashblocksBuilderCtx { ... }using fully qualified paths. It does not requireDebugto be in scope.- No function signatures, trait bounds, or other code in this file reference the
Debugtrait directly. - Therefore, the import on line 18 is unused and will trigger a clippy warning.
… submodule
Description
Type of Change
Code Guidelines
Before submitting your PR, please review the relevant code guidelines in the
docs/folder:Specific Guidelines by Component:
Checklist
docs/folderTesting
Additional Notes