Skip to content

Commit

Permalink
Protobufs for Electra devnet-0 (#13905)
Browse files Browse the repository at this point in the history
* block protos

* proto and ssz

* stubs

* Enable Electra spec test

* Pull in EIP-7251 protobuf changes

From: #13903

* All EIP7549 containers are passing

* All EIP7251 containers passing

* including changes from eip7002

* Everything passing except for beacon state hash tree root

* fixing eletra state to use electra payload

* Fix minimal test. Skip beacon state test

* Perston's feedback

---------

Co-authored-by: rkapka <radoslaw.kapka@gmail.com>
Co-authored-by: james-prysm <james@prysmaticlabs.com>
  • Loading branch information
3 people authored and prestonvanloon committed Apr 25, 2024
1 parent fd34442 commit fa82da9
Show file tree
Hide file tree
Showing 28 changed files with 13,581 additions and 5,091 deletions.
188 changes: 94 additions & 94 deletions beacon-chain/core/blocks/withdrawals_test.go

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions proto/engine/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,13 @@ ssz_gen_marshal(
"ExecutionPayloadHeaderCapella",
"ExecutionPayloadHeaderDeneb",
"ExecutionPayloadDeneb",
"ExecutionPayloadHeaderElectra",
"ExecutionPayloadElectra",
"BlindedBlobsBundle",
"BlobsBundle",
"Withdrawal",
"ExecutionLayerWithdrawalRequest",
"DepositReceipt",
],
)

Expand Down
1,496 changes: 1,104 additions & 392 deletions proto/engine/v1/execution_engine.pb.go

Large diffs are not rendered by default.

68 changes: 68 additions & 0 deletions proto/engine/v1/execution_engine.proto
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,29 @@ message ExecutionPayloadDeneb {
uint64 excess_blob_gas = 17;
}

message ExecutionPayloadElectra {
bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"];
bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"];
bytes state_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
bytes receipts_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
bytes logs_bloom = 5 [(ethereum.eth.ext.ssz_size) = "logs_bloom.size"];
bytes prev_randao = 6 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 block_number = 7;
uint64 gas_limit = 8;
uint64 gas_used = 9;
uint64 timestamp = 10;
bytes extra_data = 11 [(ethereum.eth.ext.ssz_max) = "extra_data.size"];
bytes base_fee_per_gas = 12 [(ethereum.eth.ext.ssz_size) = "32"];
bytes block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"];
repeated bytes transactions = 14 [(ethereum.eth.ext.ssz_size) = "?,?", (ethereum.eth.ext.ssz_max) = "1048576,1073741824"];
// MAX_WITHDRAWALS_PER_PAYLOAD
repeated Withdrawal withdrawals = 15 [(ethereum.eth.ext.ssz_max) = "withdrawal.size"];
uint64 blob_gas_used = 16;
uint64 excess_blob_gas = 17;
repeated DepositReceipt deposit_receipts = 18 [(ethereum.eth.ext.ssz_max) = "max_deposit_receipts"]; // new in electra, eip6110
repeated ExecutionLayerWithdrawalRequest withdrawal_requests = 19 [(ethereum.eth.ext.ssz_max) = "max_withdrawal_requests_per_payload.size"]; // new in electra, eip7002, eip7251
}

message ExecutionPayloadCapellaWithValue {
ExecutionPayloadCapella payload = 1;
bytes value = 2;
Expand Down Expand Up @@ -154,6 +177,28 @@ message ExecutionPayloadHeaderDeneb {
uint64 excess_blob_gas = 17;
}

message ExecutionPayloadHeaderElectra {
bytes parent_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"];
bytes fee_recipient = 2 [(ethereum.eth.ext.ssz_size) = "20"];
bytes state_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
bytes receipts_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
bytes logs_bloom = 5 [(ethereum.eth.ext.ssz_size) = "logs_bloom.size"];
bytes prev_randao = 6 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 block_number = 7;
uint64 gas_limit = 8;
uint64 gas_used = 9;
uint64 timestamp = 10;
bytes extra_data = 11 [(ethereum.eth.ext.ssz_max) = "extra_data.size"];
bytes base_fee_per_gas = 12 [(ethereum.eth.ext.ssz_size) = "32"];
bytes block_hash = 13 [(ethereum.eth.ext.ssz_size) = "32"];
bytes transactions_root = 14 [(ethereum.eth.ext.ssz_size) = "32"];
bytes withdrawals_root = 15 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 blob_gas_used = 16;
uint64 excess_blob_gas = 17;
bytes deposit_receipts_root = 18 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip6110
bytes withdrawal_requests_root = 19 [(ethereum.eth.ext.ssz_size) = "32"]; // new in electra, eip7002, eip7251
}

message PayloadAttributes {
uint64 timestamp = 1;
bytes prev_randao = 2 [(ethereum.eth.ext.ssz_size) = "32"];
Expand Down Expand Up @@ -232,3 +277,26 @@ message Blob {
message ExchangeCapabilities {
repeated string supported_methods = 1;
}

// ExecutionLayerWithdrawalRequest is the message from the execution layer to trigger the withdrawal of a validator's balance to its withdrawal address
// new in Electra
message ExecutionLayerWithdrawalRequest {
// The execution address receiving the funds
bytes source_address = 1 [(ethereum.eth.ext.ssz_size) = "20"];

// 48 byte BLS public key of the validator.
bytes validator_pubkey = 2 [(ethereum.eth.ext.ssz_size) = "48"];

// Deposit amount in gwei.
uint64 amount = 3;
}

// DepositReceipt is the message from the execution layer to trigger the deposit of a validator's balance to its balance
// new in Electra
message DepositReceipt {
bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48"];
bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 amount = 3;
bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"];
uint64 index = 5;
}
Loading

0 comments on commit fa82da9

Please sign in to comment.