-
Notifications
You must be signed in to change notification settings - Fork 63
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
feat(pectra): Use EIP-7865 encoding for execution_requests #107
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 |
---|---|---|
|
@@ -18,7 +18,7 @@ Note: `SignedBuilderBid` is updated indirectly. | |
class BuilderBid(Container): | ||
header: ExecutionPayloadHeader | ||
blob_kzg_commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK] | ||
execution_requests: ExecutionRequests # [New in Electra] | ||
execution_requests: OpaqueExecutionRequests # [New in Electra] | ||
value: uint256 | ||
pubkey: BLSPubkey | ||
``` | ||
|
@@ -41,7 +41,32 @@ class BlindedBeaconBlockBody(Container): | |
execution_payload_header: ExecutionPayloadHeader | ||
bls_to_execution_changes: List[SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES] | ||
blob_kzg_commitments: List[KZGCommitment, MAX_BLOB_COMMITMENTS_PER_BLOCK] | ||
execution_requests: ExecutionRequests # [New in Electra] | ||
execution_requests: OpaqueExecutionRequests # [New in Electra] | ||
``` | ||
|
||
### New Containers | ||
|
||
### `OpaqueExecutionRequests` | ||
|
||
```python | ||
class OpaqueExecutionRequests(List[Bitvector]): | ||
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. those are not really opaque, just ssz encoded and 1-byte prefixed, anyone can decode the requests and read the data 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. They're "semantically" opaque, EIP-7865 stipulates that each request type is allowed to decide its own encoding, it's just a coincidence that the current three are all SSZ in the same way that all EIP-2718 txs are currently RLP.
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. I guess if the same wording is used on the engine-api side this is fine |
||
pass | ||
``` | ||
|
||
`OpaqueExecutionRequests` is simply a "type alias" for a `List[Bitvector]`, this type follows the encoding of execution | ||
requests as explained in EIP-7865. Specifically for Electra, the list should contain three elements, one for | ||
each of the type-prefixed and byte-encoded `Deposit`, `Withdrawal` and `Consolidation` request lists. | ||
|
||
Note that while each `Bitvector` appears as an arbitrary-length byte sequence, technically each entry is bound | ||
by the encoded length of each request type and the maximum amount of each request type allowed in a block. | ||
|
||
## Building | ||
|
||
Builders provide bids as they have in prior forks, with the addition of execution requests. | ||
|
||
### Execution Requests | ||
|
||
The actual payloads for each request type are generated as side-effects of block-building, see EIP-6110 for | ||
`Deposit`, EIP-7002 for `Withdrawal` and EIP-7251 for `Consolidation` requests. | ||
|
||
[execution-payload-and-blobs-bundle-deneb]: ../deneb/builder.md#executionpayloadandblobsbundle |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,8 +16,12 @@ Electra: | |
maxItems: 4096 | ||
description: "the `KZGCommitment`s for the associated blobs for this `header`" | ||
execution_requests: | ||
$ref: "../../beacon-apis/types/electra/execution_requests.yaml#/Electra/ExecutionRequests" | ||
description: "`ExecutionRequests` to include in block proposal." | ||
type: array | ||
items: | ||
$ref: '../../beacon-apis/types/primitive.yaml#/Bitvector' | ||
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. I am not sure if the Bitvector is a good semantic representation for the opaque field, although technically, it could work. I would consider adding a Keen to have people weight in on this before committing to it. 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. Funny when writing this up I originally used 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. I believe so. It looks like builder-specs is importing beacon-api as a git submodule and referring to the types defined there. 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. Ok cool I just sent ethereum/beacon-APIs#484 I guess if this is accepted I can update the submodule in this PR and point to that. Thanks for the suggestion! 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.
you can't have unbounded ssz types |
||
minItems: 3 | ||
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.
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. Oh right I was still thinking pre- ethereum/execution-apis#599, updated in 7955984 thanks! |
||
maxItems: 3 | ||
description: "EIP-7685 encoded `ExecutionRequests` to include in block proposal." | ||
- $ref: '../bellatrix/bid.yaml#/Bellatrix/BuilderBidCommon' | ||
|
||
SignedBuilderBid: | ||
|
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.
Can use the example value in ethereum/execution-apis#607 .
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.
Perfect, updated in 7955984 as well, thanks again!