fix(rpc): set prevrandao to zero for eth_simulateV1 simulated blocks (#21399)

Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
Matthias Seitz
2026-01-26 13:39:37 +01:00
committed by GitHub
parent adbe6d9da0
commit 963bfeeeed

View File

@@ -116,6 +116,11 @@ pub trait EthCall: EstimateCall + Call + LoadPendingBlock + LoadBlock + FullEthA
let SimBlock { block_overrides, state_overrides, calls } = block;
// Set prevrandao to zero for simulated blocks by default,
// matching spec behavior where MixDigest is zero-initialized.
// If user provides an override, it will be applied by apply_block_overrides.
evm_env.block_env.inner_mut().prevrandao = Some(B256::ZERO);
if let Some(block_overrides) = block_overrides {
// ensure we don't allow uncapped gas limit per block
if let Some(gas_limit_override) = block_overrides.gas_limit &&