Skip to content

Commit

Permalink
feat: use empty requests hash when isthmus enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
meyer9 committed Jan 24, 2025
1 parent 4b00849 commit b7a6c70
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions crates/executor/src/executor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use crate::{
use alloc::vec::Vec;
use alloy_consensus::{Header, Sealable, Transaction, EMPTY_OMMER_ROOT_HASH, EMPTY_ROOT_HASH};
use alloy_eips::eip2718::{Decodable2718, Encodable2718};
use alloy_primitives::{keccak256, logs_bloom, Bytes, Log, B256, U256};
use alloy_primitives::{b256, keccak256, logs_bloom, Bytes, Log, B256, U256};
use kona_mpt::{ordered_trie_with_encoder, TrieHinter};
use maili_genesis::RollupConfig;
use op_alloy_consensus::{OpReceiptEnvelope, OpTxEnvelope};
Expand All @@ -29,6 +29,11 @@ mod env;
mod util;
use util::encode_holocene_eip_1559_params;


/// Empty SHA-256 hash.
const SHA256_EMPTY: B256 =
b256!("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470");

/// The block executor for the L2 client program. Operates off of a [TrieDB] backed [State],
/// allowing for stateless block execution of OP Stack blocks.
#[derive(Debug)]
Expand Down Expand Up @@ -328,6 +333,11 @@ where
// Compute the parent hash.
let parent_hash = state.database.parent_block_header().seal();

let requests_hash = self
.config
.is_isthmus_active(payload.payload_attributes.timestamp)
.then_some(SHA256_EMPTY);

// Construct the new header.
let header = Header {
parent_hash,
Expand All @@ -337,7 +347,7 @@ where
transactions_root,
receipts_root,
withdrawals_root,
requests_hash: None,
requests_hash,
logs_bloom,
difficulty: U256::ZERO,
number: block_number,
Expand Down

0 comments on commit b7a6c70

Please sign in to comment.