diff --git a/examples/electra/signed_blinded_beacon_block.json b/examples/electra/signed_blinded_beacon_block.json index 21c7025..06673c9 100644 --- a/examples/electra/signed_blinded_beacon_block.json +++ b/examples/electra/signed_blinded_beacon_block.json @@ -188,33 +188,11 @@ "blob_kzg_commitments": [ "0xa94170080872584e54a1cf092d845703b13907f2e6b3b1c0ad573b910530499e3bcd48c6378846b80d2bfa58c81cf3d5" ], - "execution_requests": { - "deposits": [ - { - "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "amount": "1", - "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", - "index": "1", - } - ], - "withdrawals": [ - { - "source_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", - "validator_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - "amount": "1", - } - ], - "consolidations": [ - { - "source_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", - "source_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - "target_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - } - ] - } - } - }, + "execution_requests": [ + "0x0096a96086cff07df17668f35f7418ef8798079167e3f4f9b72ecde17b28226137cf454ab1dd20ef5d924786ab3483c2f9003f5102dabe0a27b1746098d1dc17a5d3fbd478759fea9287e4e419b3c3cef20100000000000000b1acdb2c4d3df3f1b8d3bfd33421660df358d84d78d16c4603551935f4b67643373e7eb63dcb16ec359be0ec41fee33b03a16e80745f2374ff1d3c352508ac5d857c6476d3c3bcf7e6ca37427c9209f17be3af5264c0e2132b3dd1156c28b4e9f000000000000000a5c85a60ba2905c215f6a12872e62b1ee037051364244043a5f639aa81b04a204c55e7cc851f29c7c183be253ea1510b001db70c485b6264692f26b8aeaab5b0c384180df8e2184a21a808a3ec8e86ca01000000000000009561731785b48cf1886412234531e4940064584463e96ac63a1a154320227e333fb51addc4a89b7e0d3f862d7c1fd4ea03bd8eb3d8806f1e7daf591cbbbb92b0beb74d13c01617f22c5026b4f9f9f294a8a7c32db895de3b01bee0132c9209e1f100000000000000", + "0x01a94f5374fce5edbc8e2a8697c15331677e6ebf0b85103a5617937691dfeeb89b86a80d5dc9e3c9d3a1a0e7ce311e26e0bb732eabaa47ffa288f0d54de28209a62a7d29d0000000000000000000000000000000000000000000000000000010f698daeed734da114470da559bd4b4c7259e1f7952555241dcbc90cf194a2ef676fc6005f3672fada2a3645edb297a75530100000000000000", + "0x02a94f5374fce5edbc8e2a8697c15331677e6ebf0b85103a5617937691dfeeb89b86a80d5dc9e3c9d3a1a0e7ce311e26e0bb732eabaa47ffa288f0d54de28209a62a7d29d098daeed734da114470da559bd4b4c7259e1f7952555241dcbc90cf194a2ef676fc6005f3672fada2a3645edb297a7553" + ], "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } } diff --git a/examples/electra/signed_builder_bid.json b/examples/electra/signed_builder_bid.json index c386ed3..adb37d7 100644 --- a/examples/electra/signed_builder_bid.json +++ b/examples/electra/signed_builder_bid.json @@ -25,31 +25,11 @@ "blob_kzg_commitments": [ "0xa94170080872584e54a1cf092d845703b13907f2e6b3b1c0ad573b910530499e3bcd48c6378846b80d2bfa58c81cf3d5" ], - "execution_requests": { - "deposits": [ - { - "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "amount": "1", - "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", - "index": "1", - } - ], - "withdrawals": [ - { - "source_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", - "validator_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - "amount": "1", - } - ], - "consolidations": [ - { - "source_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09", - "source_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - "target_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", - } - ] - }, + "execution_requests": [ + "0x0096a96086cff07df17668f35f7418ef8798079167e3f4f9b72ecde17b28226137cf454ab1dd20ef5d924786ab3483c2f9003f5102dabe0a27b1746098d1dc17a5d3fbd478759fea9287e4e419b3c3cef20100000000000000b1acdb2c4d3df3f1b8d3bfd33421660df358d84d78d16c4603551935f4b67643373e7eb63dcb16ec359be0ec41fee33b03a16e80745f2374ff1d3c352508ac5d857c6476d3c3bcf7e6ca37427c9209f17be3af5264c0e2132b3dd1156c28b4e9f000000000000000a5c85a60ba2905c215f6a12872e62b1ee037051364244043a5f639aa81b04a204c55e7cc851f29c7c183be253ea1510b001db70c485b6264692f26b8aeaab5b0c384180df8e2184a21a808a3ec8e86ca01000000000000009561731785b48cf1886412234531e4940064584463e96ac63a1a154320227e333fb51addc4a89b7e0d3f862d7c1fd4ea03bd8eb3d8806f1e7daf591cbbbb92b0beb74d13c01617f22c5026b4f9f9f294a8a7c32db895de3b01bee0132c9209e1f100000000000000", + "0x01a94f5374fce5edbc8e2a8697c15331677e6ebf0b85103a5617937691dfeeb89b86a80d5dc9e3c9d3a1a0e7ce311e26e0bb732eabaa47ffa288f0d54de28209a62a7d29d0000000000000000000000000000000000000000000000000000010f698daeed734da114470da559bd4b4c7259e1f7952555241dcbc90cf194a2ef676fc6005f3672fada2a3645edb297a75530100000000000000", + "0x02a94f5374fce5edbc8e2a8697c15331677e6ebf0b85103a5617937691dfeeb89b86a80d5dc9e3c9d3a1a0e7ce311e26e0bb732eabaa47ffa288f0d54de28209a62a7d29d098daeed734da114470da559bd4b4c7259e1f7952555241dcbc90cf194a2ef676fc6005f3672fada2a3645edb297a7553" + ], "value": "1", "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" }, diff --git a/specs/electra/builder.md b/specs/electra/builder.md index 307a31e..532ea30 100644 --- a/specs/electra/builder.md +++ b/specs/electra/builder.md @@ -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,34 @@ 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]): + 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 up to three elements, one for +each of the type-prefixed and byte-encoded `Deposit`, `Withdrawal` and `Consolidation` request lists, see +[`get_execution_requests_list`](https://github.com/ethereum/consensus-specs/blob/dev/specs/electra/beacon-chain.md#new-get_execution_requests_list) +for an example encoding. + +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 diff --git a/types/electra/bid.yaml b/types/electra/bid.yaml index 4cafd6e..2db5c9e 100644 --- a/types/electra/bid.yaml +++ b/types/electra/bid.yaml @@ -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' + minItems: 0 + maxItems: 3 + description: "EIP-7685 encoded `ExecutionRequests` to include in block proposal." - $ref: '../bellatrix/bid.yaml#/Bellatrix/BuilderBidCommon' SignedBuilderBid: