Skip to content

chore: upgrade reth v0.0.9 → v2.0.0 (develop-v2)#332

Merged
chee-chyuan merged 18 commits into
develop-v2from
upgrade/develop-v2
Apr 29, 2026
Merged

chore: upgrade reth v0.0.9 → v2.0.0 (develop-v2)#332
chee-chyuan merged 18 commits into
develop-v2from
upgrade/develop-v2

Conversation

@chee-chyuan
Copy link
Copy Markdown

Summary

  • Upgrades all reth-* git dependencies from tag = "v0.0.9" to branch = "develop-v2" (reth 2.0.0)
  • Moves reth-primitives-traits to its new home at bnb-chain/reth-core (branch main)
  • Updates triedb from tag = "v0.0.2" to branch = "develop"; adds new rust-eth-triedb-state-trie crate
  • Removes reth-primitives (dissolved into reth-ethereum-primitives); removes revm-context-interface (merged into revm-context)
  • Bumps alloy 1.1.3 → 1.8.2, alloy-primitives 1.4.1 → 1.5.6, revm 34 → 36, revm-database 10 → 12, alloy-evm 0.26.3 → 0.30.0

Status

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)

  • BscPrimitives must implement NodePrimitives — new required associated types (Block, Result) in reth-core v0.3.0 (src/node/primitives.rs)
  • BscBlock / BscBlockBody must implement the updated Block / BlockBody traits

Mechanical (48 errors)

  • All use reth_primitives::* imports → reth_ethereum_primitives::* or reth_primitives_traits::*

API removals / moves

  • revm_context_interface::*revm_context::* (4 files)
  • reth::payload::EthPayloadBuilderAttributesreth_ethereum_payload_builder::EthPayloadBuilderAttributes
  • reth_payload_primitives::PayloadBuilderAttributes removed from PayloadTypes trait
  • reth_primitives_traits::serde_bincode_compat removed
  • reth_evm::TransactionEnv moved
  • reth_tasks::Runtime::spawn_critical removed

Trait 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 removed
  • validate_transactions — new generic type param added
  • validate_block_pre_execution, withdrawals, decompress, create_executor — incompatible signatures
  • BscNetworkBuilderNetworkBuilder<Node, Pool> trait signature changed
  • InvalidPoolTransactionError: From<InvalidTransactionError> impl no longer auto-provided

🤖 Generated with Claude Code

Chee Chyuan Ang and others added 14 commits April 23, 2026 14:07
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>
@chee-chyuan chee-chyuan changed the base branch from develop to develop-v2 April 28, 2026 06:42
chee-chyuan and others added 4 commits April 29, 2026 14:04
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>
@chee-chyuan chee-chyuan marked this pull request as ready for review April 29, 2026 06:40
@chee-chyuan chee-chyuan requested a review from joey0612 as a code owner April 29, 2026 06:40
@chee-chyuan chee-chyuan merged commit 105e9c3 into develop-v2 Apr 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant