feat: update revm 19 alloy 09 (#13594)

This commit is contained in:
Matthias Seitz
2024-12-30 19:49:39 +01:00
committed by GitHub
parent a6325c41e0
commit 0b135a2670
54 changed files with 273 additions and 341 deletions

View File

@ -10,6 +10,7 @@
#![cfg(feature = "optimism")]
use alloy_consensus::{BlockHeader, Header, EMPTY_OMMER_ROOT_HASH};
use alloy_eips::eip7840::BlobParams;
use alloy_primitives::{B64, U256};
use reth_chainspec::EthereumHardforks;
use reth_consensus::{
@ -142,7 +143,7 @@ impl HeaderValidator for OpBeaconConsensus {
// ensure that the blob gas fields for this block
if self.chain_spec.is_cancun_active_at_timestamp(header.timestamp) {
validate_against_parent_4844(header.header(), parent.header())?;
validate_against_parent_4844(header.header(), parent.header(), BlobParams::cancun())?;
}
Ok(())

View File

@ -35,9 +35,9 @@ pub fn validate_block_post_execution(
// Check if gas used matches the value set in header.
let cumulative_gas_used =
receipts.last().map(|receipt| receipt.cumulative_gas_used()).unwrap_or(0);
if block.gas_used as u128 != cumulative_gas_used {
if block.gas_used != cumulative_gas_used {
return Err(ConsensusError::BlockGasUsed {
gas: GotExpected { got: cumulative_gas_used as u64, expected: block.gas_used },
gas: GotExpected { got: cumulative_gas_used, expected: block.gas_used },
gas_spent_by_tx: gas_spent_by_transactions(receipts),
})
}