chore: merge develop-v2.2-new into develop (conflict resolved, pin reth to de11c921)#361
chore: merge develop-v2.2-new into develop (conflict resolved, pin reth to de11c921)#361chee-chyuan wants to merge 21 commits into
Conversation
* chore: upgrade reth v0.0.9 → develop-v2 (reth 2.0.0)
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>
* fix: implement NodePrimitives/BlockBody for BSC primitives (reth 2.0.0)
- 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>
* chore: source reth-core crates from git tag v0.1.1
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>
* chore: switch reth-core crates to branch v0.1.1-v2
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>
* fix: replace reth_primitives imports with reth 2.0 equivalents
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>
* fix: replace revm_context_interface with revm::context_interface
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>
* fix: replace EthPayloadBuilderAttributes with EthPayloadAttributes (Group 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>
* fix: upgrade reth-bsc to develop-v2 (reth 2.0.0)
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>
* fix: resolve clippy errors for CI
- 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>
* chore: switch reth dependency from develop-v2 to v0.1.1-v2
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* chore: revert reth to develop-v2, remove patch section for reth-core
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>
* chore: update Cargo.lock
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: restore [patch.crates-io] for reth-core transitive deps
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>
* chore: remove [patch.crates-io] and update reth to latest develop-v2
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>
* chore: regenerate Cargo.lock after merge conflict resolution
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: remove stale EngineApiMessageVersion::V1 arg from fork_choice_updated
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>
* fix: replace reth_primitives with reth_primitives_traits in fork_recover tests, remove stale version field from FCU pattern match
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Chee Chyuan Ang <cheechyuanang@Chees-MacBook-Pro-2.local>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Split PrecompileError into fatal PrecompileError and non-fatal PrecompileHalt - Add reservoir: u64 parameter to all precompile functions (EIP-8037) - Update PrecompileOutput::new/revert/halt to 3-arg form with reservoir - Replace output.reverted field with output.is_success()/is_halt() - Fix PrecompileError::other -> PrecompileError::Fatal(String) - Add cfg_env() method to Evm impl for BscEvm - Add gas_limit() and slot_number() to ExecutionPayload for BscExecutionData - Add slot_number: None to NextBlockEnvAttributes and EthPayloadAttributes literals - Add block_access_list_hash/slot_number to Header constructors in assembler - Add slot_number to EthBlockExecutionCtx constructors in config - Change commit_transaction return type to GasOutput - Fix HRTB E0276 in builder.rs execute_transaction_with_commit_condition - Fix InitialAndFloorGas::new(0,0) and ResultGas::new(0,0,0) constructors - Fix apply_eip7702_auth_list signature to include _init_and_floor_gas param - Fix Precompile decomposition to use id()/address() getters + store in trace entry Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add block_access_list_hash() and slot_number() to MockHeader in snapshot tests - Fix iavl.rs test assertions: PrecompileError::other no longer exists, invalid proof cases now return Ok(PrecompileOutput::halt(...)) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace deprecated Gas::spent(), ResultGas::new(0,0,0), and ExecutionResult::gas_used() calls that fail under -D warnings. Update bsc-ef-tests alloy/revm versions to match main crate (revm 38, alloy 2.0) and add missing Header fields block_access_list_hash and slot_number. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Bump bnb-chain/reth branch develop-v2.1 → develop-v2.2 (048b7281) - Bump bnb-chain/reth-core branch v0.3.0-v2 → v0.3.1-v2 - Bump alloy-evm 0.33.0 → 0.34.0; alloy 2.0.0 → 2.0.4 crates - Add TxExecutionResult + Executor GAT to BlockExecutorFactory impl - Change commit_transaction to return GasOutput (infallible); defer hertz patch errors to finish() via deferred_error field - Remove DB: 'a bounds from executor/pre_execution/post_execution impls - Fix execute_transaction_with_commit_condition return type (GasOutput) - Extract gas via .tx_gas_used() in payload/bid_simulator - Wrap ConsensusError::Other strings in Arc<io::Error> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… branch=develop Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ly dropping Previously, when engine.new_payload() returned an Err (e.g. EngineUnavailable), the error was silently discarded with no log, making it impossible to diagnose broken engine integration from block import logs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Picks up fix(engine): defer MDBX read tx open to after trie wait in changeset task — reduces long-lived MDBX readers that caused ~16s GC stalls and validator slashing on BSC. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
BscBlock::rlp_length was filtering out empty withdrawals (Some([])) by treating them as None, making the computed block size 1 byte smaller than geth/erigon for any block that carries an empty withdrawals list. (cherry picked from commit 12556dc)
* chore: add more for debug p2p * chore: add more logs * chore: avoid fetch newest block by newblock which result in failed fetch and p2p reset * chore: avoid fetch unnecessary newest block * chore: request_blocks_by_range only by v2 peer * chore: fetch block prefer announce peer * chore: make reth-bsc peer-manager similar to geth-bsc * chore: try some p2p config * chore: update peer config * fix: fix forward vote bug which too large msg * chore: restore reth deps * chore: remove temp peer dump * chore: remove useless codes * chore: add force prune vote when stage sync * chore: update some trivals (cherry picked from commit a133c6c)
(cherry picked from commit 648696f)
(cherry picked from commit 7cdb875)
Co-authored-by: joey <10592664+joey0612@users.noreply.github.com> Co-authored-by: cbh876 <3930922419@qq.com> Co-authored-by: cbh876 <30834644+constbh@users.noreply.github.com> (cherry picked from commit a1c132d)
* fix: make receive block metrics correct * ci: pin udeps job to nightly-2026-05-11 cargo-udeps 0.1.61 segfaults on nightly >= 2026-05-19 due to an incompatibility with rustc internals. Pin to the last known-good nightly to unblock CI. A follow-up should migrate to cargo-machete to remove the nightly fragility entirely. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com> (cherry picked from commit 32a07ee)
fix: v2.2 prefetcher warmup
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
All reth-* deps from bnb-chain/reth now pinned to rev de11c921b7f20bb15720d90cb5e4ff1939c058c0 instead of branch = "develop-v2.2-new". Resolves conflicts in Cargo.toml, testing/bsc-ef-tests/Cargo.toml, src/node/evm/mod.rs, and src/node/network/block_import/service.rs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pull Request ReviewThis PR resolves a large merge conflict by adopting the Sensitive ContentNo sensitive content detected. Security Issues🟠 [HIGH] Potential state corruption risk from synthetic
Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
…erface revm-context-interface is not a direct dependency; use the re-export path revm::context_interface instead. Also removes the unused JournaledAccountTr import from node/evm/mod.rs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pull Request ReviewThis PR resolves a large merge conflict by taking the Sensitive ContentNo sensitive content detected. Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pull Request ReviewThis PR resolves a large merge by taking the Sensitive ContentNo sensitive content detected. Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
Switches all reth-* dependencies from rev de11c921 to rev = "485e37b738754f96603391f42ee529f9364b47a4" for deterministic builds. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Pull Request ReviewThis PR is a large merge and compatibility upgrade that rebases Sensitive ContentNo sensitive content detected. Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
Summary
Resolves the merge conflict from PR #360 (
develop-v2.2-new→develop), pulling the reth v2.2 upgrade plus all upstream changes from reth v2.0.0, v2.1.0, and v2.2.0 into reth-bsc'sdevelopbranch.Conflict resolution strategy: take the
develop-v2.2-newside for all changes (v2.2 API upgrades), with allbnb-chain/reth.gitdependencies pinned to revde11c921b7f20bb15720d90cb5e4ff1939c058c0instead ofbranch = "develop-v2.2-new".What's coming in from upstream reth
Storage layer (v2.0 default, v2.1 migrator)
reth db migrate-v2command for one-shot v1 → v2 migration without full resync (#23422; pruned-node fix #23716). After migration, the pipeline rebuilds senders / indices / trie locally from preserved Headers/Bodies — no network resync needed.WriteOptions::sync=trueby default (#23603) — directly affects the--statedb.triedbpath; prevents corruption on ungraceful shutdown.Engine backpressure (v2.0)
--engine.persistence-backpressure-thresholdflag (default16). Stalls new payload processing whencanonical_tip - last_persisted ≥ thresholdwhile persistence is in progress (#23280, #23308).persistence_backpressure_threshold > persistence_threshold(strict).memory_block_buffer_target) is below the backpressure threshold — otherwise backpressure stays continuously active and the engine stalls on every block.Performance (v2.0)
Networking (v2.2)
Dependency bumps
MDBX
MDBX_NOTLS→MDBX_NOSTICKYTHREADS(#23378) — read tx semantics change.Conflicts resolved
Cargo.tomlrev = de11c921testing/bsc-ef-tests/Cargo.tomlrev = de11c921src/node/evm/mod.rsCfgEnv,ContextTr,JournaledAccountTr)src/node/network/block_import/service.rsCargo.lockTest focus
High priority — likely BSC-affected behaviour
bsc::miner::payload::BscPayloadJob::start()still kicks off before the sleep, and that off-turn jobs survive newMiningContextarrivals without silently aborting.--engine.persistence-backpressure-threshold > --engine.persistence-threshold ≥ --engine.memory-block-buffer-target. Document recommended values for 0.45s / 1.5s block intervals.reth db migrate-v2against an existing v1 datadir —migrate-v2resetsSenderRecovery/TransactionLookup/IndexAccountHistory/IndexStorageHistory/MerkleExecute/MerkleUnwindcheckpoints to 0; pipeline rebuilds locally. Final head/state-root must match a fresh-synced node.Medium priority
sync=trueimpact on triedb commit latency and TPS ceiling.Sanity
cargo buildpassesmake maxperfbuild passescargo clippy --workspace --tests --all-featurescleancargo test --all -- --test-threads=1passesmake ef-testspassesKnown risks / compatibility
reth db migrate-v2or accept a full resync.migrate-v2, the pipeline rebuild leaves the node not producing blocks for a window proportional to chain tip — validators must be removed from the active set or the migration must be scheduled outside in-turn slots.Closes #360
🤖 Generated with Claude Code