feat(op): Cancun support in payload builder and processor (#6731)

This commit is contained in:
clabby
2024-02-23 12:11:25 -07:00
committed by GitHub
parent be1ebeea62
commit 21bc1a861b
6 changed files with 107 additions and 44 deletions

View File

@@ -265,13 +265,25 @@ where
)?;
// Now resolve the payload
Ok(self
let mut resolved_payload = self
.inner
.payload_store
.resolve(payload_id)
.await
.ok_or(EngineApiError::UnknownPayload)?
.map(|payload| payload.into_v3_payload())?)
.map(|payload| payload.into_v3_payload())?;
// After `Cancun` is enabled on optimism, an extra field `parent_beacon_block_root` is
// included in the enveloped V3 payload. On ethereum, this field is not included.
if self.inner.chain_spec.is_optimism() &&
self.inner
.chain_spec
.is_fork_active_at_timestamp(Hardfork::Cancun, attributes.timestamp())
{
resolved_payload.parent_beacon_block_root = attributes.parent_beacon_block_root();
}
Ok(resolved_payload)
}
/// Returns the execution payload bodies by the range starting at `start`, containing `count`