Skip to content

Commit 10e78b7

Browse files
authored
fix(levm): read chain_id from chain config, not from transaction (#2531)
**Motivation** At block 576991 the sync with holesky would fail due to an incorrect state calculation. **Description** As per [EIP-1344](https://eips.ethereum.org/EIPS/eip-1344) the chain ID should be read from the chain configuration and not the transaction. This is because transactions may not have replay protection configured.
1 parent 755f7e3 commit 10e78b7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/vm/backends/levm/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ fn env_from_generic(
712712
coinbase: header.coinbase,
713713
timestamp: header.timestamp.into(),
714714
prev_randao: Some(header.prev_randao),
715-
chain_id: tx.chain_id.unwrap_or(chain_config.chain_id).into(),
715+
chain_id: chain_config.chain_id.into(),
716716
base_fee_per_gas: header.base_fee_per_gas.unwrap_or_default().into(),
717717
gas_price,
718718
block_excess_blob_gas: header.excess_blob_gas.map(U256::from),

0 commit comments

Comments
 (0)