chore: upgrade reth v0.0.9 → v2.0.0 (develop-v2)#332
Merged
Conversation
Dependency changes: - All reth-* crates: tag v0.0.9 → branch develop-v2 (reth 2.0.0) - reth-primitives removed; replaced by reth-ethereum-primitives (already depended on) - reth-primitives-traits: moved to bnb-chain/reth-core repo (branch main) - triedb: tag v0.0.2 → branch develop; adds rust-eth-triedb-state-trie - revm: 34.0.0 → 36.0.0; revm-database: 10→12; drops revm-context-interface; adds revm-bytecode, revm-state, revm-primitives, revm-interpreter, revm-database-interface - alloy: 1.1.3 → 1.8.2 (consensus/eips/genesis/network/rpc-types/signer) - alloy-primitives/dyn-abi/sol-*: 1.4.1 → 1.5.6 - alloy-chains: 0.2.23 → 0.2.33; alloy-evm: 0.26.3 → 0.30.0; alloy-rlp: 0.3.12 → 0.3.13 Source code conflicts (200 errors) remain to be resolved — see branch notes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove reth_primitives import (crate removed); use reth_primitives_traits::NodePrimitives and reth_ethereum_primitives::TransactionSigned directly - Fix BlockBody::withdrawals() return type: alloy_rpc_types::Withdrawals → alloy_eips::eip4895::Withdrawals (trait signature changed) - Remove serde_bincode_compat module: reth_primitives_traits::serde_bincode_compat no longer exists in v0.1.1; BscBlock/BscBlockBody bincode impls dropped - Use reth-primitives-traits v0.1.1 from crates.io (matches develop-v2's dependency; reth-core/main is on alloy 2.0.x which conflicts with develop-v2's alloy 1.8.x) Reduces compilation errors from 180 → 73. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use reth-core git repo (tag v0.1.1) instead of crates.io for all reth-core-published crates. Patch section ensures reth develop-v2's internal crates.io deps are also redirected to the same git source, keeping a single copy of each crate in the dependency graph. Patches applied: reth-primitives-traits, reth-codecs, reth-codecs-derive, reth-rpc-traits, reth-zstd-compressors. Note: reth-core/main (v0.3.0) cannot be used until reth develop-v2 bumps its reth-primitives-traits requirement to 0.3.x (requires alloy 2.0.x). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replaces tag = "v0.1.1" with branch = "v0.1.1-v2" across all five reth-core patches (reth-primitives-traits, reth-codecs, reth-codecs-derive, reth-rpc-traits, reth-zstd-compressors). The v0.1.1-v2 branch contains updates while remaining at version "0.1.1" and alloy 1.x, keeping full compatibility with reth develop-v2's dependency requirements. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
reth-primitives crate was removed in reth 2.0 (develop-v2). Migrate all
usages across 29 files to the correct new crate paths:
- reth_primitives::{TransactionSigned,Transaction,Block,BlockBody} → reth_ethereum_primitives
- reth_primitives::{GotExpected,GotExpectedBoxed,SealedHeader,SealedBlock,RecoveredBlock,NodePrimitives,BlockTy,HeaderTy} → reth_primitives_traits
- reth_primitives::Header → alloy_consensus::Header
- reth_primitives::gas_spent_by_transactions → reth_primitives_traits::receipt::gas_spent_by_transactions
- reth_primitives::InvalidTransactionError → reth_primitives_traits::transaction::error::InvalidTransactionError
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
revm_context_interface is no longer a standalone dependency in revm 36. It is re-exported via revm::context_interface. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…roup 3) EthPayloadBuilderAttributes was fully removed in locked reth commit 6fe9c72. Replace with alloy_rpc_types_engine::PayloadAttributes (aliased as EthPayloadAttributes): - Remove PayloadTypes::PayloadBuilderAttributes associated type (removed from trait) - Replace struct construction (no parent field, explicit fields, no Default) - Change method calls (.timestamp(), .prev_randao(), etc.) to field access - Convert withdrawals from Option<Vec<Withdrawal>> to Option<Withdrawals> - Fix PayloadConfig::new to take 3 args (add payload_id) - Fix MinerTrieDbPrefetcher::new to take 4 args (add WorkloadExecutor/TaskExecutor) - Thread TaskExecutor through BscPayloadBuilder and BidSimulator Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adapt to breaking API changes in reth 2.0 / alloy-evm 0.30: - BlockExecutor: use generic StateDB instead of &mut State<DB> - BscTxResult: new TxResult trait with result()/into_result() - ExecutionResult::Success: use ResultGas::new() instead of gas_used/gas_refunded - PoolBuilder: add Evm type parameter; build_pool takes evm_config - EthTransactionValidator: now takes 3 generic params (add Evm) - TransactionValidator: add associated type Block - BeaconEngineMessage::ForkchoiceUpdated: remove version field - fork_choice_updated: remove EngineApiMessageVersion argument - BlockEnv: add slot_num field (default 0) - Withdrawals: use .as_slice()/.into_inner() for Cow conversions - BscEngineApiTx: fix Arc<DatabaseEnv> -> DatabaseEnv type mismatch - StateRoot::overlay_root_with_updates: specify LegacyKeyAdapter explicitly - EthInstructions::new_mainnet: replace deprecated call with new_mainnet_with_spec - MainWorkWorker: add task_executor field for new bsc_miner API Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove unused `accumulate_blob_gas_used` method and its `Transaction` import - Remove useless `.into()` on `tx_signed.clone()` (same type conversion) - Suppress `too_many_arguments` lint on `BscPayloadJobGenerator::new` Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
reth-core deps already reference v0.1.1-v2 directly so [patch.crates-io] is not needed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
reth (develop-v2) pulls reth-core packages from crates.io transitively; the patch is needed to unify them with the git source used by reth-bsc directly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
reth develop-v2 now also references bnb-chain/reth-core directly, so no crates.io patch is needed to unify the types. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Bring in fork recovery, eth config, cross-region test fixes, and FutureBlock classification from develop-v2. Resolved conflicts by keeping develop-v2 reth/reth-core branch refs and upgrading triedb to tag v0.0.2 to match reth develop-v2 requirements. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dated The reth develop-v2 API dropped the version parameter; a second call site was introduced by the develop-v2 merge and needed the same fix. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ver tests, remove stale version field from FCU pattern match 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.
Summary
reth-*git dependencies fromtag = "v0.0.9"tobranch = "develop-v2"(reth 2.0.0)reth-primitives-traitsto its new home atbnb-chain/reth-core(branchmain)tag = "v0.0.2"tobranch = "develop"; adds newrust-eth-triedb-state-triecratereth-primitives(dissolved intoreth-ethereum-primitives); removesrevm-context-interface(merged intorevm-context)1.1.3 → 1.8.2, alloy-primitives1.4.1 → 1.5.6, revm34 → 36, revm-database10 → 12, alloy-evm0.26.3 → 0.30.0Status
Dependency resolution is complete and clean (no version conflicts). Source code does not compile yet — 200 errors remain from reth 2.0.0 API changes. This PR exists to track the work.
Known conflicts to resolve
High priority (root cause of ~100 errors)
BscPrimitivesmust implementNodePrimitives— new required associated types (Block,Result) in reth-core v0.3.0 (src/node/primitives.rs)BscBlock/BscBlockBodymust implement the updatedBlock/BlockBodytraitsMechanical (48 errors)
use reth_primitives::*imports →reth_ethereum_primitives::*orreth_primitives_traits::*API removals / moves
revm_context_interface::*→revm_context::*(4 files)reth::payload::EthPayloadBuilderAttributes→reth_ethereum_payload_builder::EthPayloadBuilderAttributesreth_payload_primitives::PayloadBuilderAttributesremoved fromPayloadTypestraitreth_primitives_traits::serde_bincode_compatremovedreth_evm::TransactionEnvmovedreth_tasks::Runtime::spawn_criticalremovedTrait signature changes
BlockBuilder::finish— 2 → 3 params (src/node/evm/builder.rs)execution_result— 3 → 4 params (src/evm/handler.rs)try_into_tx_env,on_new_head_block,commit_transaction— generic type params removedvalidate_transactions— new generic type param addedvalidate_block_pre_execution,withdrawals,decompress,create_executor— incompatible signaturesBscNetworkBuilder—NetworkBuilder<Node, Pool>trait signature changedInvalidPoolTransactionError: From<InvalidTransactionError>impl no longer auto-provided🤖 Generated with Claude Code