diff --git a/.gitmodules b/.gitmodules index 81aceec..3cc86b2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "beacon-apis"] path = beacon-apis - url = git@github.com:ethereum/beacon-APIs.git + url = git@github.com:jimmygchen/beacon-APIs.git diff --git a/apis/builder/blinded_blocks.yaml b/apis/builder/blinded_blocks.yaml index 4938893..daf436f 100644 --- a/apis/builder/blinded_blocks.yaml +++ b/apis/builder/blinded_blocks.yaml @@ -19,10 +19,13 @@ post: schema: oneOf: - $ref: "../../builder-oapi.yaml#/components/schemas/Bellatrix.SignedBlindedBeaconBlock" + - $ref: "../../builder-oapi.yaml#/components/schemas/Capella.SignedBlindedBeaconBlock" - $ref: "../../builder-oapi.yaml#/components/schemas/Eip4844.SignedBlindedBeaconBlock" examples: bellatrix: $ref: "../../builder-oapi.yaml#/components/examples/Bellatrix.SignedBlindedBeaconBlock" + capella: + $ref: "../../builder-oapi.yaml#/components/examples/Capella.SignedBlindedBeaconBlock" eip4844: $ref: "../../builder-oapi.yaml#/components/examples/Eip4844.SignedBlindedBeaconBlock" @@ -37,15 +40,18 @@ post: properties: version: type: string - enum: [ bellatrix, eip4844 ] + enum: [ bellatrix, capella, eip4844 ] example: "bellatrix" data: oneOf: - $ref: "../../builder-oapi.yaml#/components/schemas/Bellatrix.ExecutionPayload" + - $ref: "../../builder-oapi.yaml#/components/schemas/Capella.ExecutionPayload" - $ref: "../../builder-oapi.yaml#/components/schemas/Eip4844.ExecutionPayload" examples: bellatrix: $ref: "../../builder-oapi.yaml#/components/examples/Bellatrix.ExecutionPayload" + capella: + $ref: "../../builder-oapi.yaml#/components/examples/Capella.ExecutionPayload" eip4844: $ref: "../../builder-oapi.yaml#/components/examples/Eip4844.ExecutionPayload" "400": diff --git a/apis/builder/header.yaml b/apis/builder/header.yaml index c263da2..46a9dd2 100644 --- a/apis/builder/header.yaml +++ b/apis/builder/header.yaml @@ -50,15 +50,18 @@ get: properties: version: type: string - enum: [ bellatrix, eip4844 ] + enum: [ bellatrix, capella, eip4844 ] example: "bellatrix" data: oneOf: - $ref: "../../builder-oapi.yaml#/components/schemas/Bellatrix.SignedBuilderBid" + - $ref: "../../builder-oapi.yaml#/components/schemas/Capella.SignedBuilderBid" - $ref: "../../builder-oapi.yaml#/components/schemas/Eip4844.SignedBuilderBid" examples: bellatrix: $ref: "../../builder-oapi.yaml#/components/examples/Bellatrix.SignedBuilderBid" + capella: + $ref: "../../builder-oapi.yaml#/components/examples/Capella.SignedBuilderBid" eip4844: $ref: "../../builder-oapi.yaml#/components/examples/Eip4844.SignedBuilderBid" "204": diff --git a/beacon-apis b/beacon-apis index c39ba03..b7ff691 160000 --- a/beacon-apis +++ b/beacon-apis @@ -1 +1 @@ -Subproject commit c39ba03485bbe53715b3e8c706a6fbeb6eb61a76 +Subproject commit b7ff6916396bc38825c370c848cc1fd50d068497 diff --git a/builder-oapi.yaml b/builder-oapi.yaml index 117e036..1ec1615 100644 --- a/builder-oapi.yaml +++ b/builder-oapi.yaml @@ -63,6 +63,12 @@ components: $ref: "./beacon-apis/types/bellatrix/block.yaml#/Bellatrix/SignedBlindedBeaconBlock" Bellatrix.SignedBuilderBid: $ref: "./types/bellatrix/bid.yaml#/Bellatrix/SignedBuilderBid" + Capella.ExecutionPayload: + $ref: "./beacon-apis/types/capella/execution_payload.yaml#/Capella/ExecutionPayload" + Capella.SignedBlindedBeaconBlock: + $ref: "./beacon-apis/types/capella/block.yaml#/Capella/SignedBlindedBeaconBlock" + Capella.SignedBuilderBid: + $ref: "./types/capella/bid.yaml#/Capella/SignedBuilderBid" Eip4844.ExecutionPayload: $ref: "./beacon-apis/types/eip4844/execution_payload.yaml#/Eip4844/ExecutionPayload" Eip4844.SignedBlindedBeaconBlock: @@ -72,7 +78,6 @@ components: SignedValidatorRegistration: $ref: "./beacon-apis/types/registration.yaml#/SignedValidatorRegistration" - responses: InternalError: $ref: "./types/http.yaml#/InternalError" @@ -84,6 +89,12 @@ components: $ref: "./examples/bellatrix/execution_payload.json" Bellatrix.SignedBuilderBid: $ref: "./examples/bellatrix/signed_builder_bid.json" + Capella.SignedBlindedBeaconBlock: + $ref: "./examples/Capella/signed_blinded_beacon_block.json" + Capella.ExecutionPayload: + $ref: "./examples/Capella/execution_payload.json" + Capella.SignedBuilderBid: + $ref: "./examples/Capella/signed_builder_bid.json" Eip4844.SignedBlindedBeaconBlock: $ref: "./examples/eip4844/signed_blinded_beacon_block.json" Eip4844.ExecutionPayload: diff --git a/examples/capella/execution_payload.json b/examples/capella/execution_payload.json new file mode 100644 index 0000000..f8d6503 --- /dev/null +++ b/examples/capella/execution_payload.json @@ -0,0 +1,26 @@ +{ + "value": { + "version": "capella", + "data": { + "parent_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "fee_recipient": "0xabcf8e0d4e9587369b2301d0790347320302cc09", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "receipts_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "logs_bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "prev_randao": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "block_number": "1", + "gas_limit": "1", + "gas_used": "1", + "timestamp": "1", + "extra_data": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "base_fee_per_gas": "1", + "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "transactions": [ + "0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86" + ], + "withdrawals": [ + "0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86" + ] + } + } +} diff --git a/examples/capella/signed_blinded_beacon_block.json b/examples/capella/signed_blinded_beacon_block.json new file mode 100644 index 0000000..a3e39ff --- /dev/null +++ b/examples/capella/signed_blinded_beacon_block.json @@ -0,0 +1,158 @@ +{ + "value": { + "message": { + "slot": "1", + "proposer_index": "1", + "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "body": { + "randao_reveal": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "eth1_data": { + "deposit_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "deposit_count": "1", + "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "graffiti": "0xdeadbeefc0ffee", + "proposer_slashings": [ + { + "signed_header_1": { + "message": { + "slot": "1", + "proposer_index": "1", + "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + }, + "signed_header_2": { + "message": { + "slot": "1", + "proposer_index": "1", + "parent_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "body_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + } + ], + "attester_slashings": [ + { + "attestation_1": { + "attesting_indices": [ + "1" + ], + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "data": { + "slot": "1", + "index": "1", + "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "source": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "target": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + } + } + }, + "attestation_2": { + "attesting_indices": [ + "1" + ], + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "data": { + "slot": "1", + "index": "1", + "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "source": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "target": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + } + } + } + } + ], + "attestations": [ + { + "aggregation_bits": "0x01", + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505", + "data": { + "slot": "1", + "index": "1", + "beacon_block_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "source": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "target": { + "epoch": "1", + "root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + } + } + } + ], + "deposits": [ + { + "proof": [ + "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + ], + "data": { + "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "withdrawal_credentials": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "amount": "1", + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + } + ], + "voluntary_exits": [ + { + "message": { + "epoch": "1", + "validator_index": "1" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + ], + "sync_aggregate": { + "sync_committee_bits": "0x01", + "sync_committee_signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + }, + "execution_payload_header": { + "parent_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "fee_recipient": "0xabcf8e0d4e9587369b2301d0790347320302cc09", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "receipts_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "logs_bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "prev_randao": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "block_number": "1", + "gas_limit": "1", + "gas_used": "1", + "timestamp": "1", + "extra_data": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "base_fee_per_gas": "1", + "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "transactions_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "withdrawals_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "bls_to_execution_changes": [ + { + "message": { + "validator_index": "1", + "from_bls_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "to_execution_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + ] + } + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } +} diff --git a/examples/capella/signed_builder_bid.json b/examples/capella/signed_builder_bid.json new file mode 100644 index 0000000..e245392 --- /dev/null +++ b/examples/capella/signed_builder_bid.json @@ -0,0 +1,29 @@ +{ + "value": { + "version": "capella", + "data": { + "message": { + "header": { + "parent_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "fee_recipient": "0xabcf8e0d4e9587369b2301d0790347320302cc09", + "state_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "receipts_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "logs_bloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "prev_randao": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "block_number": "1", + "gas_limit": "1", + "gas_used": "1", + "timestamp": "1", + "extra_data": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "base_fee_per_gas": "1", + "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "transactions_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "withdrawals_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "value": "1", + "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + } +} diff --git a/examples/eip4844/execution_payload.json b/examples/eip4844/execution_payload.json index aee7384..b21b634 100644 --- a/examples/eip4844/execution_payload.json +++ b/examples/eip4844/execution_payload.json @@ -14,9 +14,13 @@ "timestamp": "1", "extra_data": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "base_fee_per_gas": "1", + "excess_data_gas": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "transactions": [ "0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86" + ], + "withdrawals": [ + "0x02f878831469668303f51d843b9ac9f9843b9aca0082520894c93269b73096998db66be0441e836d873535cb9c8894a19041886f000080c001a031cc29234036afbf9a1fb9476b463367cb1f957ac0b919b69bbc798436e604aaa018c4e9c3914eb27aadd0b91e10b18655739fcf8c1fc398763a9f1beecb8ddc86" ] } } diff --git a/examples/eip4844/signed_blinded_beacon_block.json b/examples/eip4844/signed_blinded_beacon_block.json index 993f49f..fc70c79 100644 --- a/examples/eip4844/signed_blinded_beacon_block.json +++ b/examples/eip4844/signed_blinded_beacon_block.json @@ -137,9 +137,24 @@ "timestamp": "1", "extra_data": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "base_fee_per_gas": "1", + "excess_data_gas": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "transactions_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" - } + "transactions_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "withdrawals_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + }, + "bls_to_execution_changes": [ + { + "message": { + "validator_index": "1", + "from_bls_pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "to_execution_address": "0xabcf8e0d4e9587369b2301d0790347320302cc09" + }, + "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" + } + ], + "blob_kzg_commitments": [ + "0xa94170080872584e54a1cf092d845703b13907f2e6b3b1c0ad573b910530499e3bcd48c6378846b80d2bfa58c81cf3d5" + ] } }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" diff --git a/examples/eip4844/signed_builder_bid.json b/examples/eip4844/signed_builder_bid.json index 341204c..bcb6510 100644 --- a/examples/eip4844/signed_builder_bid.json +++ b/examples/eip4844/signed_builder_bid.json @@ -16,11 +16,16 @@ "timestamp": "1", "extra_data": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", "base_fee_per_gas": "1", + "excess_data_gas": "1", "block_hash": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", - "transactions_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" + "transactions_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2", + "withdrawals_root": "0xcf8e0d4e9587369b2301d0790347320302cc0943d5a1884560367e8208d920f2" }, "value": "1", - "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a" + "pubkey": "0x93247f2209abcacf57b75a51dafae777f9dd38bc7053d1af526f220a7489a6d3a2753e5f3e8b1cfe39b56f43611df74a", + "blob_kzg_commitments": [ + "0xa94170080872584e54a1cf092d845703b13907f2e6b3b1c0ad573b910530499e3bcd48c6378846b80d2bfa58c81cf3d5" + ] }, "signature": "0x1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505cc411d61252fb6cb3fa0017b679f8bb2305b26a285fa2737f175668d0dff91cc1b66ac1fb663c9bc59509846d6ec05345bd908eda73e670af888da41af171505" } diff --git a/specs/bellatrix/builder.md b/specs/builder.md similarity index 70% rename from specs/bellatrix/builder.md rename to specs/builder.md index 17c3337..3a2cc9d 100644 --- a/specs/bellatrix/builder.md +++ b/specs/builder.md @@ -18,6 +18,10 @@ - [`BlindedBeaconBlockBody`](#blindedbeaconblockbody) - [`BlindedBeaconBlock`](#blindedbeaconblock) - [`SignedBlindedBeaconBlock`](#signedblindedbeaconblock) + - [Capella](#capella) + - [`BlindedBeaconBlockBody`](#blindedbeaconblockbody-1) + - [EIP-4844](#eip-4844) + - [`BlindedBeaconBlockBody`](#blindedbeaconblockbody-2) - [Signing](#signing) - [Endpoints](#endpoints) @@ -121,6 +125,62 @@ class SignedBlindedBeaconBlock(Container): signature: BLSSignature ``` +#### Capella + +##### `BlindedBeaconBlockBody` + +```python +class BlindedBeaconBlockBody(Container): + randao_reveal: BLSSignature + eth1_data: Eth1Data + graffiti: Bytes32 + proposer_slashings: List[ProposerSlashing, MAX_PROPOSER_SLASHINGS] + attester_slashings: List[AttesterSlashing, MAX_ATTESTER_SLASHINGS] + attestations: List[Attestation, MAX_ATTESTATIONS] + deposits: List[Deposit, MAX_DEPOSITS] + voluntary_exits: List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS] + sync_aggregate: SyncAggregate + execution_payload_header: ExecutionPayloadHeader + bls_to_execution_changes: List[SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES] # [New in Capella] +``` + +#### EIP-4844 +##### `BuilderBid` + +```python +class BuilderBid(Container): + header: ExecutionPayloadHeader # [Modified in EIP-4844] + value: uint256 + pubkey: BLSPubkey + blob_kzg_commitments: List[KZGCommitment, MAX_BLOBS_PER_BLOCK] # [New in EIP-4844] +``` + +##### `SignedBuilderBid` + +```python +class SignedBuilderBid(Container): + message: BuilderBid # [Modified in EIP-4844] + signature: BLSSignature +``` + +##### `BlindedBeaconBlockBody` + +```python +class BlindedBeaconBlockBody(Container): + randao_reveal: BLSSignature + eth1_data: Eth1Data + graffiti: Bytes32 + proposer_slashings: List[ProposerSlashing, MAX_PROPOSER_SLASHINGS] + attester_slashings: List[AttesterSlashing, MAX_ATTESTER_SLASHINGS] + attestations: List[Attestation, MAX_ATTESTATIONS] + deposits: List[Deposit, MAX_DEPOSITS] + voluntary_exits: List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS] + sync_aggregate: SyncAggregate + execution_payload_header: ExecutionPayloadHeader # [Modified in EIP-4844] + bls_to_execution_changes: List[SignedBLSToExecutionChange, MAX_BLS_TO_EXECUTION_CHANGES] + blob_kzg_commitments: List[KZGCommitment, MAX_BLOBS_PER_BLOCK] # [New in EIP-4844] +``` + ### Signing All signature operations should follow the [standard BLS operations][bls] diff --git a/specs/eip4844/builder.md b/specs/eip4844/builder.md deleted file mode 100644 index 694909c..0000000 --- a/specs/eip4844/builder.md +++ /dev/null @@ -1,154 +0,0 @@ -# Builder Specification - -## Table of Contents - - - - -- [Constants](#constants) - - [Domain types](#domain-types) -- [Containers](#containers) - - [Independently Versioned](#independently-versioned) - - [`ValidatorRegistrationV1`](#validatorregistrationv1) - - [`SignedValidatorRegistrationV1`](#signedvalidatorregistrationv1) - - [Fork Versioned](#fork-versioned) - - [Eip4844](#eip4844) - - [`BuilderBid`](#builderbid) - - [`SignedBuilderBid`](#signedbuilderbid) - - [`BlindedBeaconBlockBody`](#blindedbeaconblockbody) - - [`BlindedBeaconBlock`](#blindedbeaconblock) - - [`SignedBlindedBeaconBlock`](#signedblindedbeaconblock) - - [Signing](#signing) -- [Endpoints](#endpoints) - - - -## Constants - -### Domain types - -| Name | Value | -| - | - | -| `DOMAIN_APPLICATION_BUILDER` | `DomainType('0x00000001')` | - -## Containers - -Consider the following definitions supplementary to the definitions in -[`consensus-specs`][consensus-specs]. For information on how containers are -signed, see [Signing](#signing). - -### Independently Versioned - -Some objects can be updated independently of the `consensus-specs`, because -they originate solely from this specification. The objects are postfixed with -`VX` to denote their revision. - -#### `ValidatorRegistrationV1` - -```python -class ValidatorRegistrationV1(Container): - fee_recipient: ExecutionAddress - gas_limit: uint64 - timestamp: uint64 - pubkey: BLSPubkey -``` - -#### `SignedValidatorRegistrationV1` - -```python -class SignedValidatorRegistrationV1(Container): - message: ValidatorRegistrationV1 - signature: BLSSignature -``` - -### Fork Versioned - -Other objects are derivatives of `consensus-specs` types and depend on the -latest canonical fork. These objects are namespaced by their fork (e.g. -Eip4844). - -#### Eip4844 - -##### `BuilderBid` - -```python -class BuilderBid(Container): - header: ExecutionPayloadHeader - value: uint256 - pubkey: BLSPubkey -``` - -##### `SignedBuilderBid` - -```python -class SignedBuilderBid(Container): - message: BuilderBid - signature: BLSSignature -``` - -##### `BlindedBeaconBlockBody` - -```python -class BlindedBeaconBlockBody(Container): - randao_reveal: BLSSignature - eth1_data: Eth1Data - graffiti: Bytes32 - proposer_slashings: List[ProposerSlashing, MAX_PROPOSER_SLASHINGS] - attester_slashings: List[AttesterSlashing, MAX_ATTESTER_SLASHINGS] - attestations: List[Attestation, MAX_ATTESTATIONS] - deposits: List[Deposit, MAX_DEPOSITS] - voluntary_exits: List[SignedVoluntaryExit, MAX_VOLUNTARY_EXITS] - sync_aggregate: SyncAggregate - execution_payload_header: ExecutionPayloadHeader -``` - -##### `BlindedBeaconBlock` - -```python -class BlindedBeaconBlock(Container): - slot: Slot - proposer_index: ValidatorIndex - parent_root: Root - state_root: Root - body: BlindedBeaconBlockBody -``` - -##### `SignedBlindedBeaconBlock` - -```python -class SignedBlindedBeaconBlock(Container): - message: BlindedBeaconBlock - signature: BLSSignature -``` - -### Signing - -All signature operations should follow the [standard BLS operations][bls] -interface defined in `consensus-specs`. - -To assist in signing, we use a function from the [consensus specs][consensus-specs]: -[`compute_domain`][compute-domain] - -There are two types of data to sign over in the Builder API: -* In-protocol messages, e.g. [`BlindedBeaconBlock`](#blindedbeaconblock), which - should compute the signing root using [`compute_signing_root`][compute-root] - and use the domain specified for beacon block proposals. -* Builder API messages, e.g. validator registration and signed builder bid, which should compute the - signing root using [`compute_signing_root`][compute-root] with domain given by - `compute_domain(DOMAIN_APPLICATION_BUILDER, fork_version=None, genesis_validators_root=None)`. -As `compute_signing_root` takes `SSZObject` as input, client software should -convert in-protocol messages to their SSZ representation to compute the signing -root and Builder API messages to the SSZ representations defined -[above](#containers). - -## Endpoints - -Builder API endpoints are defined in `builder-oapi.yaml` in the root of the -repository. A rendered version can be viewed at -https://ethereum.github.io/builder-specs/. - - -[consensus-specs]: https://github.com/ethereum/consensus-specs -[bls]: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#bls-signatures -[compute-root]: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_signing_root -[compute-domain]: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#compute_domain diff --git a/specs/eip4844/validator.md b/specs/eip4844/validator.md deleted file mode 100644 index fe58fd6..0000000 --- a/specs/eip4844/validator.md +++ /dev/null @@ -1,168 +0,0 @@ -# Builder -- Honest Validator - -**Notice**: This document is a work-in-progress for researchers and implementers. - -## Table of contents - - - - -- [Introduction](#introduction) -- [Prerequisites](#prerequisites) -- [Constants](#constants) -- [Validator registration](#validator-registration) - - [Preparing a registration](#preparing-a-registration) - - [Signing and submitting a registration](#signing-and-submitting-a-registration) - - [Registration dissemination](#registration-dissemination) -- [Beacon chain responsibilities](#beacon-chain-responsibilities) - - [Block proposal](#block-proposal) - - [Constructing the `BeaconBlockBody`](#constructing-the-beaconblockbody) - - [ExecutionPayload](#executionpayload) - - [Relation to local block building](#relation-to-local-block-building) -- [How to avoid slashing](#how-to-avoid-slashing) - - [Proposer slashing](#proposer-slashing) -- [Responsibilities during the Merge transition](#responsibilities-during-the-merge-transition) - - - -## Introduction - -This document explains the way in which a beacon chain validator is expected to use the [Builder spec][builder-spec] to -participate in an external builder network. - -At a high-level, there is a registration step validators must perform ahead of any proposal duties so builders know how -to craft blocks for their specific proposal. Having performed the registration, a validator waits until it is their turn -to propose the next block in the chain. The validator then requests an `ExecutionPayload` from the external builder -network to put into their `SignedBeaconBlock` in lieu of one they could build locally. - -## Prerequisites - -This document assumes knowledge of the terminology, definitions, and other material in the [Builder spec][builder-spec] -and by extension the [Eip4844 consensus specs][eip4844-specs]. - -## Constants - -| Name | Value | Units | -| - | - | - | -| `EPOCHS_PER_VALIDATOR_REGISTRATION_SUBMISSION` | 1 | epoch(s)| -| `BUILDER_PROPOSAL_DELAY_TOLERANCE` | 1 | second(s) | - -## Validator registration - -A validator begins interacting with the external builder network by submitting a signed registration to each of the -builders it wants to utilize during block production. - -### Preparing a registration - -To do this, the validator client assembles a [`ValidatorRegistrationV1`][validator-registration-v1] with the following -information: - -* `fee_recipient`: an execution layer address where fees for the validator should go. -* `gas_limit`: the value a validator prefers for the execution block gas limit. -* `timestamp`: a recent timestamp later than any previously constructed `ValidatorRegistrationV1`. - Builders use this timestamp as a form of anti-DoS and to sequence registrations. -* `pubkey`: the validator's public key. Used to identify the beacon chain validator and verify the wrapping signature. - -### Signing and submitting a registration - -The validator takes the constructed `ValidatorRegistrationV1` `message` and signs according to the method given in -the [Builder spec][builder-spec] to make a `signature`. - -This `signature` is placed along with the `message` into a `SignedValidatorRegistrationV1` and submitted to a connected -beacon node using the [`registerValidator`][register-validator-api] endpoint of the standard validator -[beacon node APIs][beacon-node-apis]. - -Validators **should** submit valid registrations well ahead of any potential beacon chain proposal duties to ensure -their building preferences are widely available in the external builder network. - -### Registration dissemination - -Validators are expected to periodically send their own `SignedValidatorRegistrationV1` messages upstream to the external -builder network using the [`registerValidator`][register-validator-with-builder] endpoint of the standard -[APIs defined in the builder spec][builder-spec-apis]. - -Registrations should be re-submitted frequently enough that any changes to their building preferences can be widely -spread across the builder network in a timely manner. - -This specification suggests validators re-submit to builder software every -`EPOCHS_PER_VALIDATOR_REGISTRATION_SUBMISSION` epochs. - -## Beacon chain responsibilities - -Refer to the [Eip4844 validator specs][eip4844-validator-specs] for the expected set of duties a validator is -expected to perform, including a pathway for local block building. The external builder network offers a separate block -building pathway that can be used concurrently with this local process. - -### Block proposal - -#### Constructing the `BeaconBlockBody` - -##### ExecutionPayload - -To obtain an execution payload, a block proposer building a block on top of a beacon `state` in a given `slot` must take -the following actions: - -1. Call upstream builder software to get an `ExecutionPayloadHeader` with the - required data `slot`, `parent_hash` and `pubkey`, where: - * `slot` is the proposal's slot - * `parent_hash` is the value `state.latest_execution_payload_header.block_hash` - * `pubkey` is the proposer's public key -2. Assemble a `BlindedBeaconBlock` according to the process outlined in the [Eip4844 specs][eip4844-specs] but with - the `ExecutionPayloadHeader` from the prior step in lieu of the full `ExecutionPayload`. -3. The proposer signs the `BlindedBeaconBlock` and assembles a `SignedBlindedBeaconBlock` which is returned to the - upstream builder software. -4. The upstream builder software responds with the full `ExecutionPayload`. The proposer can use this payload - to assemble a `SignedBeaconBlock` following the rest of the proposal process outlined in the - [Eip4844 specs][eip4844-specs]. - -#### Relation to local block building - -The external builder network offers a service for proposers that may from time to time fail to produce a timely block. -Honest proposers who elect to use the external builder network **MUST** also build a block locally in the event that the -external builder network fails to provide a `SignedBuilderBid` in time in order to propagate the full -`SignedBeaconBlock` during the proposer's slot. The local build task should begin in parallel to any use of the external -builder network. - -Honest proposers using the external builder network will give the builders a duration of -`BUILDER_PROPOSAL_DELAY_TOLERANCE` to provide a `SignedBuilderBid` before the external builder is considered to have hit -the deadline and the external builder flow must be aborted in favor of a local build process. - -**WARNING**: Validators must be careful to not get slashed when orchestrating the duplicate building pathways. - See the [section on slashing](#proposer-slashing) for more information. - -## How to avoid slashing - -### Proposer slashing - -Validators must take care to not publish signatures for two distinct blocks even if there is a failure with the external -builder network. A `ProposerSlashing` can be formed in this event from the competing beacon block headers which results -in getting slashed. - -To avoid slashing when using the external builder network, a validator should begin the external build process for an -`ExecutionPayloadHeader` along with the local build process for an `ExecutionPayload` as soon as they know the required -parameters to do so. Regardless of which process completes in time, the validator should cancel the other -process as soon as they have produced a signature for a beacon block, either a `BeaconBlock` **or** a -`BlindedBeaconBlock`. Producing distinct signatures for the validator's proposal slot, for example because the -transactions list of the `BeaconBlockBody` are different, is the slashable offense. This means if a validator publishes -a signature for a `BlindedBeaconBlock` (via a dissemination of a `SignedBlindedBeaconBlock`) then the validator -**MUST** not use the local build process as a fallback, even in the event of some failure with the external builder -network. - -## Responsibilities during the Merge transition - -Honest validators will not utilize the external builder network during the transition from proof-of-work to -proof-of-stake. This requirement is in place to reduce the overall technical complexity of the Merge. - -Concretely, honest validators **MUST** wait until the transition has been finalized before -they can start querying the external builder network. See [EIP-3675][eip-3675] for further details about the transition -process itself. - -[builder-spec]: ./builder.md -[builder-spec-apis]: ./builder.md#endpoints -[register-validator-with-builder]: https://ethereum.github.io/builder-specs/#/Builder/registerValidator -[validator-registration-v1]: ./builder.md#validatorregistrationv1 -[register-validator-api]: https://ethereum.github.io/beacon-APIs/#/Validator/registerValidator -[beacon-node-apis]: https://ethereum.github.io/beacon-APIs -[eip4844-specs]: https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844 -[eip4844-validator-specs]: https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/validator.md -[eip-3675]: https://eips.ethereum.org/EIPS/eip-3675 diff --git a/specs/bellatrix/validator.md b/specs/validator.md similarity index 100% rename from specs/bellatrix/validator.md rename to specs/validator.md diff --git a/types/capella/bid.yaml b/types/capella/bid.yaml new file mode 100644 index 0000000..2c57191 --- /dev/null +++ b/types/capella/bid.yaml @@ -0,0 +1,23 @@ +Capella: + BuilderBid: + type: object + description: "The `BuilderBid` object from the Builder API spec." + properties: + header: + $ref: "../../beacon-apis/types/capella/execution_payload.yaml#/Capella/ExecutionPayloadHeader" + description: "`ExecutionPayloadHeader` to use in block proposal." + value: + $ref: "../../beacon-apis/types/primitive.yaml#/Uint256" + description: "Payment in wei that will be paid to the `fee_recipient` account." + pubkey: + $ref: "../../beacon-apis/types/primitive.yaml#/Pubkey" + description: "BLS public key of builder." + + SignedBuilderBid: + type: object + description: "The `SignedBuilderBid` object from the Builder API spec." + properties: + message: + $ref: "#/Capella/BuilderBid" + signature: + $ref: "../../beacon-apis/types/primitive.yaml#/Signature"