Skip to content

chore: upgrade reth from v1.10.2 to v1.11.1 - #218

Merged
fridrik01 merged 9 commits into
mainfrom
bump-reth-1.11.1
Mar 10, 2026
Merged

fridrik01 merged 9 commits into
mainfrom
bump-reth-1.11.1

Conversation

@fridrik01

@fridrik01 fridrik01 commented Mar 3, 2026 •

Copy link
Copy Markdown
Contributor

This PR bumps reth dependency from v1.10.2 to v1.11.1. Note that it required bumping alloy and revm dependencies as well.

Reth v1.11.x contains several breaking SDK changes, most notable being:

  • BlockExecutor trait restructured with new type Result: TxResult associated type, requiring a new BerachainTxResult type in the executor
  • ReceiptBuilderCtx changed tx field to tx_type, updating the receipt builder accordingly
  • PoolBuilder trait gained an Evm generic parameter, updating BerachainPoolBuilder bounds
  • EngineTypes trait now requires ExecutionPayloadEnvelopeV6, added as alias to V5
  • EngineCapabilities::add_capability removed, requiring updated capability list building
  • EthTransactions::send_transaction gained an origin parameter, updating the RPC impl
  • TaskManager replaced by Runtime, updating all e2e tests

This PR also aligns with upstream behavioral changes:

  • Fixed excess blob gas fallback to correctly handle fork transitions beyond Cancun
  • Cached RLP length computations in the payload builder transaction loop, matching upstream optimizations

Additionally, cargo update resolved three new security advisories in transitive dependencies and removed the stale RUSTSEC-2025-0073 ignore from deny.toml.

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

Test plan

make pr
..
All PR checks passed! ✅

Summary by CodeRabbit

  • Chores

    • Bumped package version to 1.4.0-rc.5
    • Upgraded compatibility to reth v1.11.1 and updated core dependencies
    • Enhanced build toolchain for cross-platform builds (added g++ and ARM cross-toolchain)
  • Bug Fixes

    • Removed a security advisory from the ignore list
  • Tests

    • Updated end-to-end tests to use the newer runtime test harness instead of the previous task manager API

@coderabbitai

coderabbitai Bot commented Mar 3, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f923f175-396b-494d-968b-1e11883c4a17

📥 Commits

Reviewing files that changed from the base of the PR and between 793fc1d and 66732ce.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (3)
  • Cargo.toml
  • src/engine/rpc.rs
  • src/pool/mod.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/engine/rpc.rs

📝 Walkthrough

Walkthrough

Bumps reth to v1.11.1 and updates Cargo/Cross metadata; introduces BerachainTxResult and routes execution/commit flows through it; makes the pool builder generic over an EVM config; adjusts RPC send_transaction signature; replaces TaskManager with Runtime in e2e tests; small engine/evm/receipt refinements.

Changes

Cohort / File(s) Summary
Dependency & Release
Cargo.toml
Package version bumped and many dependencies updated (reth crates → v1.11.1, alloy and others), added sha2, serde (derive) toggle and eyre dev tooling.
Hive Metadata
.github/assets/hive/build_simulators.sh, .github/assets/hive/expected_failures.yaml, .github/assets/hive/ignored_tests.yaml
Updated synced reth version annotation from v1.10.2 → v1.11.1 (comments/documentation).
Build Matrix
Cross.toml
Added g++ for x86_64 and added g++ plus aarch64 cross-toolchain packages for aarch64 in pre-build apt installs.
Advisories
deny.toml
Removed RUSTSEC-2025-0073 from the advisories ignore list.
Engine
src/engine/mod.rs, src/engine/builder.rs, src/engine/rpc.rs
Added ExecutionPayloadEnvelopeV6 alias; cached RLP-length computations for block size estimation; changed capabilities assembly to append string capabilities without mutating cloned capability objects.
EVM Config
src/node/evm/config.rs
Changed defaulting logic for excess_blob_gas to depend on presence of blob_params rather than Cancún spec id.
Executor & Receipts
src/node/evm/executor.rs, src/node/evm/receipt.rs
Introduced public BerachainTxResult<H> (result, blob_gas_used, tx_type); unified execute/commit paths to use it; commit/receipt builders now accept/propagate tx_type and accumulate blob_gas_used.
Pool Builder
src/pool/mod.rs
Made PoolBuilder generic over Evm: ConfigureEvm<Primitives = BerachainPrimitives> + Clone + 'static; build_pool now takes evm_config; eip4844 enablement and KZG init adjusted; replaced spawn_blocking with spawn_blocking_task.
RPC API
src/rpc/api.rs
EthTransactions::send_transaction gained a TransactionOrigin parameter; implementation treats RPC submissions as Local for pool submission.
E2E Tests
tests/e2e/... (mod.rs, coinbase_system_state_change_test.rs, gas_limit_regression_test.rs, pol_revert_test.rs, transaction_tests.rs)
Replaced TaskManager usages with Runtime in test setup helpers and node testing initialization; updated imports and call sites.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant BlockExecutor
    participant ReceiptBuilder
    participant StateCommitter

    Client->>BlockExecutor: execute_transaction_without_commit(consensus_tx)
    BlockExecutor->>BlockExecutor: transact_raw(consensus_tx) → ResultAndState
    BlockExecutor->>BlockExecutor: build BerachainTxResult{result, blob_gas_used, tx_type}
    BlockExecutor-->>Client: BerachainTxResult

    Client->>BlockExecutor: commit_transaction(BerachainTxResult)
    BlockExecutor->>ReceiptBuilder: build_receipt(ReceiptBuilderCtx with tx_type)
    ReceiptBuilder-->>BlockExecutor: Receipt
    BlockExecutor->>StateCommitter: update state (use blob_gas_used, tx_type)
    StateCommitter-->>BlockExecutor: commit complete
    BlockExecutor-->>Client: return cumulative_gas_used
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Possibly related PRs

Suggested reviewers

  • rezzmah
  • calbera

"🐰 I hopped through crates and bumped the chain,
Wrapped results with blobs and set types to explain.
Pools now take EVMs, tests trade tasks for runtime cheer,
Reth rose a notch — the rabbit gives a happy ear.
Hop, code, commit — celebrate with a carrot beer!"

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 62.50% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: upgrading reth from v1.10.2 to v1.11.1. It is concise, clear, and specific about the primary objective.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bump-reth-1.11.1

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 self-assigned this Mar 3, 2026
@fridrik01
fridrik01 requested a review from calbera March 3, 2026 12:39
@fridrik01
fridrik01 marked this pull request as ready for review March 3, 2026 16:57
Copilot AI review requested due to automatic review settings March 3, 2026 16:57

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 upgrades the project’s upstream reth SDK from v1.10.2 to v1.11.1 (and aligns dependent crates like alloy/revm), updating Berachain’s integrations to compile and behave correctly with the new APIs (executor, receipt building, pool builder generics, engine capabilities, RPC changes, and e2e runtime wiring).

Changes:

  • Bump reth + related dependencies and update code to match v1.11.x breaking API changes (executor TxResult, receipt builder ctx change, pool builder Evm generic, engine payload envelope v6 alias, etc.).
  • Update RPC + engine API glue to match upstream interface changes (e.g., send_transaction origin param, capability exchange).
  • Update e2e tests to use reth::tasks::Runtime instead of TaskManager.

Reviewed changes

Copilot reviewed 19 out of 20 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
Cargo.toml Bumps reth git tags to v1.11.1 and updates alloy/revm-related dependency versions.
Cargo.lock Large lockfile refresh from cargo update after dependency bumps.
src/node/evm/executor.rs Adapts block execution to the new BlockExecutor/TxResult shape and updates transaction execution/commit plumbing.
src/node/evm/receipt.rs Updates receipt building to use ReceiptBuilderCtx { tx_type, ... } API.
src/pool/mod.rs Updates pool builder trait signature to include Evm config/generic and wires validator creation accordingly.
src/rpc/api.rs Updates EthTransactions::send_transaction signature to accept the new origin parameter.
src/engine/rpc.rs Updates capability list building after upstream removal of add_capability.
src/engine/mod.rs Adds required ExecutionPayloadEnvelopeV6 associated type (aliased to V5).
src/engine/builder.rs Matches upstream optimization by caching RLP length computations within the tx loop.
tests/e2e/* Updates e2e scaffolding and tests to use Runtime and new node builder expectations.
deny.toml Removes stale RustSec ignore now that the upgrade resolves it.
Cross.toml Adds g++ (and cross variants) to the build image dependencies.
.github/assets/hive/* Updates “synced with reth” markers to v1.11.1.

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

Comment on lines 41 to +43
async fn setup_test_with_gas_boundary_pol_contract()
-> eyre::Result<(TaskManager, Arc<BerachainChainSpec>)> {
let tasks = TaskManager::current();
-> eyre::Result<(Runtime, Arc<BerachainChainSpec>)> {
let runtime = Runtime::with_existing_handle(tokio::runtime::Handle::current())?;

Copilot AI Mar 3, 2026

Copy link

Choose a reason for hiding this comment

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

This function signature formatting (line break before ->) is not rustfmt output and will fail the cargo fmt --check job. Please run cargo fmt (or adjust formatting) so the signature matches repository rustfmt style.

Copilot uses AI. Check for mistakes.
Comment on lines +32 to +33
async fn setup_test_with_reverting_pol_contract() -> eyre::Result<(Runtime, Arc<BerachainChainSpec>)>
{

Copilot AI Mar 3, 2026

Copy link

Choose a reason for hiding this comment

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

The brace placement/line breaking in this function signature doesn’t appear to be rustfmt output and is likely to fail the cargo fmt --check CI job. Please run cargo fmt to ensure the signature/braces are formatted consistently.

Suggested change
async fn setup_test_with_reverting_pol_contract() -> eyre::Result<(Runtime, Arc<BerachainChainSpec>)>
{
async fn setup_test_with_reverting_pol_contract() -> eyre::Result<(Runtime, Arc<BerachainChainSpec>)> {

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +47
async fn setup_test_with_state_change_contract() -> eyre::Result<(Runtime, Arc<BerachainChainSpec>)>
{

Copilot AI Mar 3, 2026

Copy link

Choose a reason for hiding this comment

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

Similar to other e2e helpers: the function signature/bracing here doesn’t look rustfmt-formatted. Please run cargo fmt to avoid failing the formatting check in CI.

Suggested change
async fn setup_test_with_state_change_contract() -> eyre::Result<(Runtime, Arc<BerachainChainSpec>)>
{
async fn setup_test_with_state_change_contract() -> eyre::Result<(Runtime, Arc<BerachainChainSpec>)> {

Copilot uses AI. Check for mistakes.
Comment thread src/rpc/api.rs
Comment on lines 447 to 466
@@ -457,7 +458,9 @@ where

let pool_transaction = <Self::Pool as TransactionPool>::Transaction::from_pooled(recovered);

// submit the transaction to the pool with a `Local` origin
// Upstream reth v1.11.1 changed eth_sendRawTransaction to pass External origin,
// but Berachain treats all RPC-submitted transactions as Local to bypass pool
// capacity limits and ensure consistent block gas utilization.
let AddedTransactionOutcome { hash, .. } =
self.pool().add_transaction(TransactionOrigin::Local, pool_transaction).await?;

Copilot AI Mar 3, 2026

Copy link

Choose a reason for hiding this comment

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

_origin is ignored and all RPC-submitted transactions are forced to TransactionOrigin::Local. This bypasses txpool "external" capacity/limits and can weaken DoS protections if the RPC endpoint is exposed beyond trusted clients. Consider honoring the provided origin, or only treating calls as Local behind an authenticated/whitelisted RPC, or making this behavior configurable via node/RPC config.

Copilot uses AI. Check for mistakes.
Comment thread src/engine/rpc.rs
Comment on lines 619 to +624
async fn exchange_capabilities(&self, _capabilities: Vec<String>) -> RpcResult<Vec<String>> {
let mut capabilities = self.inner.capabilities().clone();
BERACHAIN_ADDITIONAL_CAPABILITIES.iter().for_each(|&cap| capabilities.add_capability(cap));
Ok(capabilities.list())
let mut caps = self.inner.capabilities().list();
for &cap in BERACHAIN_ADDITIONAL_CAPABILITIES {
caps.push(cap.to_string());
}
Ok(caps)

Copilot AI Mar 3, 2026

Copy link

Choose a reason for hiding this comment

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

caps is built by appending additional capabilities onto self.inner.capabilities().list(), which can introduce duplicates (previously add_capability ensured uniqueness). Consider de-duplicating (e.g., via a HashSet/BTreeSet while preserving order) before returning, to avoid sending repeated capability strings to the CL.

Copilot uses AI. Check for mistakes.
Comment thread src/node/evm/executor.rs
Comment on lines 12 to +17
use alloy_consensus::Transaction;
use alloy_eips::{Encodable2718, eip7685::Requests};
use alloy_evm::block::state_changes::{balance_increment_state, post_block_balance_increments};
use alloy_evm::{
RecoveredTx,
block::state_changes::{balance_increment_state, post_block_balance_increments},
};

Copilot AI Mar 3, 2026

Copy link

Choose a reason for hiding this comment

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

There are unused imports here (Encodable2718 and RecoveredTx). CI runs cargo clippy -- -D warnings, so these will fail the build; please remove them or use them as intended.

Copilot uses AI. Check for mistakes.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (7)
src/engine/builder.rs (1)

288-289: Consider extracting the block overhead constant.

The magic number 1024 representing estimated block header/structure overhead should be extracted into a documented constant for clarity.

♻️ Suggested refactor
+/// Estimated overhead for block header, uncles, and structure encoding in RLP bytes.
+const BLOCK_STRUCTURE_OVERHEAD: usize = 1024;
+
 // ... in the function body:
-        let estimated_block_size_with_tx =
-            block_transactions_rlp_length + tx_rlp_len + withdrawals_rlp_length + 1024;
+        let estimated_block_size_with_tx =
+            block_transactions_rlp_length + tx_rlp_len + withdrawals_rlp_length + BLOCK_STRUCTURE_OVERHEAD;

As per coding guidelines: "Extract magic numbers into documented constants" for src/**/*.rs files.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/engine/builder.rs` around lines 288 - 289, The calculation for
estimated_block_size_with_tx uses a magic number 1024 for block overhead;
extract this into a documented constant (e.g., const
ESTIMATED_BLOCK_OVERHEAD_BYTES: usize = 1024) near the top of the module and
replace the literal in the expression that computes estimated_block_size_with_tx
(the line that sums block_transactions_rlp_length + tx_rlp_len +
withdrawals_rlp_length + 1024). Add a brief doc comment explaining that this
constant is an estimated header/structure overhead so future readers can adjust
it easily.
src/engine/rpc.rs (1)

620-624: Avoid duplicate capability advertisement.

At Line 620, this starts from upstream capabilities and then unconditionally appends Berachain extras. If upstream includes any of these in the future, the response will contain duplicates. Guard the append to preserve stable set-like output.

Proposed change
-        let mut caps = self.inner.capabilities().list();
-        for &cap in BERACHAIN_ADDITIONAL_CAPABILITIES {
-            caps.push(cap.to_string());
-        }
-        Ok(caps)
+        let mut caps = self.inner.capabilities().list();
+        for &cap in BERACHAIN_ADDITIONAL_CAPABILITIES {
+            if !caps.iter().any(|existing| existing == cap) {
+                caps.push(cap.to_string());
+            }
+        }
+        Ok(caps)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/engine/rpc.rs` around lines 620 - 624, The current capabilities
aggregation (starting from self.inner.capabilities().list() into caps and then
unconditionally iterating BERACHAIN_ADDITIONAL_CAPABILITIES) can produce
duplicates; change the logic in the method that builds caps (use the caps
variable returned by self.inner.capabilities().list()) to deduplicate before
appending—e.g., check each BERACHAIN_ADDITIONAL_CAPABILITIES entry against
existing caps and only push if not already present, or convert caps to a set
(HashSet) and then produce a stable Vec; ensure the final Ok(caps) remains a
stable, duplicate-free list.
Cargo.toml (1)

8-20: Add rev to all 35 reth git-based dependencies for immutable pinning.

All reth dependencies (lines 34–66 and 77–78) lack the rev field. Using tag alone is more drift-prone when lockfiles are regenerated. Adding rev hardens reproducibility and supply-chain guarantees.

The resolved commit hash is bef3d7b4d1da937fcccc9bbd6f8bd93e16380dc7. Update each reth entry:

-reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.1" }
+reth = { git = "https://github.com/paradigmxyz/reth", tag = "v1.11.1", rev = "bef3d7b4d1da937fcccc9bbd6f8bd93e16380dc7" }

Apply this pattern to all 35 reth dependencies: reth, reth-basic-payload-builder, reth-chainspec, reth-cli, reth-cli-commands, reth-cli-util, reth-codecs, reth-consensus-common, reth-db, reth-db-api, reth-engine-local, reth-engine-primitives, reth-errors, reth-ethereum-cli, reth-ethereum-engine-primitives, reth-ethereum-payload-builder, reth-ethereum-primitives, reth-evm, reth-evm-ethereum, reth-network-peers, reth-node-api, reth-node-builder, reth-node-core, reth-node-ethereum, reth-payload-primitives, reth-payload-validator, reth-primitives-traits, reth-rpc, reth-rpc-convert, reth-rpc-engine-api, reth-rpc-eth-api, reth-rpc-eth-types, reth-transaction-pool, reth-e2e-test-utils, and reth-rpc-builder.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Cargo.toml` around lines 8 - 20, Several reth git-based dependencies in
Cargo.toml are missing an immutable rev pin; update each reth dependency entry
(reth, reth-basic-payload-builder, reth-chainspec, reth-cli, reth-cli-commands,
reth-cli-util, reth-codecs, reth-consensus-common, reth-db, reth-db-api,
reth-engine-local, reth-engine-primitives, reth-errors, reth-ethereum-cli,
reth-ethereum-engine-primitives, reth-ethereum-payload-builder,
reth-ethereum-primitives, reth-evm, reth-evm-ethereum, reth-network-peers,
reth-node-api, reth-node-builder, reth-node-core, reth-node-ethereum,
reth-payload-primitives, reth-payload-validator, reth-primitives-traits,
reth-rpc, reth-rpc-convert, reth-rpc-engine-api, reth-rpc-eth-api,
reth-rpc-eth-types, reth-transaction-pool, reth-e2e-test-utils,
reth-rpc-builder) to include the rev =
"bef3d7b4d1da937fcccc9bbd6f8bd93e16380dc7" field alongside their existing git =
and tag = entries so each dependency is pinned to that commit hash for
reproducible builds.
tests/e2e/mod.rs (1)

25-31: Prefer propagating setup errors instead of panicking in a Result-returning helper.

Line 29 and Line 30 use .expect(...), which bypasses the eyre::Result contract and can make e2e failures noisier than needed.

♻️ Suggested change
+use eyre::WrapErr;
+
 pub async fn setup_test_boilerplate() -> eyre::Result<(Runtime, Arc<BerachainChainSpec>)> {
     let runtime = Runtime::with_existing_handle(tokio::runtime::Handle::current())?;
 
     let genesis_path = concat!(env!("CARGO_MANIFEST_DIR"), "/tests/fixtures/eth-genesis.json");
-    let genesis_json = std::fs::read_to_string(genesis_path).expect("Failed to read genesis file");
-    let genesis = parse_genesis(&genesis_json).expect("Failed to parse genesis");
+    let genesis_json =
+        std::fs::read_to_string(genesis_path).wrap_err("Failed to read genesis file")?;
+    let genesis = parse_genesis(&genesis_json).wrap_err("Failed to parse genesis")?;
     let chain_spec = Arc::new(BerachainChainSpec::from(genesis));
 
     Ok((runtime, chain_spec))
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@tests/e2e/mod.rs` around lines 25 - 31, In setup_test_boilerplate, avoid
panicking with .expect on reading and parsing the genesis; instead propagate
errors through the eyre::Result by replacing
std::fs::read_to_string(genesis_path).expect(...) and
parse_genesis(&genesis_json).expect(...) with fallible calls using ? (optionally
adding context via .wrap_err or .with_context) so read_to_string(...) and
parse_genesis(...) return Err(e) into the function's eyre::Result; keep the
creation of Runtime and construction of BerachainChainSpec the same and
reference the functions read_to_string and parse_genesis to locate the changes.
src/node/evm/config.rs (1)

183-183: Extract fallback 0 into a named constant.

Line 183 introduces a magic number; giving it a domain name improves readability/maintainability for blob-gas transition logic.

♻️ Suggested change
 const BERACHAIN_BLOCK_TIME_SECONDS: u64 = 2;
+const DEFAULT_EXCESS_BLOB_GAS_ON_FORK_TRANSITION: u64 = 0;
@@
         let blob_excess_gas_and_price = parent
             .maybe_next_block_excess_blob_gas(blob_params)
-            .or_else(|| blob_params.map(|_| 0))
+            .or_else(|| blob_params.map(|_| DEFAULT_EXCESS_BLOB_GAS_ON_FORK_TRANSITION))
             .map(|excess_blob_gas| {

As per coding guidelines, "Extract magic numbers into documented constants".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/node/evm/config.rs` at line 183, Replace the magic literal 0 used in the
blob-gas transition fallback (the expression .or_else(|| blob_params.map(|_|
0))) with a named constant; add a documented const like
BLOB_GAS_TRANSITION_FALLBACK (or DEFAULT_BLOB_GAS_GAS) near the top of the
module (module-level scope used by config.rs), and then use that constant inside
the closure (.or_else(|| blob_params.map(|_| BLOB_GAS_TRANSITION_FALLBACK))).
Ensure the constant has an appropriate integer type matching the surrounding API
and add a brief doc comment explaining its purpose.
src/rpc/api.rs (1)

461-463: Remove inline policy comments from Rust source.

These new inline comments violate the repository rule for src/**/*.rs; please move this rationale to docs/ADR or PR description instead.

Suggested change
-        // Upstream reth v1.11.1 changed eth_sendRawTransaction to pass External origin,
-        // but Berachain treats all RPC-submitted transactions as Local to bypass pool
-        // capacity limits and ensure consistent block gas utilization.

As per coding guidelines "src/**/*.rs: No comments in code unless explicitly requested".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/rpc/api.rs` around lines 461 - 463, Remove the inline policy comment
block in src/rpc/api.rs that explains why eth_sendRawTransaction is treated as
Local (the lines mentioning "Upstream reth v1.11.1..." and the Berachain
rationale), and instead place that rationale in project documentation (e.g.,
docs/ADR or the PR description); ensure the code retains only necessary short
technical comments if any, and update any reference to eth_sendRawTransaction or
the surrounding RPC handling functions so no policy justification remains in the
Rust source.
src/node/evm/executor.rs (1)

254-255: Remove inline explanatory comment in Rust source.

This newly added comment should be moved out of code to comply with repository style.

Suggested change
-        // Skip commit for POL transactions as it's already been applied in
-        // apply_pre_execution_changes

As per coding guidelines "src/**/*.rs: No comments in code unless explicitly requested".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/node/evm/executor.rs` around lines 254 - 255, Remove the inline
explanatory comment "// Skip commit for POL transactions as it's already been
applied in apply_pre_execution_changes" from the Rust source and instead
document that behavior outside the code (e.g., PR description or design doc);
locate the comment near the POL transaction commit logic and the call/usage of
apply_pre_execution_changes and delete the comment line so the code file
contains no inline explanatory comments per the style guide.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@Cargo.toml`:
- Around line 8-20: Several reth git-based dependencies in Cargo.toml are
missing an immutable rev pin; update each reth dependency entry (reth,
reth-basic-payload-builder, reth-chainspec, reth-cli, reth-cli-commands,
reth-cli-util, reth-codecs, reth-consensus-common, reth-db, reth-db-api,
reth-engine-local, reth-engine-primitives, reth-errors, reth-ethereum-cli,
reth-ethereum-engine-primitives, reth-ethereum-payload-builder,
reth-ethereum-primitives, reth-evm, reth-evm-ethereum, reth-network-peers,
reth-node-api, reth-node-builder, reth-node-core, reth-node-ethereum,
reth-payload-primitives, reth-payload-validator, reth-primitives-traits,
reth-rpc, reth-rpc-convert, reth-rpc-engine-api, reth-rpc-eth-api,
reth-rpc-eth-types, reth-transaction-pool, reth-e2e-test-utils,
reth-rpc-builder) to include the rev =
"bef3d7b4d1da937fcccc9bbd6f8bd93e16380dc7" field alongside their existing git =
and tag = entries so each dependency is pinned to that commit hash for
reproducible builds.

In `@src/engine/builder.rs`:
- Around line 288-289: The calculation for estimated_block_size_with_tx uses a
magic number 1024 for block overhead; extract this into a documented constant
(e.g., const ESTIMATED_BLOCK_OVERHEAD_BYTES: usize = 1024) near the top of the
module and replace the literal in the expression that computes
estimated_block_size_with_tx (the line that sums block_transactions_rlp_length +
tx_rlp_len + withdrawals_rlp_length + 1024). Add a brief doc comment explaining
that this constant is an estimated header/structure overhead so future readers
can adjust it easily.

In `@src/engine/rpc.rs`:
- Around line 620-624: The current capabilities aggregation (starting from
self.inner.capabilities().list() into caps and then unconditionally iterating
BERACHAIN_ADDITIONAL_CAPABILITIES) can produce duplicates; change the logic in
the method that builds caps (use the caps variable returned by
self.inner.capabilities().list()) to deduplicate before appending—e.g., check
each BERACHAIN_ADDITIONAL_CAPABILITIES entry against existing caps and only push
if not already present, or convert caps to a set (HashSet) and then produce a
stable Vec; ensure the final Ok(caps) remains a stable, duplicate-free list.

In `@src/node/evm/config.rs`:
- Line 183: Replace the magic literal 0 used in the blob-gas transition fallback
(the expression .or_else(|| blob_params.map(|_| 0))) with a named constant; add
a documented const like BLOB_GAS_TRANSITION_FALLBACK (or DEFAULT_BLOB_GAS_GAS)
near the top of the module (module-level scope used by config.rs), and then use
that constant inside the closure (.or_else(|| blob_params.map(|_|
BLOB_GAS_TRANSITION_FALLBACK))). Ensure the constant has an appropriate integer
type matching the surrounding API and add a brief doc comment explaining its
purpose.

In `@src/node/evm/executor.rs`:
- Around line 254-255: Remove the inline explanatory comment "// Skip commit for
POL transactions as it's already been applied in apply_pre_execution_changes"
from the Rust source and instead document that behavior outside the code (e.g.,
PR description or design doc); locate the comment near the POL transaction
commit logic and the call/usage of apply_pre_execution_changes and delete the
comment line so the code file contains no inline explanatory comments per the
style guide.

In `@src/rpc/api.rs`:
- Around line 461-463: Remove the inline policy comment block in src/rpc/api.rs
that explains why eth_sendRawTransaction is treated as Local (the lines
mentioning "Upstream reth v1.11.1..." and the Berachain rationale), and instead
place that rationale in project documentation (e.g., docs/ADR or the PR
description); ensure the code retains only necessary short technical comments if
any, and update any reference to eth_sendRawTransaction or the surrounding RPC
handling functions so no policy justification remains in the Rust source.

In `@tests/e2e/mod.rs`:
- Around line 25-31: In setup_test_boilerplate, avoid panicking with .expect on
reading and parsing the genesis; instead propagate errors through the
eyre::Result by replacing std::fs::read_to_string(genesis_path).expect(...) and
parse_genesis(&genesis_json).expect(...) with fallible calls using ? (optionally
adding context via .wrap_err or .with_context) so read_to_string(...) and
parse_genesis(...) return Err(e) into the function's eyre::Result; keep the
creation of Runtime and construction of BerachainChainSpec the same and
reference the functions read_to_string and parse_genesis to locate the changes.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 113d6a7 and ff7d3e5.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (19)
  • .github/assets/hive/build_simulators.sh
  • .github/assets/hive/expected_failures.yaml
  • .github/assets/hive/ignored_tests.yaml
  • Cargo.toml
  • Cross.toml
  • deny.toml
  • src/engine/builder.rs
  • src/engine/mod.rs
  • src/engine/rpc.rs
  • src/node/evm/config.rs
  • src/node/evm/executor.rs
  • src/node/evm/receipt.rs
  • src/pool/mod.rs
  • src/rpc/api.rs
  • tests/e2e/coinbase_system_state_change_test.rs
  • tests/e2e/gas_limit_regression_test.rs
  • tests/e2e/mod.rs
  • tests/e2e/pol_revert_test.rs
  • tests/e2e/transaction_tests.rs
💤 Files with no reviewable changes (1)
  • deny.toml

@fridrik01
fridrik01 merged commit a97f1a9 into main Mar 10, 2026
27 checks passed
@fridrik01
fridrik01 deleted the bump-reth-1.11.1 branch March 10, 2026 15:11
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