feat: upgrade all reth dependencies from v1.11.3 to v2.0.0#207
feat: upgrade all reth dependencies from v1.11.3 to v2.0.0#207tac0turtle merged 17 commits intomainfrom
Conversation
These crates were extracted from the reth monorepo in v2.0.0 and published to crates.io as version 0.1.0. Update workspace dependencies to reference crates.io instead of the git repository.
- Remove serde-bincode-compat feature (removed from reth-primitives-traits) - Remove RlpBincode impl (trait no longer exists) - Remove explicit SignedTransaction impls (now blanket-implemented) - Update Decompress::decompress to return DecompressError instead of DatabaseError - Update imports accordingly
- Remove unused reth-primitives dependency (crate removed in v2.0.0) - Remove is_pure method from Precompile impl (removed from trait in revm 36)
- Remove reth-primitives dependency (deleted upstream) - Remove PayloadBuilderAttributes trait (merged into PayloadAttributes) - Refactor EvolveEnginePayloadBuilderAttributes to impl PayloadAttributes - Change PayloadBuilder::Attributes to EvolveEnginePayloadAttributes - Migrate PayloadConfig to include payload_id field - Migrate BuildArguments to include execution_cache and trie_handle - Rename TransactionEnv to TransactionEnvMut (alloy-evm) - Update TryIntoTxEnv to new 3-generic-param signature - Add consensus_ref to PoolTransaction impl - Fix build_with_tasks generic args (3 → 2) - Add slot_num field to BlockEnv initializers - Remove set_state_clear_flag (handled by EVM spec) - Update BlockBuilder::finish to accept precomputed state root - Fix receipt conversion (replace into_rpc with map_logs) - Fix Withdrawals/Cow type mismatches - Rename extra_data_bytes to extra_data - Fix reth_primitives imports to alloy_consensus/reth_primitives_traits - Update BlockExecutorFactory::create_executor to use StateDB bound - Also remove reth-primitives from tests/Cargo.toml
- Migrate reth_primitives::{Header, Transaction} to alloy_consensus::Header
and reth_ethereum_primitives::Transaction
- Remove with_disable_proof_v2() from TreeConfig (method removed in v2.0.0)
Add missing const fn annotations and remove useless .into() conversion.
📝 WalkthroughWalkthroughUpgrades workspace Rust minimum version to 1.93 and pins reth dependencies to v2.0.0 (from v1.11.3). Updates revm to 36.0.0 and adjusts multiple crates' trait implementations, executor logic, and payload builder interfaces to align with upstream API changes. Changes
Estimated code review effort🎯 5 (Critical) | ⏱️ ~95 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Claude finished @randygrok's task —— View job Reviewing this reth v2.0.0 upgrade PR Review Tasks
📋 Overall AssessmentThis is a well-executed upgrade from reth v1.11.3 to v2.0.0 with corresponding upgrades to revm 36 and alloy-evm 0.30. The migration demonstrates good understanding of the API changes and maintains backward compatibility where appropriate. Summary: ✅ Recommended for approval with minor suggestions for improvement. 🔍 Detailed Analysis✅ Strengths
|
# Conflicts: # Cargo.lock # Cargo.toml
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
crates/node/src/rpc.rs (1)
293-313: Collapse the duplicate request conversion paths.The wrapper now owns both conversions, but Lines 495-501 and 526-530 still reimplement them against
tx_req.0. Delegate the converters toEvTransactionRequest::try_into_sim_tx/try_into_tx_envso the next API change only has one place to update.Suggested refactor
impl SimTxConverter<RpcTxReq<EvRpcTypes>, EvTxEnvelope> for EvSimTxConverter { type Err = ValueError<RpcTxReq<EvRpcTypes>>; fn convert_sim_tx(&self, tx_req: RpcTxReq<EvRpcTypes>) -> Result<EvTxEnvelope, Self::Err> { - tx_req - .0 - .try_into_sim_tx() - .map(EvTxEnvelope::Ethereum) - .map_err(|err| err.map(EvTransactionRequest)) + tx_req.try_into_sim_tx() } } @@ fn convert_tx_env( &self, tx_req: RpcTxReq<EvRpcTypes>, evm_env: &EvmEnvFor<Evm>, ) -> Result<TxEnvFor<Evm>, Self::Error> { - tx_req - .0 - .try_into_tx_env(evm_env) - .map(EvTxEnv::from) - .map(Into::into) + tx_req.try_into_tx_env(evm_env).map(Into::into) } }Also applies to: 492-531
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@crates/node/src/rpc.rs` around lines 293 - 313, There are duplicated conversion paths that directly call into the inner tx request (tx_req.0) instead of using the wrapper's implementations; update all call sites that currently do tx_req.0.try_into_sim_tx(...) / tx_req.0.try_into_tx_env(...) to delegate to EvTransactionRequest's methods (EvTransactionRequest::try_into_sim_tx and EvTransactionRequest::try_into_tx_env) so the wrapper owns the conversion logic; ensure the callers preserve the same mapping/wrapping (e.g., mapping to EvTxEnvelope or EvTxEnv::from) but invoke the methods on the EvTransactionRequest value rather than accessing .0 so future API changes only need one place to update.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@crates/node/src/payload_service.rs`:
- Around line 219-237: The payload transaction decoding currently uses
TransactionSigned::network_decode which is the p2p-wire decoder; replace that
with the exact EIP-2718 decoder used by the executor (decode_2718_exact) so
build-time acceptance matches validation-time rules: in the closure that maps
over attributes.transactions, call the exact decoder (the same decode_2718_exact
used in crates/node/src/executor.rs) for each tx byte slice, keep the existing
tracing::warn on error and drop undecodable transactions, and ensure you use the
TransactionSigned type when invoking decode_2718_exact so the codepath mirrors
executor validation exactly.
---
Nitpick comments:
In `@crates/node/src/rpc.rs`:
- Around line 293-313: There are duplicated conversion paths that directly call
into the inner tx request (tx_req.0) instead of using the wrapper's
implementations; update all call sites that currently do
tx_req.0.try_into_sim_tx(...) / tx_req.0.try_into_tx_env(...) to delegate to
EvTransactionRequest's methods (EvTransactionRequest::try_into_sim_tx and
EvTransactionRequest::try_into_tx_env) so the wrapper owns the conversion logic;
ensure the callers preserve the same mapping/wrapping (e.g., mapping to
EvTxEnvelope or EvTxEnv::from) but invoke the methods on the
EvTransactionRequest value rather than accessing .0 so future API changes only
need one place to update.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 93026abd-e76d-4fb2-8b2b-7fec2c5db822
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (25)
Cargo.tomlcrates/ev-precompiles/Cargo.tomlcrates/ev-precompiles/src/mint.rscrates/ev-primitives/Cargo.tomlcrates/ev-primitives/src/pool.rscrates/ev-primitives/src/tx.rscrates/ev-revm/Cargo.tomlcrates/ev-revm/src/evm.rscrates/ev-revm/src/factory.rscrates/ev-revm/src/handler.rscrates/ev-revm/src/tx_env.rscrates/evolve/Cargo.tomlcrates/evolve/tests/consensus_tests.rscrates/node/Cargo.tomlcrates/node/src/attributes.rscrates/node/src/builder.rscrates/node/src/evm_executor.rscrates/node/src/executor.rscrates/node/src/lib.rscrates/node/src/node.rscrates/node/src/payload_service.rscrates/node/src/rpc.rscrates/node/src/txpool.rscrates/tests/Cargo.tomlcrates/tests/src/common.rs
💤 Files with no reviewable changes (5)
- crates/tests/Cargo.toml
- crates/ev-precompiles/Cargo.toml
- crates/ev-revm/Cargo.toml
- crates/ev-precompiles/src/mint.rs
- crates/node/Cargo.toml
| // Decode transactions from raw bytes. | ||
| attributes | ||
| .transactions | ||
| .take() | ||
| .unwrap_or_default() | ||
| .into_iter() | ||
| .filter_map(|tx_bytes| { | ||
| match TransactionSigned::network_decode(&mut tx_bytes.as_ref()) { | ||
| Ok(tx) => Some(tx), | ||
| Err(err) => { | ||
| tracing::warn!( | ||
| %err, | ||
| "dropping undecodable transaction from payload attributes" | ||
| ); | ||
| None | ||
| } | ||
| } | ||
| }) | ||
| .collect() |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# Check payload_service.rs around the mentioned lines
fd "payload_service.rs" --type fRepository: evstack/ev-reth
Length of output: 93
🏁 Script executed:
# Search for the executor.rs file and check for decode_2718_exact usage
fd "executor.rs" --type fRepository: evstack/ev-reth
Length of output: 118
🏁 Script executed:
# Search for decode_2718_exact usage across the codebase
rg "decode_2718_exact" -A 2 -B 2Repository: evstack/ev-reth
Length of output: 495
🏁 Script executed:
# Search for network_decode usage in the codebase
rg "network_decode" -A 2 -B 2 --type rustRepository: evstack/ev-reth
Length of output: 471
🏁 Script executed:
# Check the TransactionSigned type and available methods
rg "struct TransactionSigned|impl.*TransactionSigned" -A 5Repository: evstack/ev-reth
Length of output: 41
🏁 Script executed:
# Read payload_service.rs around the mentioned lines
sed -n '200,250p' crates/node/src/payload_service.rs | cat -nRepository: evstack/ev-reth
Length of output: 2328
🏁 Script executed:
# Read executor.rs around the decode_2718_exact usage
sed -n '1,100p' crates/node/src/executor.rs | cat -nRepository: evstack/ev-reth
Length of output: 4424
🏁 Script executed:
# Check for PayloadBuilderError definition
rg "enum PayloadBuilderError|struct PayloadBuilderError" -A 10Repository: evstack/ev-reth
Length of output: 41
🏁 Script executed:
# Look for the PayloadBuilderError::other method or implementation
rg "PayloadBuilderError" -A 3 | head -40Repository: evstack/ev-reth
Length of output: 2502
🏁 Script executed:
# Search for TransactionSigned and its decoding methods
rg "TransactionSigned" crates/node/src/payload_service.rs -B 3 -A 3 | head -30Repository: evstack/ev-reth
Length of output: 971
🏁 Script executed:
# Check imports to see where TransactionSigned comes from
head -50 crates/node/src/payload_service.rs | grep -E "^use|^import"Repository: evstack/ev-reth
Length of output: 616
🏁 Script executed:
# Search for decode_2718 methods in the codebase
rg "decode_2718" --type rustRepository: evstack/ev-reth
Length of output: 627
🏁 Script executed:
# Look for how decode_2718_exact is imported/used in executor.rs
head -100 crates/node/src/executor.rs | grep -E "decode|Decodable"Repository: evstack/ev-reth
Length of output: 118
🏁 Script executed:
# Check if TransactionSigned has decode_2718_exact method
rg "fn decode_2718" --type rustRepository: evstack/ev-reth
Length of output: 41
🏁 Script executed:
# Find ev_primitives crate or definition
fd "ev_primitives" -type dRepository: evstack/ev-reth
Length of output: 229
🏁 Script executed:
# Look for TransactionSigned definition
rg "pub.*struct TransactionSigned|pub.*type TransactionSigned" --type rustRepository: evstack/ev-reth
Length of output: 132
🏁 Script executed:
# Check what TransactionSigned actually is - search across codebase
rg "TransactionSigned.*=" --type rust | head -20Repository: evstack/ev-reth
Length of output: 346
🏁 Script executed:
# Look for network_decode method definition
rg "fn network_decode" --type rustRepository: evstack/ev-reth
Length of output: 41
🏁 Script executed:
# Check the actual TxTy type and its relationship to TransactionSigned
rg "type TxTy|struct TxTy" --type rust -A 2Repository: evstack/ev-reth
Length of output: 277
🏁 Script executed:
# Find EvTxEnvelope definition and methods
rg "pub.*struct EvTxEnvelope|impl.*EvTxEnvelope" -A 3 --type rustRepository: evstack/ev-reth
Length of output: 5099
🏁 Script executed:
# Look for decode methods in EvTxEnvelope
rg "fn.*decode" crates/ev-primitives/src/tx.rs -A 2Repository: evstack/ev-reth
Length of output: 856
🏁 Script executed:
# Check the full ev-primitives/src/tx.rs file to understand the type structure
wc -l crates/ev-primitives/src/tx.rsRepository: evstack/ev-reth
Length of output: 93
🏁 Script executed:
# Read the tx.rs file to understand EvTxEnvelope
head -200 crates/ev-primitives/src/tx.rs | tail -100Repository: evstack/ev-reth
Length of output: 3336
🏁 Script executed:
# Search for all decode methods in ev-primitives
rg "decode" crates/ev-primitives/src/ --type rustRepository: evstack/ev-reth
Length of output: 2266
🏁 Script executed:
# Check what trait provides network_decode and decode_2718_exact
rg "fn network_decode|fn decode_2718_exact" --type rust -B 2Repository: evstack/ev-reth
Length of output: 41
🏁 Script executed:
# Look for Decodable2718 trait definition and methods
rg "trait Decodable2718|impl.*Decodable2718" --type rust -A 5Repository: evstack/ev-reth
Length of output: 41
🏁 Script executed:
# Search for all methods on EvTxEnvelope
rg "impl.*EvTxEnvelope" crates/ev-primitives/src/tx.rs -A 20 | head -100Repository: evstack/ev-reth
Length of output: 3124
🏁 Script executed:
# Check if network_decode or decode_2718_exact is imported from alloy
rg "network_decode|decode_2718_exact" --type rust -B 3 | head -50Repository: evstack/ev-reth
Length of output: 736
🏁 Script executed:
# Look at the actual usage pattern in executor.rs more carefully
sed -n '1,150p' crates/node/src/executor.rsRepository: evstack/ev-reth
Length of output: 5485
🏁 Script executed:
# Search for where decode_2718_exact is actually being called and what it operates on
grep -r "decode_2718_exact" crates/ --include="*.rs" -B 5 -A 5Repository: evstack/ev-reth
Length of output: 862
🏁 Script executed:
# Check if there are any uses of Decodable2718 trait in the codebase
rg "Decodable2718" --type rust -B 2 -A 5Repository: evstack/ev-reth
Length of output: 3696
🏁 Script executed:
# Look at what TxTy is and if it's related to EvTxEnvelope
rg "use.*TxTy|type.*TxTy" --type rustRepository: evstack/ev-reth
Length of output: 640
🏁 Script executed:
# Check the executor.rs around the decode_2718_exact call more broadly
sed -n '1,200p' crates/node/src/executor.rsRepository: evstack/ev-reth
Length of output: 7135
🏁 Script executed:
# Check if EvTxEnvelope or TransactionSigned has decode_2718_exact
rg "impl.*Decodable2718.*EvTxEnvelope|impl.*Decodable2718.*TransactionSigned" --type rust -A 10Repository: evstack/ev-reth
Length of output: 41
🏁 Script executed:
# Search for any decode_2718_exact implementations
rg "fn decode_2718_exact" --type rust -B 3 -A 5Repository: evstack/ev-reth
Length of output: 41
🏁 Script executed:
# Check what alloy provides for Decodable2718
web_search alloy-consensus Decodable2718 decode_2718_exact documentationRepository: evstack/ev-reth
Length of output: 109
🏁 Script executed:
# Check if TransactionSigned can call decode_2718_exact
rg "TransactionSigned.*decode_2718" --type rustRepository: evstack/ev-reth
Length of output: 182
🏁 Script executed:
# Search for Decodable2718 trait definition or imports
rg "trait Decodable2718|from alloy.*Decodable2718" --type rust -A 5Repository: evstack/ev-reth
Length of output: 41
🏁 Script executed:
# Look at the validator.rs more carefully to see how it uses decode_2718
sed -n '1,100p' crates/node/src/validator.rs | head -50Repository: evstack/ev-reth
Length of output: 1763
🏁 Script executed:
# Search for any EvTxEnvelope being decoded
rg "EvTxEnvelope.*decode|decode.*EvTxEnvelope" --type rust -B 2 -A 2Repository: evstack/ev-reth
Length of output: 372
🏁 Script executed:
# Check what methods are available on the Transaction types
rg "decode_2718" --type rustRepository: evstack/ev-reth
Length of output: 627
🏁 Script executed:
# Verify the exact signature and location of TxTy decode_2718_exact
rg "TxTy.*decode_2718_exact" --type rust -B 5 -A 5Repository: evstack/ev-reth
Length of output: 862
🏁 Script executed:
# Check what TxTy actually is - is it a trait or type
rg "pub.*type TxTy|impl.*TxTy.*decode" --type rust | head -20Repository: evstack/ev-reth
Length of output: 41
🏁 Script executed:
# Check if there's any way TransactionSigned could get decode_2718_exact through a trait
rg "impl.*for.*TransactionSigned|impl.*for.*EvTxEnvelope" crates/ev-primitives/ --type rust -A 3 | head -40Repository: evstack/ev-reth
Length of output: 2385
Use exact EIP-2718 decoding for Engine API transactions to match execution-time validation.
Line 226 uses network_decode, which is documented as the Ethereum p2p-wire decoder; the executor uses decode_2718_exact during block execution. With the current filter_map, malformed attribute bytes may silently drop here while crates/node/src/executor.rs enforces exact decoding during validation, creating a consensus mismatch where build-time acceptance rules diverge from validation-time rules.
The correct fix should follow the executor pattern:
Suggested fix
} else {
// Decode transactions from raw bytes.
attributes
.transactions
.take()
.unwrap_or_default()
.into_iter()
- .filter_map(|tx_bytes| {
- match TransactionSigned::network_decode(&mut tx_bytes.as_ref()) {
- Ok(tx) => Some(tx),
- Err(err) => {
- tracing::warn!(
- %err,
- "dropping undecodable transaction from payload attributes"
- );
- None
- }
- }
- })
- .collect()
+ .map(|tx_bytes| {
+ TxTy::<EvPrimitives>::decode_2718_exact(tx_bytes.as_ref())
+ .map_err(PayloadBuilderError::other)
+ })
+ .collect::<Result<Vec<_>, _>>()?
};🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@crates/node/src/payload_service.rs` around lines 219 - 237, The payload
transaction decoding currently uses TransactionSigned::network_decode which is
the p2p-wire decoder; replace that with the exact EIP-2718 decoder used by the
executor (decode_2718_exact) so build-time acceptance matches validation-time
rules: in the closure that maps over attributes.transactions, call the exact
decoder (the same decode_2718_exact used in crates/node/src/executor.rs) for
each tx byte slice, keep the existing tracing::warn on error and drop
undecodable transactions, and ensure you use the TransactionSigned type when
invoking decode_2718_exact so the codepath mirrors executor validation exactly.
Summary
reth-primitivesimports toalloy-consensus/reth-primitives-traits/reth-ethereum-primitivesPayloadBuilderAttributestrait —PayloadAttributesused directlyResultGas,new_mainnet_with_spec,TransactionEnvMutStateDBtrait bound (replacesDatabase + State)into_rpcremovalreth-codecsandreth-primitives-traitsto crates.ioTest plan
cargo checkpasses for all crates-D warningsSummary by CodeRabbit
Release Notes
Chores
Refactors