-
Notifications
You must be signed in to change notification settings - Fork 291
fix fulu builder api changes #7340
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 all commits
709725d
0b4c793
cd6e4a2
c2b71b3
3dfe6e2
3d609f5
cd8bfc0
7f86996
412f3d0
b70705c
b9c2eb4
063285f
25b65f4
a156f18
0bab4ba
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 |
---|---|---|
|
@@ -232,11 +232,11 @@ func asConsensusType*( | |
# The `mapIt` calls below are necessary only because we use different distinct | ||
# types for KZG commitments and Blobs in the `web3` and the `deneb` spec types. | ||
# Both are defined as `array[N, byte]` under the hood. | ||
blobsBundle: deneb.BlobsBundle( | ||
blobsBundle: fulu.BlobsBundleV2( | ||
commitments: KzgCommitments.init( | ||
payload.blobsBundle.commitments.mapIt( | ||
kzg_abi.KzgCommitment(bytes: it.data))), | ||
proofs: KzgProofs.init( | ||
proofs: KzgProofsV2.init( | ||
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. Also not accurate. |
||
payload.blobsBundle.proofs.mapIt( | ||
kzg_abi.KzgProof(bytes: it.data))), | ||
blobs: Blobs.init( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1042,7 +1042,8 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) = | |
doAssert strictVerification notin node.dag.updateFlags | ||
return RestApiResponse.jsonError(Http400, InvalidBlockObjectError) | ||
|
||
when consensusFork >= ConsensusFork.Deneb: | ||
when consensusFork >= ConsensusFork.Deneb and | ||
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. Two points:
But the first point is more important. There's no reason to change this to work in Fulu, nor should it be changed. |
||
consensusFork < ConsensusFork.Fulu: | ||
await node.router.routeSignedBeaconBlock( | ||
forkyBlck, Opt.some( | ||
forkyBlck.create_blob_sidecars(kzg_proofs, blobs)), | ||
|
@@ -1099,7 +1100,8 @@ proc installBeaconApiHandlers*(router: var RestRouter, node: BeaconNode) = | |
doAssert strictVerification notin node.dag.updateFlags | ||
return RestApiResponse.jsonError(Http400, InvalidBlockObjectError) | ||
|
||
when consensusFork >= ConsensusFork.Deneb: | ||
when consensusFork >= ConsensusFork.Deneb and | ||
consensusFork < ConsensusFork.Fulu: | ||
await node.router.routeSignedBeaconBlock( | ||
forkyBlck, Opt.some( | ||
forkyBlck.create_blob_sidecars(kzg_proofs, blobs)), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -270,6 +270,7 @@ RestJson.useDefaultSerializationFor( | |
fulu_mev.BlindedBeaconBlock, | ||
fulu_mev.BlindedBeaconBlockBody, | ||
fulu_mev.BuilderBid, | ||
fulu_mev.ExecutionPayloadAndBlobsBundle, | ||
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. Because |
||
fulu_mev.SignedBlindedBeaconBlock, | ||
fulu_mev.SignedBuilderBid, | ||
phase0.AggregateAndProof, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -316,7 +316,7 @@ type | |
|
||
FuluSignedBlockContents* = object | ||
signed_block*: fulu.SignedBeaconBlock | ||
kzg_proofs*: deneb.KzgProofs | ||
kzg_proofs*: fulu.KzgProofsV2 | ||
blobs*: deneb.Blobs | ||
|
||
RestPublishedSignedBlockContents* = object | ||
|
@@ -550,6 +550,7 @@ type | |
GetHeaderResponseElectra* = DataVersionEnclosedObject[electra_mev.SignedBuilderBid] | ||
GetHeaderResponseFulu* = DataVersionEnclosedObject[fulu_mev.SignedBuilderBid] | ||
SubmitBlindedBlockResponseElectra* = DataVersionEnclosedObject[electra_mev.ExecutionPayloadAndBlobsBundle] | ||
SubmitBlindedBlockResponseFulu* = DataVersionEnclosedObject[fulu_mev.ExecutionPayloadAndBlobsBundle] | ||
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. Per ethereum/builder-specs#123 the There's no decoding to do, unlike Pectra. So this |
||
|
||
RestNodeValidity* {.pure.} = enum | ||
valid = "VALID", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -508,7 +508,8 @@ template kind*( | |
fulu.TrustedSignedBeaconBlock | | ||
fulu_mev.BlindedBeaconBlock | | ||
fulu_mev.SignedBlindedBeaconBlock | | ||
fulu_mev.SignedBuilderBid]): ConsensusFork = | ||
fulu_mev.SignedBuilderBid | | ||
fulu_mev.ExecutionPayloadAndBlobsBundle]): ConsensusFork = | ||
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. Shouldn't be used either. I removed all this, for good reason, back in #7308 There's still no actual block/blob return from |
||
ConsensusFork.Fulu | ||
|
||
template BeaconState*(kind: static ConsensusFork): typedesc = | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ from stew/byteutils import to0xHex | |
from ".."/datatypes/phase0 import AttesterSlashing | ||
from ".."/datatypes/capella import SignedBLSToExecutionChange | ||
from ".."/datatypes/deneb import BlobsBundle, KzgCommitments | ||
from ".."/datatypes/fulu import BlobsBundleV2 | ||
from ".."/datatypes/electra import | ||
Attestation, AttesterSlashing, ExecutionRequests | ||
from ".."/eth2_merkleization import hash_tree_root | ||
|
@@ -69,11 +70,17 @@ type | |
message*: BlindedBeaconBlock | ||
signature*: ValidatorSig | ||
|
||
# https://github.com/ethereum/builder-specs/blob/ae1d97d080a12bfb7ca248b58fb1fc6b10aed02e/specs/fulu/builder.md#executionpayloadandblobsbundle | ||
ExecutionPayloadAndBlobsBundle* = object | ||
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. See elsewhere, not useful/necessary. |
||
execution_payload*: electra.ExecutionPayload | ||
blobs_bundle*: BlobsBundleV2 # [New in Fulu] | ||
|
||
# Not spec, but suggested by spec | ||
BlindedExecutionPayloadAndBlobsBundle* = object | ||
execution_payload_header*: fulu.ExecutionPayloadHeader | ||
blob_kzg_commitments*: KzgCommitments # [New in Deneb] | ||
|
||
|
||
func shortLog*(v: BlindedBeaconBlock): auto = | ||
( | ||
slot: shortLog(v.slot), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -570,7 +570,7 @@ proc makeBeaconBlockWithRewards*( | |
hash_tree_root(validator_changes.proposer_slashings), | ||
hash_tree_root(validator_changes.electra_attester_slashings), | ||
hash_tree_root( | ||
List[electra.Attestation, Limit MAX_ATTESTATIONS]( | ||
List[electra.Attestation, Limit MAX_ATTESTATIONS_ELECTRA]( | ||
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. This is the actual fix. |
||
attestations)), | ||
hash_tree_root(List[Deposit, Limit MAX_DEPOSITS](deposits)), | ||
hash_tree_root(validator_changes.voluntary_exits), | ||
|
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.
This isn't accurate;
GetPayloadV4
usesBlobsBundleV1
: https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/prague.md#engine_getpayloadv4