mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-03 16:37:39 +00:00
cb02a6897d
* proto+ssz * refactor GetBlindedBlockSSZ (cherry picked from commit 97483c339f99b0d96bd81846a979383ffd2b0cda) # Conflicts: # beacon-chain/rpc/eth/beacon/blocks.go (cherry picked from commit 9e4e82d2c55e09be7568b28eaa33cdd1141445f4) # Conflicts: # beacon-chain/rpc/eth/beacon/blocks.go * add Capella version (cherry picked from commit 5d6fd0bbe663e5dd16df5b2e773f68982bbcd24e) (cherry picked from commit 82f6ddb693ac9e8b4336b30fae724e478b9e8ec0) * support SSZ lol (cherry picked from commit 52bc2c8d617ac3e1254c493fa053cdce4a1ebd63) (cherry picked from commit d7d70bc25b3ee8acbea10aaf77d26cd1f8c5f26f) * update withdrawals proto * refactor and test GetBlockV2 (cherry picked from commit c1d4eaa79d4df04bd284ec65cf261b6f5f260a97) # Conflicts: # beacon-chain/rpc/eth/beacon/blocks.go * refactor and test GetSSZBlockV2 (cherry picked from commit fbc4e73d31c2f68d55d1e2bb8e7f2d8c7458c0a0) # Conflicts: # beacon-chain/rpc/eth/beacon/blocks.go * test other functions (cherry picked from commit 31d4a4cd1165b882d823696e5983ac6635262ec2) * move stuff to blinded_blocks.go (cherry picked from commit 0a9e1658ddb28f45ae5c1cb9fc2703cbb8c6708d) # Conflicts: # beacon-chain/rpc/eth/beacon/blocks.go * fix migration code * add Capella to SubmitBlock * custom hooks * missing structs * fix tests * fix tests * review * fix build issues * replace ioutil with io Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
170 lines
7.4 KiB
Protocol Buffer
170 lines
7.4 KiB
Protocol Buffer
// Copyright 2022 Prysmatic Labs.
|
|
//
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
// you may not use this file except in compliance with the License.
|
|
// You may obtain a copy of the License at
|
|
//
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
//
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
// See the License for the specific language governing permissions and
|
|
// limitations under the License.
|
|
syntax = "proto3";
|
|
|
|
package ethereum.engine.v1;
|
|
|
|
import "proto/eth/ext/options.proto";
|
|
|
|
option csharp_namespace = "Ethereum.Engine.V1";
|
|
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/engine/v1;enginev1";
|
|
option java_multiple_files = true;
|
|
option java_outer_classname = "ExecutionEngineProto";
|
|
option java_package = "org.ethereum.engine.v1";
|
|
option php_namespace = "Ethereum\\Engine\\v1";
|
|
|
|
message ExecutionPayload {
|
|
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) = "256"];
|
|
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) = "32"];
|
|
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"];
|
|
}
|
|
|
|
message ExecutionPayloadCapella {
|
|
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) = "256"];
|
|
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) = "32"];
|
|
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"]; // New in Capella.
|
|
}
|
|
|
|
message ExecutionPayloadHeader {
|
|
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) = "256"];
|
|
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) = "32"];
|
|
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"];
|
|
}
|
|
|
|
message ExecutionPayloadHeaderCapella {
|
|
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) = "256"];
|
|
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) = "32"];
|
|
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"]; // New in Capella.
|
|
}
|
|
|
|
message TransitionConfiguration {
|
|
string terminal_total_difficulty = 1;
|
|
bytes terminal_block_hash = 2;
|
|
bytes terminal_block_number = 3;
|
|
}
|
|
|
|
message PayloadAttributes {
|
|
uint64 timestamp = 1;
|
|
bytes prev_randao = 2 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
bytes suggested_fee_recipient = 3 [(ethereum.eth.ext.ssz_size) = "20"];
|
|
}
|
|
|
|
message PayloadAttributesV2 {
|
|
uint64 timestamp = 1;
|
|
bytes prev_randao = 2 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
bytes suggested_fee_recipient = 3 [(ethereum.eth.ext.ssz_size) = "20"];
|
|
repeated Withdrawal withdrawals = 4 [(ethereum.eth.ext.ssz_max) = "withdrawal.size"]; // New in Capella.
|
|
}
|
|
|
|
message PayloadStatus {
|
|
Status status = 1;
|
|
bytes latest_valid_hash = 2 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
string validation_error = 3;
|
|
enum Status {
|
|
UNKNOWN = 0;
|
|
VALID = 1;
|
|
INVALID = 2;
|
|
SYNCING = 3;
|
|
ACCEPTED = 4;
|
|
INVALID_BLOCK_HASH = 5;
|
|
}
|
|
}
|
|
|
|
message ForkchoiceState {
|
|
bytes head_block_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
bytes safe_block_hash = 2 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
bytes finalized_block_hash = 3 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
}
|
|
|
|
// The withdrawal receipt with the recipient address and amount withdrawn
|
|
message Withdrawal {
|
|
// Withdrawal index for accounting purposes
|
|
uint64 index = 1;
|
|
|
|
// Validator index for the withdrawal
|
|
uint64 validator_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
|
|
|
|
// The execution address receiving the funds
|
|
bytes address = 3 [(ethereum.eth.ext.ssz_size) = "20"];
|
|
|
|
// The withdrawn amount in Gwei
|
|
uint64 amount = 4;
|
|
}
|
|
|
|
// Blobs bundle is retrieved through engine-api from the execution layer client.
|
|
// It consists of the necessary components for constructing a blobs sidecar object to gossip through p2p.
|
|
message BlobsBundle {
|
|
// The block hash of the payload which corresponds to the blobs.
|
|
bytes block_hash = 1 [(ethereum.eth.ext.ssz_size) = "32"];
|
|
// The KZG commitments of the blobs.
|
|
repeated bytes kzg_commitments = 2 [(ethereum.eth.ext.ssz_size) = "?,48", (ethereum.eth.ext.ssz_max) = "16"];
|
|
// The blobs itself.
|
|
repeated Blob blobs = 3 [(ethereum.eth.ext.ssz_max) = "16"];
|
|
// The aggregated proof of the blobs to enable fast validation for commitments and blobs.
|
|
bytes aggregated_proof = 4 [(ethereum.eth.ext.ssz_size) = "48"];
|
|
}
|
|
|
|
// Blob contains the data that is to be committed on chain.
|
|
message Blob {
|
|
// Each blob consists of `BLS_FIELD_ELEMENT`(32) multiplies `FIELD_ELEMENTS_PER_BLOB`(4096)
|
|
bytes data = 1 [(ethereum.eth.ext.ssz_size) = "131072"]; // 32 * 4096 = 131072
|
|
}
|