Skip to content
Draft
3 changes: 0 additions & 3 deletions beacon_chain/consensus_object_pools/envelope_quarantine.nim
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ type
func init*(T: typedesc[EnvelopeQuarantine]): T =
T()

template root(v: SignedExecutionPayloadEnvelope): Eth2Digest =
v.message.beacon_block_root

func addMissing*(
self: var EnvelopeQuarantine,
root: Eth2Digest) =
Expand Down
33 changes: 27 additions & 6 deletions beacon_chain/el/el_manager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -827,27 +827,48 @@ proc sendGetBlobsV2*(
proc sendNewPayload*(
m: ELManager,
blck: SomeForkyBeaconBlock,
envelope: NoEnvelope | gloas.ExecutionPayloadEnvelope,
deadline: DeadlineFuture,
retry: bool,
): Future[Opt[PayloadExecutionStatus]] {.async: (raises: [CancelledError]).} =
const consensusFork = typeof(blck).kind

template executionPayload(): auto =
when consensusFork >= ConsensusFork.Gloas:
envelope.payload
else:
blck.body.execution_payload

if m.elConnections.len == 0:
info "No execution client configured; cannot process block payloads",
executionPayload = shortLog(blck.body.execution_payload)
executionPayload = shortLog(executionPayload)
return Opt.none(PayloadExecutionStatus)

const consensusFork = typeof(blck).kind

let
startTime = Moment.now()
payload = blck.body.execution_payload.asEngineExecutionPayload
payload = executionPayload.asEngineExecutionPayload()

when consensusFork >= ConsensusFork.Deneb:
let
versioned_hashes = blck.body.blob_kzg_commitments.asEngineVersionedHashes()
versioned_hashes =
block:
let kzgCommitments =
when consensusFork >= ConsensusFork.Gloas:
envelope.blob_kzg_commitments
elif consensusFork >= ConsensusFork.Deneb:
blck.body.blob_kzg_commitments
kzgCommitments.asEngineVersionedHashes()
parent_root = blck.parent_root.to(Hash32)

when consensusFork >= ConsensusFork.Electra:
let execution_requests = blck.body.execution_requests.asEngineExecutionRequests()
let execution_requests =
block:
let executionRequests =
when consensusFork >= ConsensusFork.Gloas:
envelope.execution_requests
else:
blck.body.execution_requests
executionRequests.asEngineExecutionRequests()

var
responseProcessor = ELConsensusViolationDetector.init()
Expand Down
Loading
Loading