eth estimategas & eth call does not support block overrides#11267
Conversation
|
Claude finished @DarkLord017's task in 5m 51s —— View job PR Review: eth_estimateGas & eth_call Block Overrides
|
|
@claude review pls |
|
Claude finished @DarkLord017's task in 5m 37s —— View job PR Review: eth_estimateGas & eth_call Block Overrides
Implementation CorrectnessThe core idea is sound. One notable ordering: FindingsHigh
Medium
Low
Answers to Your QuestionsIs the implementation correct? Should you add more tests?
Do other endpoints need block override? |
888ec52 to
9af95be
Compare
|
@claude review pls |
|
Claude finished @DarkLord017's task in 6m 4s —— View job PR Review: eth_estimateGas & eth_call Block Overrides
|
| public CallOutput Call(BlockHeader header, Transaction tx, Dictionary<Address, AccountOverride>? stateOverride, UInt256? blobBaseFeeOverride, CancellationToken cancellationToken) | ||
| { | ||
| using Scope<BlockProcessingComponents> scope = processingEnv.BuildAndOverride(header, stateOverride); | ||
| scope.Component.RequestState.BlobBaseFeeOverride = blobBaseFeeOverride; |
There was a problem hiding this comment.
Medium: blobBaseFeeOverride is now set on requestState here (line 155) and passed as a method parameter to TryCallAndRestore (line 159). Both are needed for correctness but for different reasons:
requestState.BlobBaseFeeOverride→ feedsSingleCallBlobBaseFeeCalculatorDecorator→ overrides the total blob gas cost computed insideTransactionProcessor- The method parameter →
CallAndRestore→BlockExecutionContext.BlobBaseFee→ overrides the per-gas price used for theMaxFeePerBlobGasfee-cap validation
The same value flows through two channels. A simpler design: since CallAndRestore already receives components (which holds RequestState), you could drop the parameter from TryCallAndRestore/CallAndRestore entirely and read components.RequestState.BlobBaseFeeOverride there directly. That would give a single source of truth.
There was a problem hiding this comment.
@claude is this design simplification resolved?
EVM Opcode Benchmark DiffAggregated runs: base=1, pr=1 No significant regressions or improvements detected. |
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
|
@claude review |
|
Claude finished @DarkLord017's task in 7m 56s —— View job PR Review: eth_estimateGas & eth_call Block Overrides
SummaryThe design is now cleaner than earlier iterations: FindingsHigh — Duplicate
|
Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
…eTests.EstimateGas.cs Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
|
@claude re-review |
|
Claude finished @DarkLord017's task in 3m 31s —— View job PR Re-Review: eth_estimateGas & eth_call Block Overrides
SummaryAll previous High and Medium findings are resolved. The implementation is correct and complete. Resolved Findings ✅
eth_createAccessListConfirmed out of scope — Remaining Open ItemLow — No comment on ordering of The ordering (zero // Apply NoBaseFee first; blockOverride.BaseFeePerGas intentionally takes precedence when set.
if (NoBaseFee)
clonedHeader.BaseFeePerGas = 0;Not blocking. What Works Well
Verdict: mergeable. All High and Medium findings are resolved. One Low remains (missing comment on NoBaseFee ordering) — up to the author whether to add it before merge. |
|
Claude finished @DarkLord017's task in 5m 0s —— View job PR Review: eth_estimateGas & eth_call Block Overrides
SummaryThis PR correctly adds Resolved Previous Findings ✅
Remaining FindingsLow — Unused
|
Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com>
…Decorator.cs Co-authored-by: Lukasz Rozmej <lukasz.rozmej@gmail.com>
…support-block-overrides
| => Execute(transactionCall, blockParameter, stateOverride); | ||
| public ResultWrapper<TResult> ExecuteTx(TransactionForRpc transactionCall, BlockParameter? blockParameter, Dictionary<Address, AccountOverride>? stateOverride = null, BlockOverride? blockOverride = null) | ||
| { | ||
| if (blockOverride?.GasLimit > (ulong)long.MaxValue) |
There was a problem hiding this comment.
Should this be linked to config rather than be 2Bn?
There was a problem hiding this comment.
in JsonRpcConfig we do have max gas cap for RPC calls
There was a problem hiding this comment.
Applied pls see @LukaszRozmej @benaadams
There was a problem hiding this comment.
Pull request overview
This PR updates Nethermind’s JSON-RPC eth_call and eth_estimateGas implementations to accept and apply the optional 4th blockOverrides parameter (including coinbase/feeRecipient), and unifies blob base fee override handling across eth_* and eth_simulateV1.
Changes:
- Extend
eth_call/eth_estimateGassignatures to acceptBlockOverrideand apply overrides to the simulated header. - Plumb
blobBaseFeeoverrides throughIBlockchainBridgeand apply via a sharedBlobBaseFeeOverrideCalculatorDecorator. - Add/extend tests covering block override fields (number/time/gasLimit/feeRecipient), baseFee override behavior, blob base fee opcode behavior, and a regression test for simulate block time override.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Nethermind/Nethermind.JsonRpc/Modules/Eth/IEthRpcModule.cs | Adds optional BlockOverride param to eth_call / eth_estimateGas RPC contract. |
| src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthRpcModule.cs | Wires new optional BlockOverride param into executors. |
| src/Nethermind/Nethermind.JsonRpc/Modules/Eth/EthRpcModule.TransactionExecutor.cs | Applies block overrides to cloned headers; passes blob base fee override into bridge calls; bounds estimateGas by overridden gasLimit. |
| src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/Simulate/EthSimulateTestsBlocksAndTransactions.cs | Adds regression test verifying blockOverrides.time affects TIMESTAMP in simulate. |
| src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.cs | Adds reusable EVM bytecode for COINBASE opcode tests. |
| src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.EthCall.cs | Adds eth_call tests for block override fields and blob base fee override behavior. |
| src/Nethermind/Nethermind.JsonRpc.Test/Modules/Eth/EthRpcModuleTests.EstimateGas.cs | Adds estimateGas tests for baseFeePerGas override and gasLimit override bounding behavior. |
| src/Nethermind/Nethermind.Facade/SingleCallRequestState.cs | Introduces per-request state for single-call blob base fee override. |
| src/Nethermind/Nethermind.Facade/Simulate/SimulateRequestState.cs | Implements IBlobBaseFeeOverrideProvider for simulate request state. |
| src/Nethermind/Nethermind.Facade/Simulate/SimulateReadOnlyBlocksProcessingEnvFactory.cs | Switches simulate env to shared blob base fee override decorator + provider binding. |
| src/Nethermind/Nethermind.Facade/Simulate/SimulateGasCalculatorDecorator.cs | Removes simulate-specific blob base fee decorator in favor of shared implementation. |
| src/Nethermind/Nethermind.Facade/IBlockchainBridge.cs | Extends Call/EstimateGas/CreateAccessList signatures to accept optional blob base fee override. |
| src/Nethermind/Nethermind.Facade/IBlobBaseFeeOverrideProvider.cs | Adds shared interface used by both simulate and single-call paths. |
| src/Nethermind/Nethermind.Facade/BlockchainBridge.cs | Stores blob base fee override in request state; sets execution context blob base fee accordingly; updates DI wiring. |
| src/Nethermind/Nethermind.Facade/BlobBaseFeeOverrideCalculatorDecorator.cs | Adds shared decorator applying blob base fee overrides when provided. |
| src/Nethermind/Nethermind.Facade.Test/BlockchainBridgeTests.cs | Updates tests for CreateAccessList signature change. |
| src/Nethermind/Nethermind.Evm/BlockOverride.cs | Ensures feeRecipient override also sets Author; documents blob base fee override handling (needs minor comment update). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…eTests.EthCall.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…support-block-overrides
|
@claude review if the merge conflict was applied correctlly |
|
Claude finished @DarkLord017's task in 2m 54s —— View job PR Review: Merge Conflict Resolution Check
Merge Resolution: Correct ✅No leftover conflict markers (
One Low findingGasCap null guard uses
if (blockOverride?.GasLimit > (ulong)_rpcConfig.GasCap!.Value)If All previously flagged High/Medium findings remain resolvedAll findings from prior review rounds (gas cap regression, Verdict: mergeable. The merge conflict was applied correctly. |

Fixes Closes Resolves #11183 , #11171 , #8480
Changes
Types of changes
What types of changes does your code introduce?
Testing
Requires testing
If yes, did you write tests?
Notes on testing
Documentation
Requires documentation update
If yes, link the PR to the docs update or the issue with the details labeled
docs. Remove if not applicable.Requires explanation in Release Notes
Remarks