Skip to content

Conversation

@fridrik01
Copy link
Contributor

@fridrik01 fridrik01 commented Dec 16, 2025

This PR bumps reth dependency from v1.8.4 to v1.9.3. Note that it required bumping alloy dependency as well.

Reth v1.9.x contain several breaking SDK changes, most notable being:

  • BlockEnv fields are now accessed via trait methods instead of struct fields
  • ConfigureEngineEvm methods now return Result.
  • Evm and EvmFactory now require BlockEnv associated type
  • RpcConvert trait changed
  • EthApiSpec trait was simplified

This PR also syncs the expected_failures/ignored_tests/hive configs with upstream reth v1.9.3. Note that removed few passing EIP-6110 fork_Prague tests from expected failures as they are currently working, don't know why though.

Note: The alloy dependencies should align exactly with upstream reth v1.9.3 release , see here

Test plan

make pr
...
All PR checks passed! ✅

Summary by CodeRabbit

  • New Features

    • Block-level blob gas tracking during execution.
    • EVM memory limit exposed via RPC.
  • Improvements

    • Consistent accessor-based reads for block/environment values.
    • Updated header and POL handling to align blob gas tracking.
    • Simplified and tightened RPC surface.
  • Tests

    • Major expansion/reclassification of EIP-7610 and blob-limit tests; updated ignored tests and simulator references.
  • Chores

    • Dependency/tooling version bumps and simulator script/workflow updates to align with v1.9.3.

✏️ Tip: You can customize this high-level summary in your review settings.

@fridrik01 fridrik01 self-assigned this Dec 16, 2025
@coderabbitai
Copy link

coderabbitai bot commented Dec 16, 2025

📝 Walkthrough

Walkthrough

Upgrade to reth v1.9.3: dependency bumps and CI/simulator migrations from eest→eels with expanded EIP-7610 test coverage; EVM API exposes BlockEnv; accessor-based block fields and block-level blob gas tracking added; POL tx injection integrated; several config methods now return Result<..., Infallible>; RPC signer/API surface simplified.

Changes

Cohort / File(s) Summary
Testing & CI
/.github/assets/hive/expected_failures.yaml, /.github/assets/hive/ignored_tests.yaml, /.github/workflows/hive.yml, /.github/assets/hive/build_simulators.sh
Bumped header refs to v1.9.3; replaced eest simulator refs with eels; expanded/reorganized EIP-7610 test matrix and blob-limit entries; added ignored tests; updated simulator artifact names and fixture URLs.
Dependencies
Cargo.toml
Bumped crate and workspace dependency versions (reth → v1.9.3, alloy/revm deps, dev-deps, vergen change). Only version/pinning changes.
EVM types & factory
src/evm/mod.rs
Added associated type BlockEnv to Evm and EvmFactory implementations.
Block execution & assembler
src/node/evm/assembler.rs, src/node/evm/executor.rs
Switched to accessor-based block fields (timestamp(), basefee(), number(), gas_limit(), prevrandao()); added block-level blob_gas_used tracking and wiring into header/result; POL tx creation/injection logic updated.
EVM config
src/node/evm/config.rs
Changed evm_env_for_payload, context_for_payload, and tx_iterator_for_payload to return Result<..., Infallible> and wrapped returns in Ok(...).
RPC surface
src/rpc/api.rs, src/rpc/mod.rs
Removed dev-signer types/AddDevSigners; simplified RpcConvert bounds to use Evm = N::Evm (dropped TxEnv/Spec binds); removed some associated types; added evm_memory_limit.
Engine builder
src/engine/builder.rs
Changed InvalidPoolTransactionError::OversizedData from tuple to struct form ({ size, limit }) and adjusted call sites/semicolons.
Payload & misc fixes
src/engine/payload.rs, src/chainspec/mod.rs
Minor syntax/semicolon fixes and an error-return termination correction; no API signature changes.

Sequence Diagram(s)

sequenceDiagram
    participant BlockEnv as Block Environment
    participant Executor as BerachainBlockExecutor
    participant EVM as EVM
    participant POLTx as POL Transaction
    participant BlobTracker as Blob Gas Tracker
    participant Result as BlockExecutionResult

    BlockEnv->>Executor: provide block environment
    Executor->>BlockEnv: call timestamp(), basefee(), number(), gas_limit(), prevrandao()
    BlockEnv-->>Executor: return values

    alt Prague1 active
        Executor->>POLTx: construct POL tx (uses basefee(), number())
        POLTx->>EVM: execute POL tx
        EVM-->>Executor: POL receipt/result
        Executor->>Result: prepend POL receipt
    end

    loop each transaction
        Executor->>EVM: execute tx
        EVM-->>Executor: receipt & execution result
        alt Cancun active and tx has blobs
            Executor->>BlobTracker: add tx blob_gas_used
            BlobTracker-->>Executor: update block blob_gas_used
        end
    end

    Executor->>Result: finish() -> assemble receipts, state, blob_gas_used
    Result-->>Executor: return BlockExecutionResult (includes blob_gas_used)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • calbera

Poem

🐰 I hopped from v1.8 to v1.9 with glee,
blobs counted, POLs prepended with glee,
tests moved to eels and spread their might,
signatures wrapped, APIs trimmed light,
the rabbit cheers — CI springs to life tonight.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'chore: bump reth dependency to v1.9.3' directly and clearly summarizes the main change in the changeset, which is updating the reth dependency from v1.8.4 to v1.9.3 across Cargo.toml and related source files.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bump-reth-1-9-3

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@fridrik01 fridrik01 requested review from calbera and rezzmah December 16, 2025 15:08
@fridrik01 fridrik01 marked this pull request as ready for review December 18, 2025 15:52
@rezzmah
Copy link
Contributor

rezzmah commented Dec 19, 2025

looks like ./hive -client reth --sim "ethereum/eels" in reth vs ./hive -client reth --sim "ethereum/eels" in bera-reth, in build_simulators.sh. Also need to bump to https://github.com/ethereum/execution-spec-tests/releases/download/v5.3.0/fixtures_develop.tar.gz

@rezzmah
Copy link
Contributor

rezzmah commented Dec 19, 2025

certain tests in expected_failures like

tests/prague/eip6110_deposits/test_modified_contract.py::test_invalid_layout[fork_Prague-blockchain_test_engine-log_argument_index_offset-value_zero]

are in both eels/consume-rlp and eels/consume-engine in reth but only in consume-rlp in bera-reth - should be consistent

@rezzmah
Copy link
Contributor

rezzmah commented Dec 19, 2025

assembler.rs -> assemble_block recalculates blob_gas_used but it looks like reth upstream has added it as part of BlockAssemblerInput.output which serves as an optimization

Similar for receipts_root calculation in assemble_block

Copy link
Contributor

@rezzmah rezzmah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some minor changes as commented

@rezzmah
Copy link
Contributor

rezzmah commented Dec 19, 2025

RUSTSEC-2025-0073 to be removed from deny.toml. Possibly some other changes needed in deny.toml if needed to match reth


// append gas used
self.gas_used += gas_used;
self.blob_gas_used += tx.tx().blob_gas_used().unwrap_or(0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

eth equivalent is

        // only determine cancun fields when active
        if self.spec.is_cancun_active_at_timestamp(self.evm.block().timestamp().saturating_to()) {
            let tx_blob_gas_used = tx.tx().blob_gas_used().unwrap_or_default();

            self.blob_gas_used = self.blob_gas_used.saturating_add(tx_blob_gas_used);
        }

On berachain cancun is always active and the default will handle not active case but for consistency it'd be better to use same as upstream

receipts: self.receipts,
requests,
gas_used: self.gas_used,
blob_gas_used: self.blob_gas_used,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This blob_gas_used is passed to the assembler which no longer needs to re-calculate as noted in other comment

@rezzmah
Copy link
Contributor

rezzmah commented Dec 23, 2025

looks like ./hive -client reth --sim "ethereum/eels" in reth vs ./hive -client reth --sim "ethereum/eels" in bera-reth, in build_simulators.sh. Also need to bump to https://github.com/ethereum/execution-spec-tests/releases/download/v5.3.0/fixtures_develop.tar.gz

depends on bump berachain/hive#19

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
.github/assets/hive/build_simulators.sh (1)

2-2: Update the version reference in the comment.

The comment still references reth v1.8.1, but this PR upgrades to v1.9.3. Please update the comment to reflect the current version.

🔎 Proposed fix
-# Copied from reth v1.8.1
+# Copied from reth v1.9.3
📜 Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d7f5cff and ae06a76.

📒 Files selected for processing (5)
  • .github/assets/hive/build_simulators.sh
  • .github/assets/hive/expected_failures.yaml
  • deny.toml
  • src/node/evm/assembler.rs
  • src/node/evm/executor.rs
💤 Files with no reviewable changes (1)
  • deny.toml
🧰 Additional context used
📓 Path-based instructions (1)
src/**/*.rs

📄 CodeRabbit inference engine (CLAUDE.md)

src/**/*.rs: No comments in code unless explicitly requested
Use custom error types over generic errors
Extract magic numbers into documented constants
Write succinct documentation focusing on 'why' rather than 'what'

Files:

  • src/node/evm/executor.rs
  • src/node/evm/assembler.rs
🧠 Learnings (3)
📓 Common learnings
Learnt from: rezbera
Repo: berachain/bera-reth PR: 152
File: src/pool/transaction.rs:3-4
Timestamp: 2025-09-10T05:49:07.298Z
Learning: In reth v1.7.0 upgrade, BerachainPooledTransactionVariant type alias should use PooledTransactionVariant directly instead of EthereumTxEnvelope<TxEip4844WithSidecar<BlobTransactionSidecarVariant>>.
📚 Learning: 2025-12-01T21:16:41.509Z
Learnt from: CR
Repo: berachain/bera-reth PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-01T21:16:41.509Z
Learning: Applies to src/genesis/**/*.rs : Prague1 hardfork must be activated at genesis (time: 0) with 1 gwei minimum base fee

Applied to files:

  • src/node/evm/executor.rs
  • src/node/evm/assembler.rs
📚 Learning: 2025-09-10T05:49:07.298Z
Learnt from: rezbera
Repo: berachain/bera-reth PR: 152
File: src/pool/transaction.rs:3-4
Timestamp: 2025-09-10T05:49:07.298Z
Learning: In reth v1.7.0 upgrade, BerachainPooledTransactionVariant type alias should use PooledTransactionVariant directly instead of EthereumTxEnvelope<TxEip4844WithSidecar<BlobTransactionSidecarVariant>>.

Applied to files:

  • .github/assets/hive/expected_failures.yaml
  • src/node/evm/assembler.rs
🧬 Code graph analysis (2)
src/node/evm/executor.rs (3)
src/engine/payload.rs (2)
  • timestamp (38-40)
  • timestamp (112-114)
src/engine/mod.rs (1)
  • timestamp (252-254)
src/primitives/header.rs (1)
  • timestamp (332-334)
src/node/evm/assembler.rs (2)
src/primitives/header.rs (1)
  • timestamp (332-334)
src/transaction/pol.rs (1)
  • create_pol_transaction (16-53)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Security audit
  • GitHub Check: Run tests
  • GitHub Check: Check documentation
  • GitHub Check: Clippy lint
  • GitHub Check: semgrep-cloud-platform/scan
🔇 Additional comments (15)
src/node/evm/executor.rs (4)

58-59: LGTM! Blob gas tracking added correctly.

The blob_gas_used field is properly initialized and will be accumulated during transaction execution, addressing the optimization concern mentioned in the PR objectives about avoiding redundant blob gas calculations in the assembler.

Also applies to: 75-75


87-87: LGTM! Accessor methods correctly migrated.

All BlockEnv field accesses have been correctly migrated to use the new trait-based accessor methods (timestamp(), basefee(), number(), gas_limit()), aligning with the reth v1.9.3 breaking SDK changes mentioned in the PR objectives.

Also applies to: 101-101, 105-105, 175-175, 208-208, 242-242, 270-270, 299-299


242-245: LGTM! Blob gas accumulation follows upstream pattern.

The Cancun activation check and blob gas accumulation logic correctly follows the upstream pattern, as suggested in previous review feedback. The implementation properly handles the case when Cancun is not active by skipping the accumulation.


332-337: LGTM! BlockExecutionResult now includes blob_gas_used.

The blob_gas_used field is correctly included in the final BlockExecutionResult, which allows the assembler to use this computed value instead of recalculating it. This addresses the optimization concern raised in the PR objectives about redundant calculations in the assembler.

src/node/evm/assembler.rs (4)

9-9: LGTM! Imports updated correctly.

The new imports align with the reth v1.9.3 API changes, including the Block trait for accessor methods and the updated BlockExecutionResult structure.

Also applies to: 12-14


57-57: LGTM! Blob gas now sourced from executor, eliminating redundant calculation.

The assembler now receives blob_gas_used from the BlockExecutionResult (computed in the executor) instead of recalculating it, directly addressing the optimization concern raised in the PR objectives. The local variable is appropriately renamed to block_blob_gas_used to avoid shadowing.

Also applies to: 114-114, 118-118


62-62: LGTM! BlockEnv accessor methods correctly applied.

All block environment field accesses have been properly migrated to use the new accessor methods (timestamp(), basefee(), number(), beneficiary(), prevrandao(), gas_limit(), difficulty()), aligning with the reth v1.9.3 breaking SDK changes.

Also applies to: 72-72, 76-76, 136-136, 143-143, 145-148, 152-152


67-95: LGTM! Prague1 POL transaction injection implemented correctly.

The POL transaction injection logic for Prague1 is well-structured:

  • Validates proposer pubkey presence
  • Synthesizes the POL transaction using the correct base fee and block number from accessors
  • Prepends it to the transactions list
  • Validates receipt presence and transaction ordering

The implementation correctly ensures the POL transaction is the first transaction when Prague1 is active.

.github/assets/hive/build_simulators.sh (2)

32-33: Artifact naming is consistent with simulator change.

The artifact names correctly reflect the simulator name change from eest to eels. Note that per the PR comments, the expected_failures lists for eels/consume-rlp and eels/consume-engine should be made consistent with upstream reth to ensure these artifacts are properly tested.


15-15: The simulator invocation and fixtures configuration are consistent with upstream reth v1.9.3. Both configurations use the same simulator name (ethereum/eels) and fixtures URL (v5.3.0). The docker image paths referenced (hive/simulators/ethereum/eels/consume-engine:latest and hive/simulators/ethereum/eels/consume-rlp:latest) match those in the docker save commands. The use of bera-reth client and the inclusion of the berachain/berachain-rpc-compat simulator are intentional fork-specific customizations, not discrepancies with upstream.

Likely an incorrect or invalid review comment.

.github/assets/hive/expected_failures.yaml (5)

1-1: Version header updated correctly.

The version reference now accurately reflects the reth v1.9.3 source.


47-70: Excellent documentation of test failure rationale.

The added comments provide clear technical justification for why EIP-7610 collision tests and system contract tests are expected to fail, including references to the mathematical impossibility of certain scenarios on mainnet.


152-157: Clear explanation of blob limit test behavior.

The comment effectively explains why the blob limit test fails in eels/consume-rlp (pipeline import approach) but passes in eels/consume-engine, and clarifies that the failure actually indicates correct block rejection behavior.


195-244: EIP-7610 test entries added to eels/consume-rlp.

These test entries expand the EIP-7610 collision test coverage. Ensure these are consistent with upstream reth v1.9.3 as noted in the verification script above.


71-151: Test list consistency already matches upstream reth v1.9.3.

The eels/consume-engine section in the current PR is already aligned with upstream reth v1.9.3. Both contain 173 test entries with identical test type distributions. The eels/consume-rlp section (86 entries) is also consistent. The unique test distribution is preserved: test_engine_from_state_test appears only in consume-engine, and test_max_blobs_per_tx_fork_transition appears only in consume-rlp, matching the upstream configuration.

@fridrik01
Copy link
Contributor Author

RUSTSEC-2025-0073 to be removed from deny.toml. Possibly some other changes needed in deny.toml if needed to match reth

Question, should we not just copy the upstream rethdeny.toml to bera-reth and make the required adjustments from that, instead of basing the deny.toml from the default cargo init template?

@rezzmah
Copy link
Contributor

rezzmah commented Dec 23, 2025

RUSTSEC-2025-0073 to be removed from deny.toml. Possibly some other changes needed in deny.toml if needed to match reth

Question, should we not just copy the upstream rethdeny.toml to bera-reth and make the required adjustments from that, instead of basing the deny.toml from the default cargo init template?

open to it. whichever is more restrictive is better imo. for a diff PR tho

@rezzmah rezzmah self-requested a review December 26, 2025 10:00
Copilot AI review requested due to automatic review settings January 30, 2026 14:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR bumps the reth dependency from v1.8.4 to v1.9.3, adapting the codebase to handle several breaking SDK changes introduced in the new version. The update also aligns alloy dependencies with upstream reth v1.9.3 and synchronizes test configurations.

Changes:

  • Updated all reth and alloy dependencies to align with v1.9.3
  • Refactored BlockEnv field access to use trait methods instead of direct field access
  • Modified ConfigureEngineEvm trait methods to return Result types
  • Added BlockEnv associated type to Evm and EvmFactory implementations
  • Simplified RpcConvert trait bounds by replacing TxEnv and Spec with Evm parameter
  • Enhanced blob gas tracking with per-block accounting
  • Updated hive test configurations (eest → eels simulator, fixtures v5.1.0 → v5.3.0)

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.

Show a summary per file
File Description
Cargo.toml Bumped reth dependencies from v1.8.4 to v1.9.3, updated alloy packages from 1.0.37 to 1.0.41, and aligned versions with upstream
src/rpc/mod.rs Updated RpcConvert trait bounds to use Evm instead of TxEnv and Spec parameters
src/rpc/api.rs Removed AddDevSigners trait implementation, simplified RpcConvert bounds, added evm_memory_limit method, removed EthApiSpec associated types
src/node/evm/executor.rs Converted BlockEnv field access to method calls, added blob_gas_used tracking field and logic
src/node/evm/config.rs Updated ConfigureEngineEvm methods to return Result with Infallible error type
src/node/evm/assembler.rs Converted BlockEnv field access to method calls, updated blob_gas_used handling to use executor-computed value
src/evm/mod.rs Added BlockEnv associated type to Evm and EvmFactory trait implementations
src/engine/builder.rs Changed InvalidPoolTransactionError::OversizedData from tuple to struct variant
.github/workflows/hive.yml Renamed simulator from ethereum/eest to ethereum/eels across all test scenarios
.github/assets/hive/ignored_tests.yaml Updated header comment to reference reth v1.9.3, added new ignored test case
.github/assets/hive/expected_failures.yaml Updated header to v1.9.3, enhanced documentation for EIP-7610 and system contract tests, added extensive EIP-7610 test cases
.github/assets/hive/build_simulators.sh Updated simulator name from eest to eels, bumped fixtures from v5.1.0 to v5.3.0

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/assets/hive/build_simulators.sh (1)

15-46: ⚠️ Potential issue | 🔴 Critical

Critical: Naming mismatch will cause image loading to fail.

Lines 33-34 save eels_engine.tar and eels_rlp.tar, but load_images.sh (lines 15-16) expects /tmp/eest_engine.tar and /tmp/eest_rlp.tar. The prefix divergence (eels_ vs eest_) means the test job will fail to load these images. Fix the naming to match between build_simulators.sh and load_images.sh.

Additionally, line 15's TODO about pinning the eels branch remains open and should be tracked to prevent simulator source drift.

🧹 Nitpick comments (1)
src/node/evm/executor.rs (1)

242-246: Remove the inline comment to comply with the Rust style guidelines.

🧹 Proposed change
-        // only determine cancun fields when active
         if self.spec.is_cancun_active_at_timestamp(self.evm.block().timestamp().saturating_to()) {
As per coding guidelines: No comments in code unless explicitly requested.

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.

3 participants