-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
chore: simplify OpBuiltPayload
#14152
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
pub fn into_sealed_block(self) -> SealedBlock<N::Block> { | ||
let block = Arc::unwrap_or_clone(self.block.recovered_block); | ||
block.into_sealed_block() | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, that makes sense
/// The blobs, proofs, and commitments in the block. If the block is pre-cancun, this will be | ||
/// empty. | ||
pub(crate) sidecars: Vec<BlobTransactionSidecar>, | ||
/// The rollup's chainspec. | ||
pub(crate) chain_spec: Arc<OpChainSpec>, | ||
/// The payload attributes. | ||
pub(crate) attributes: OpPayloadBuilderAttributes, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these can indeed go
/// Block execution data for the payload, if any. | ||
pub(crate) executed_block: Option<ExecutedBlockWithTrieUpdates<OpPrimitives>>, | ||
pub(crate) block: ExecutedBlockWithTrieUpdates<OpPrimitives>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is a reasonable, if you need a remote builder you can still write your own builder
@@ -306,7 +280,8 @@ impl From<OpBuiltPayload> for OpExecutionPayloadEnvelopeV4 { | |||
// Spec: | |||
// <https://github.com/ethereum/execution-apis/blob/fe8e13c288c592ec154ce25c534e26cb7ce0530d/src/engine/cancun.md#specification-2> | |||
should_override_builder: false, | |||
blobs_bundle: sidecars.into_iter().collect::<Vec<_>>().into(), | |||
// No blobs for OP. | |||
blobs_bundle: BlobsBundleV1 { blobs: vec![], commitments: vec![], proofs: vec![] }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ref: alloy-rs/alloy#1990
There's no need to keep ChainSpec, attributes and blobs in OpBuiltPayload.
This should make it easier to reuse the type with custom blocks