Skip to content

Commit 44879c3

Browse files
authored
feat(payload): expose built payload block access list (#23860)
1 parent b279454 commit 44879c3

3 files changed

Lines changed: 20 additions & 2 deletions

File tree

crates/ethereum/engine-primitives/src/payload.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,10 @@ impl<N: NodePrimitives> BuiltPayload for EthBuiltPayload<N> {
242242
self.fees
243243
}
244244

245+
fn block_access_list(&self) -> Option<&Bytes> {
246+
self.block_access_list.as_ref()
247+
}
248+
245249
fn requests(&self) -> Option<Requests> {
246250
self.requests.clone()
247251
}

crates/payload/basic/src/stack.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::{
33
PayloadConfig,
44
};
55

6-
use alloy_primitives::{B256, U256};
6+
use alloy_primitives::{Bytes, B256, U256};
77
use reth_payload_builder::PayloadId;
88
use reth_payload_primitives::{BuiltPayload, PayloadAttributes};
99
use reth_primitives_traits::{NodePrimitives, SealedBlock};
@@ -135,6 +135,13 @@ where
135135
}
136136
}
137137

138+
fn block_access_list(&self) -> Option<&Bytes> {
139+
match self {
140+
Self::Left(l) => l.block_access_list(),
141+
Self::Right(r) => r.block_access_list(),
142+
}
143+
}
144+
138145
fn requests(&self) -> Option<Requests> {
139146
match self {
140147
Self::Left(l) => l.requests(),

crates/payload/primitives/src/traits.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
use crate::PayloadBuilderError;
44
use alloc::{boxed::Box, sync::Arc, vec::Vec};
55
use alloy_eips::{eip4895::Withdrawal, eip7685::Requests};
6-
use alloy_primitives::{B256, U256};
6+
use alloy_primitives::{Bytes, B256, U256};
77
use alloy_rlp::Encodable;
88
use alloy_rpc_types_engine::{PayloadAttributes as EthPayloadAttributes, PayloadId};
99
use core::fmt;
@@ -81,6 +81,13 @@ pub trait BuiltPayload: Send + Sync + fmt::Debug {
8181
/// Returns the total fees collected from all transactions in this block.
8282
fn fees(&self) -> U256;
8383

84+
/// Returns the EIP-7928 block access list included in this payload.
85+
///
86+
/// Returns `None` for payloads that do not carry a block access list.
87+
fn block_access_list(&self) -> Option<&Bytes> {
88+
None
89+
}
90+
8491
/// Returns the complete execution result including state updates.
8592
///
8693
/// Returns `None` if execution data is not available or not tracked.

0 commit comments

Comments
 (0)