-
Notifications
You must be signed in to change notification settings - Fork 312
wrap kzgs/proofs/blobs fields as BlobsBundle
#5562
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -88,9 +88,6 @@ declarePublicGauge(attached_validator_balance_total, | |
| logScope: topics = "beacval" | ||
|
|
||
| type | ||
| BlobsBundle = tuple[blobs: deneb.Blobs, | ||
| kzgs: KzgCommitments, | ||
| proofs: seq[kzg_abi.KZGProof]] | ||
| ForkedBlockResult = | ||
| Result[tuple[blck: ForkedBeaconBlock, | ||
| blockValue: Wei, | ||
|
|
@@ -541,10 +538,7 @@ proc makeBeaconBlockForHeadAndSlot*( | |
|
|
||
| var blobsBundleOpt = Opt.none(BlobsBundle) | ||
| when payload is deneb.ExecutionPayloadForSigning: | ||
| let bb: BlobsBundle = (blobs: payload.blobs, | ||
| kzgs: payload.kzgs, | ||
| proofs: payload.proofs) | ||
| blobsBundleOpt = Opt.some(bb) | ||
| blobsBundleOpt = Opt.some(payload.blobsBundle) | ||
| return if blck.isOk: | ||
| ok((blck.get, payload.blockValue, blobsBundleOpt)) | ||
| else: | ||
|
|
@@ -1176,10 +1170,11 @@ proc proposeBlockAux( | |
| .registerBlock(validator_index, validator.pubkey, slot, signingRoot) | ||
|
|
||
| let blobSidecarsOpt = | ||
| when forkyBlck is deneb.BeaconBlock: | ||
| when consensusFork >= ConsensusFork.Deneb: | ||
| var sidecars: seq[BlobSidecar] | ||
| let bundle = collectedBids.engineBlockFut.read.get().blobsBundleOpt.get | ||
| let (blobs, kzgs, proofs) = (bundle.blobs, bundle.kzgs, bundle.proofs) | ||
| let (blobs, commitments, proofs) = ( | ||
| bundle.blobs, bundle.commitments, bundle.proofs) | ||
| for i in 0..<blobs.len: | ||
| var sidecar = BlobSidecar( | ||
| block_root: blockRoot, | ||
|
|
@@ -1188,18 +1183,13 @@ proc proposeBlockAux( | |
| block_parent_root: forkyBlck.parent_root, | ||
| proposer_index: forkyBlck.proposer_index, | ||
| blob: blobs[i], | ||
| kzg_commitment: kzgs[i], | ||
| kzg_commitment: commitments[i], | ||
| kzg_proof: proofs[i] | ||
| ) | ||
| sidecars.add(sidecar) | ||
| Opt.some(sidecars) | ||
| elif forkyBlck is phase0.BeaconBlock or | ||
| forkyBlck is altair.BeaconBlock or | ||
| forkyBlck is bellatrix.BeaconBlock or | ||
| forkyBlck is capella.BeaconBlock: | ||
| Opt.none(seq[BlobSidecar]) | ||
| else: | ||
| static: doAssert "Unknown BeaconBlock type" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switching Better to find out about missing functionality at compile-time.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It will take the Deneb version, not the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The other one will compile-time break on Electra because This instance here will be fine with Electra as well (using the blob logic from deneb) |
||
| Opt.none(seq[BlobSidecar]) | ||
|
|
||
| if notSlashable.isErr: | ||
| warn "Slashing protection activated for block proposal", | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.