Skip to content

Commit

Permalink
feat: Freeze payload if final (paradigmxyz#12078)
Browse files Browse the repository at this point in the history
Co-authored-by: Matthias Seitz <[email protected]>
  • Loading branch information
edisontim and mattsse authored Oct 25, 2024
1 parent 5568cca commit e676d71
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion crates/optimism/payload/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,8 @@ where
trie: Arc::new(trie_output),
};

let no_tx_pool = attributes.no_tx_pool;

let mut payload = OptimismBuiltPayload::new(
attributes.payload_attributes.id,
sealed_block,
Expand All @@ -534,5 +536,12 @@ where
// extend the payload with the blob sidecars from the executed txs
payload.extend_sidecars(blob_sidecars);

Ok(BuildOutcome::Better { payload, cached_reads })
if no_tx_pool {
// if `no_tx_pool` is set only transactions from the payload attributes will be included in
// the payload. In other words, the payload is deterministic and we can freeze it once we've
// successfully built it.
Ok(BuildOutcome::Freeze(payload))
} else {
Ok(BuildOutcome::Better { payload, cached_reads })
}
}

0 comments on commit e676d71

Please sign in to comment.