Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: use empty requests hash when isthmus enabled #951

Merged
merged 2 commits into from
Jan 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 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,10 @@ 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 +332,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 +346,7 @@ where
transactions_root,
receipts_root,
withdrawals_root,
requests_hash: None,
requests_hash,
logs_bloom,
difficulty: U256::ZERO,
number: block_number,
Expand Down
Loading