Commit 32ddad93 authored by jim's avatar jim

add verify signature, checktx, eth proto

parent 43d405c6
...@@ -7,43 +7,6 @@ import "google/protobuf/field_mask.proto"; ...@@ -7,43 +7,6 @@ import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto"; import "google/protobuf/timestamp.proto";
import "meta/crypter/v1/resource.proto"; import "meta/crypter/v1/resource.proto";
message SignRequest {
string id = 1;
bytes privk = 2;
bytes data = 3;
CryptType crypt_type = 4;
}
message SignResponse {
string id = 1;
bytes signature = 2;
}
message VerifyRequest {
string id = 1;
bytes pubkey = 2;
bytes signature = 3;
CryptType crypt_type = 4;
}
message VerifyResponse {
string id = 1;
bool verified = 2;
}
message RecoverRequest {
string id = 1;
bytes data = 2;
bytes signature = 3;
CryptType crypt_type = 4;
}
message RecoverResponse {
string id = 1;
bytes pubkey = 2;
}
message BatchSignRequest { message BatchSignRequest {
...@@ -67,7 +30,7 @@ message BatchVerifyRequest { ...@@ -67,7 +30,7 @@ message BatchVerifyRequest {
message BatchVerifyResponse { message BatchVerifyResponse {
string id = 1; string id = 1;
repeated bool verified = 2; repeated bytes from = 2;
} }
......
...@@ -6,9 +6,9 @@ option go_package = "crypterv1"; ...@@ -6,9 +6,9 @@ option go_package = "crypterv1";
import "meta/crypter/v1/request_response.proto"; import "meta/crypter/v1/request_response.proto";
service CrypterService { service CrypterService {
rpc Sign(SignRequest) returns (SignResponse) {} // rpc Sign(SignRequest) returns (SignResponse) {}
rpc Verify(VerifyRequest) returns (VerifyResponse) {} // rpc Verify(VerifyRequest) returns (VerifyResponse) {}
rpc Recover(RecoverRequest) returns (RecoverResponse) {} // rpc Recover(RecoverRequest) returns (RecoverResponse) {}
rpc BatchSign(BatchSignRequest) returns (BatchSignResponse) {} rpc BatchSign(BatchSignRequest) returns (BatchSignResponse) {}
rpc BatchVerify(BatchVerifyRequest) returns (BatchVerifyResponse) {} rpc BatchVerify(BatchVerifyRequest) returns (BatchVerifyResponse) {}
rpc BatchRecover(BatchRecoverRequest) returns (BatchRecoverResponse) {} rpc BatchRecover(BatchRecoverRequest) returns (BatchRecoverResponse) {}
......
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_proto_library")
proto_library(
name = "proto",
srcs = [
"options.proto",
],
visibility = ["//visibility:public"],
deps = [
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//:empty_proto",
],
)
##############################################################################
# Go
##############################################################################
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("//tools:ssz.bzl", "SSZ_DEPS", "ssz_gen_marshal")
go_proto_library(
name = "go_proto",
compilers = [
"@com_github_prysmaticlabs_protoc_gen_go_cast//:go_cast",
],
importpath = "github.com/prysmaticlabs/ethereumapis/eth/ext",
proto = ":proto",
visibility = ["//visibility:public"],
deps = [
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@com_github_golang_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//types/descriptorpb:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
],
)
go_library(
name = "go_default_library",
embed = [":go_proto"],
importpath = "github.com/prysmaticlabs/ethereumapis/eth/ext",
visibility = ["//visibility:public"],
deps = SSZ_DEPS + [
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@com_github_golang_protobuf//proto:go_default_library",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
], # keep
)
##############################################################################
# Java
##############################################################################
java_proto_library(
name = "java_proto",
deps = [":proto"],
)
// Copyright 2020 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.eth.ext;
import "google/protobuf/descriptor.proto";
option csharp_namespace = "Ethereum.Eth.ext";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/ext";
option java_multiple_files = true;
option java_outer_classname = "OptionsProto";
option java_package = "org.ethereum.eth.ext";
option php_namespace = "Ethereum\\Eth\\ext";
extend google.protobuf.FieldOptions {
string cast_type = 50000;
string ssz_size = 50001;
string ssz_max = 50002;
string spec_name = 50003;
}
\ No newline at end of file
// Copyright 2020 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.eth.service;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/empty.proto";
import "eth/v1/beacon_block.proto";
import "eth/v1/beacon_chain.proto";
import "eth/v2/beacon_block.proto";
import "eth/v2/ssz.proto";
import "eth/v2/sync_committee.proto";
option csharp_namespace = "Ethereum.Eth.Service";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/service";
option java_multiple_files = true;
option java_outer_classname = "BeaconChainServiceProto";
option java_package = "org.ethereum.eth.service";
option php_namespace = "Ethereum\\Eth\\Service";
// Beacon Chain API
//
// The config API endpoints can be used to query the beacon chain state and information. Such as spec, current fork,
// blocks, and the validator spec.
//
// This service is defined in the upstream Ethereum consensus APIs repository (beacon-apis/apis/).
service BeaconChain {
// Beacon state API related endpoints.
// GetGenesis retrieves details of the chain's genesis which can be used to identify chain.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getGenesis
rpc GetGenesis(google.protobuf.Empty) returns (v1.GenesisResponse) {
option (google.api.http) = { get: "/internal/eth/v1/beacon/genesis" };
}
// GetWeakSubjectivity is a new proposed endpoint to retrieve the details necessary to download
// the ssz data needed to start a beacon node - checkpoint(epoch + block_root) and state_root
rpc GetWeakSubjectivity(google.protobuf.Empty) returns (v1.WeakSubjectivityResponse) {
option (google.api.http) = { get: "/internal/eth/v1/beacon/weak_subjectivity" };
}
// GetStateRoot calculates HashTreeRoot for state with given 'stateId'. If stateId is root, same value will be returned.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getStateRoot
rpc GetStateRoot(v1.StateRequest) returns (v1.StateRootResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/states/{state_id}/root"
};
}
// GetStateFork returns Fork object for state with given 'stateId'.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getStateFork
rpc GetStateFork(v1.StateRequest) returns (v1.StateForkResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/states/{state_id}/fork"
};
}
// GetFinalityCheckpoints returns finality checkpoints for state with given 'stateId'. In case finality is
// not yet achieved, checkpoint should return epoch 0 and ZERO_HASH as root.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getStateFinalityCheckpoints
rpc GetFinalityCheckpoints(v1.StateRequest) returns (v1.StateFinalityCheckpointResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/states/{state_id}/finality_checkpoints"
};
}
// ListValidators returns a filterable list of validators with their balance, status and index.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getStateValidators
rpc ListValidators(v1.StateValidatorsRequest) returns (v1.StateValidatorsResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/states/{state_id}/validators"
};
}
// GetValidator returns a validator specified by state and id or public key along with status and balance.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getStateValidator
rpc GetValidator(v1.StateValidatorRequest) returns (v1.StateValidatorResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/states/{state_id}/validators/{validator_id}"
};
}
// ListValidators returns a filterable list of validator balances.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getStateValidatorBalances
rpc ListValidatorBalances(v1.ValidatorBalancesRequest) returns (v1.ValidatorBalancesResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/states/{state_id}/validator_balances"
};
}
// ListCommittees retrieves the committees for the given state at the given epoch.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getEpochCommittees
rpc ListCommittees(v1.StateCommitteesRequest) returns (v1.StateCommitteesResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/states/{state_id}/committees"
};
}
// ListSyncCommittees retrieves the sync committees for the given state at the given epoch.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getEpochSyncCommittees
rpc ListSyncCommittees(v2.StateSyncCommitteesRequest) returns (v2.StateSyncCommitteesResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/states/{state_id}/sync_committees"
};
}
// Beacon blocks API related endpoints.
// ListBlockHeaders retrieves block headers matching given query. By default it will fetch current head slot blocks.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getBlockHeaders
rpc ListBlockHeaders(v1.BlockHeadersRequest) returns (v1.BlockHeadersResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/headers"
};
}
// GetBlockHeader retrieves block header for given block id.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getBlockHeader
rpc GetBlockHeader(v1.BlockRequest) returns (v1.BlockHeaderResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/headers/{block_id}"
};
}
// SubmitBlock instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be
// included in the beacon chain. The beacon node is not required to validate the signed BeaconBlock, and a successful
// response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the
// new block into its state, and therefore validate the block internally, however blocks which fail the validation are
// still broadcast but a different status code is returned (202).
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/publishBlock
rpc SubmitBlock(v2.SignedBeaconBlockContainer) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/beacon/blocks"
body: "*"
};
}
// SubmitBlock instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be
// included in the beacon chain. The beacon node is not required to validate the signed BeaconBlock, and a successful
// response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the
// new block into its state, and therefore validate the block internally, however blocks which fail the validation are
// still broadcast but a different status code is returned (202).
//
// The provided block must be SSZ-serialized.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/publishBlock
rpc SubmitBlockSSZ(v2.SSZContainer) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/beacon/blocks/ssz"
body: "*"
};
}
// SubmitBlindedBlock instructs the beacon node to use the components of the `SignedBlindedBeaconBlock` to construct
// and publish a `SignedBeaconBlock` by swapping out the `transactions_root` for the corresponding full list of `transactions`.
// The beacon node should broadcast a newly constructed `SignedBeaconBlock` to the beacon network,
// to be included in the beacon chain. The beacon node is not required to validate the signed
// `BeaconBlock`, and a successful response (20X) only indicates that the broadcast has been
// successful. The beacon node is expected to integrate the new block into its state, and
// therefore validate the block internally, however blocks which fail the validation are still
// broadcast but a different status code is returned (202).
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/publishBlindedBlock
rpc SubmitBlindedBlock(v2.SignedBlindedBeaconBlockContainer) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/beacon/blinded_blocks"
body: "*"
};
}
// SubmitBlindedBlock instructs the beacon node to use the components of the `SignedBlindedBeaconBlock` to construct
// and publish a `SignedBeaconBlock` by swapping out the `transactions_root` for the corresponding full list of `transactions`.
// The beacon node should broadcast a newly constructed `SignedBeaconBlock` to the beacon network,
// to be included in the beacon chain. The beacon node is not required to validate the signed
// `BeaconBlock`, and a successful response (20X) only indicates that the broadcast has been
// successful. The beacon node is expected to integrate the new block into its state, and
// therefore validate the block internally, however blocks which fail the validation are still
// broadcast but a different status code is returned (202).
//
// The provided block must be SSZ-serialized.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/publishBlindedBlock
rpc SubmitBlindedBlockSSZ(v2.SSZContainer) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/beacon/blinded_blocks/ssz"
body: "*"
};
}
// GetBlockRoot retrieves hashTreeRoot of BeaconBlock/BeaconBlockHeader.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getBlockRoot
rpc GetBlockRoot(v1.BlockRequest) returns (v1.BlockRootResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/blocks/{block_id}/root"
};
}
// GetBlock retrieves block details for given block id.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getBlock
rpc GetBlock(v1.BlockRequest) returns (v1.BlockResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/blocks/{block_id}"
};
}
// GetBlockSSZ returns the SSZ-serialized version of block details for given block id.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getBlock
rpc GetBlockSSZ(v1.BlockRequest) returns (v1.BlockSSZResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/blocks/{block_id}/ssz"
};
}
// GetBlockV2 retrieves block details for given block id.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getBlockV2
rpc GetBlockV2(v2.BlockRequestV2) returns (v2.BlockResponseV2) {
option (google.api.http) = {
get: "/internal/eth/v2/beacon/blocks/{block_id}"
};
}
// GetBlindedBlock retrieves blinded block for given block id.
//
// https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Beacon/getBlindedBlock
rpc GetBlindedBlock(v1.BlockRequest) returns (v2.BlindedBlockResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/blinded_blocks/{block_id}"
};
}
// GetBlindedBlockSSZ returns the SSZ-serialized version of blinded block details for given block id.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=dev#/Beacon/getBlindedBlock
rpc GetBlindedBlockSSZ(v1.BlockRequest) returns (v2.SSZContainer) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/blinded_blocks/{block_id}/ssz"
};
}
// GetBlockSSZV2 returns the SSZ-serialized version of block details for given block id.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getBlockV2
rpc GetBlockSSZV2(v2.BlockRequestV2) returns (v2.SSZContainer) {
option (google.api.http) = {
get: "/internal/eth/v2/beacon/blocks/{block_id}/ssz"
};
}
// ListBlockAttestations retrieves attestation included in requested block.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getBlockAttestations
rpc ListBlockAttestations(v1.BlockRequest) returns (v1.BlockAttestationsResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/blocks/{block_id}/attestations"
};
}
// Beacon pools API related endpoints.
// ListPoolAttestations retrieves attestations known by the node but
// not necessarily incorporated into any block.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getPoolAttestations
rpc ListPoolAttestations(v1.AttestationsPoolRequest) returns (v1.AttestationsPoolResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/pool/attestations"
};
}
// SubmitAttestations submits Attestation objects to node. If attestation passes all validation
// constraints, node MUST publish attestation on appropriate subnet.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/submitPoolAttestations
rpc SubmitAttestations(v1.SubmitAttestationsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/beacon/pool/attestations"
body: "*"
};
}
// ListPoolAttesterSlashings retrieves attester slashings known by the node but
// not necessarily incorporated into any block.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getPoolAttesterSlashings
rpc ListPoolAttesterSlashings(google.protobuf.Empty) returns (v1.AttesterSlashingsPoolResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/pool/attester_slashings"
};
}
// SubmitAttesterSlashing submits AttesterSlashing object to node's pool and
// if passes validation node MUST broadcast it to network.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/submitPoolAttesterSlashings
rpc SubmitAttesterSlashing(v1.AttesterSlashing) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/beacon/pool/attester_slashings"
body: "*"
};
}
// ListPoolProposerSlashings retrieves proposer slashings known by the node
// but not necessarily incorporated into any block.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getPoolProposerSlashings
rpc ListPoolProposerSlashings(google.protobuf.Empty) returns (v1.ProposerSlashingPoolResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/pool/proposer_slashings"
};
}
// SubmitProposerSlashing submits AttesterSlashing object to node's pool and if
// passes validation node MUST broadcast it to network.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/submitPoolProposerSlashings
rpc SubmitProposerSlashing(v1.ProposerSlashing) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/beacon/pool/proposer_slashings"
body: "*"
};
}
// ListPoolVoluntaryExits retrieves voluntary exits known by the node but
// not necessarily incorporated into any block.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/getPoolVoluntaryExits
rpc ListPoolVoluntaryExits(google.protobuf.Empty) returns (v1.VoluntaryExitsPoolResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/beacon/pool/voluntary_exits"
};
}
// SubmitVoluntaryExit submits SignedVoluntaryExit object to node's pool
// and if passes validation node MUST broadcast it to network.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/submitPoolVoluntaryExit
rpc SubmitVoluntaryExit(v1.SignedVoluntaryExit) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/beacon/pool/voluntary_exits"
body: "*"
};
}
// Submits sync committee signature objects to the node.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Beacon/submitPoolSyncCommitteeSignatures
rpc SubmitPoolSyncCommitteeSignatures(v2.SubmitPoolSyncCommitteeSignatures) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/beacon/pool/sync_committees"
body: "*"
};
}
// Beacon config API related endpoints.
// GetForkSchedule retrieve all scheduled upcoming forks this node is aware of.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Config/getForkSchedule
rpc GetForkSchedule(google.protobuf.Empty) returns (v1.ForkScheduleResponse) {
option (google.api.http) = {get: "/internal/eth/v1/config/fork_schedule"};
}
// Spec retrieves specification configuration (without Phase 1 params) used on this node. Specification params list
// Values are returned with following format:
// - any value starting with 0x in the spec is returned as a hex string
// - all other values are returned as number
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Config/getSpec
rpc GetSpec(google.protobuf.Empty) returns (v1.SpecResponse) {
option (google.api.http) = {get: "/internal/eth/v1/config/spec"};
}
// GetDepositContract retrieves deposit contract address and genesis fork version.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Config/getDepositContract
rpc GetDepositContract(google.protobuf.Empty) returns (v1.DepositContractResponse) {
option (google.api.http) = {get: "/internal/eth/v1/config/deposit_contract"};
}
}
// Copyright 2020 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.eth.service;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/empty.proto";
import "eth/v1/beacon_chain.proto";
import "eth/v1/beacon_state.proto";
import "eth/v2/beacon_state.proto";
import "eth/v2/ssz.proto";
option csharp_namespace = "Ethereum.Eth.Service";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/service";
option java_multiple_files = true;
option java_outer_classname = "BeaconDebugServiceProto";
option java_package = "org.ethereum.eth.service";
option php_namespace = "Ethereum\\Eth\\Service";
// Beacon chain debug API
//
// The beacon chain debug API is a set of endpoints to debug chain and shouldn't be exposed publicly.
//
// This service is defined in the upstream Ethereum consensus APIs repository (beacon-apis/apis/debug).
service BeaconDebug {
// GetBeaconStateSSZ returns the SSZ-serialized version of the full BeaconState object for given stateId.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Debug/getState
rpc GetBeaconStateSSZ(v1.StateRequest) returns (v2.SSZContainer) {
option (google.api.http) = {
get: "/internal/eth/v1/debug/beacon/states/{state_id}/ssz"
};
}
// GetBeaconStateV2 returns full BeaconState object for given stateId.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Debug/getStateV2
rpc GetBeaconStateV2(v2.BeaconStateRequestV2) returns (v2.BeaconStateResponseV2) {
option (google.api.http) = {
get: "/internal/eth/v2/debug/beacon/states/{state_id}"
};
}
// GetBeaconStateSSZV2 returns the SSZ-serialized version of the full BeaconState object for given stateId.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Debug/getStateV2
rpc GetBeaconStateSSZV2(v2.BeaconStateRequestV2) returns (v2.SSZContainer) {
option (google.api.http) = {
get: "/internal/eth/v2/debug/beacon/states/{state_id}/ssz"
};
}
// ListForkChoiceHeadsV2 retrieves all possible chain heads (leaves of fork choice tree).
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Debug/getDebugChainHeadsV2
rpc ListForkChoiceHeadsV2(google.protobuf.Empty) returns (v2.ForkChoiceHeadsResponse) {
option (google.api.http) = {
get: "/internal/eth/v2/debug/beacon/heads"
};
}
// GetForkChoice returns a dump fork choice store.
//
// This function is not a part of the official Beacon APIs.
rpc GetForkChoice(google.protobuf.Empty) returns (v1.ForkChoiceResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/debug/beacon/forkchoice"
};
}
}
\ No newline at end of file
// Copyright 2020 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.eth.service;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "eth/v1/events.proto";
import "proto/gateway/event_source.proto";
option csharp_namespace = "Ethereum.Eth.Service";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/service";
option java_multiple_files = true;
option java_outer_classname = "EventsServiceProto";
option java_package = "org.ethereum.eth.service";
option php_namespace = "Ethereum\\Eth\\Service";
// Events API
//
// This service is defined in the upstream Ethereum consensus APIs repository (beacon-apis/apis/debug).
service Events {
// Provides endpoint to subscribe to beacon node Server-Sent-Events stream. Consumers should use eventsource implementation to listen on those events.
// Servers may send SSE comments beginning with : for any purpose, including to keep the event stream connection alive in the presence of proxy servers.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Events/eventstream
rpc StreamEvents(v1.StreamEventsRequest) returns (stream gateway.EventSource) {
option (google.api.http) = {
get: "/internal/eth/v1/events"
};
}
}
// Copyright 2020 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.eth.service;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/empty.proto";
option csharp_namespace = "Ethereum.Eth.Service";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/service";
option java_multiple_files = true;
option java_outer_classname = "KeyManagementServiceProto";
option java_package = "org.ethereum.eth.service";
option php_namespace = "Ethereum\\Eth\\Service";
// Validator Key Management Standard API
//
// The validator key management API is a set of endpoints to be used for keystore management in the validator client.
//
// This service is defined in the upstream Ethereum consensus APIs repository (beacon-apis/apis/keystores).
service KeyManagement {
// ListKeystores for all keystores known to and decrypted by the keymanager.
//
// HTTP response status codes:
// - 200: Successful response
// - 401: Unauthorized
// - 403: Forbidden from accessing the resource
// - 500: Validator internal error
rpc ListKeystores(google.protobuf.Empty) returns (ListKeystoresResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/keystores"
};
}
// ImportKeystores generated by the Eth2.0 deposit CLI tooling.
// Users SHOULD send slashing_protection data associated with the imported
// pubkeys. MUST follow the format defined in EIP-3076: Slashing Protection Interchange Format.
//
// HTTP response status codes:
// - 200: Successful response
// - 401: Unauthorized
// - 403: Forbidden from accessing the resource
// - 500: Validator internal error
rpc ImportKeystores(ImportKeystoresRequest) returns (ImportKeystoresResponse) {
option (google.api.http) = {
post: "/internal/eth/v1/keystores",
body: "*"
};
}
// DeleteKeystores must delete all keystores from `request.pubkeys` that are known to the keymanager and exist
// in its persistent storage. Additionally, DELETE must fetch the slashing protection data for the requested keys from
// persistent storage, which must be retained (and not deleted) after the response has been sent. Therefore in the
// case of two identical delete requests being made, both will have access to slashing protection data.
// In a single atomic sequential operation the keymanager must:
//
// 1. Guarantee that key(s) can not produce any more signature; only then
// 2. Delete key(s) and serialize its associated slashing protection data
//
// DELETE should never return a 404 response, even if all pubkeys from request.pubkeys have no extant keystores
// nor slashing protection data.
//
// HTTP response status codes:
// - 200: Successful response
// - 401: Unauthorized
// - 403: Forbidden from accessing the resource
// - 500: Validator internal error
rpc DeleteKeystores(DeleteKeystoresRequest) returns (DeleteKeystoresResponse) {
option (google.api.http) = {
delete: "/internal/eth/v1/keystores",
body: "*"
};
}
// ListRemoteKeys for all web3signer public validator keys known to the keymanager.
//
// HTTP response status codes:
// - 200: Successful response
// - 401: Unauthorized
// - 403: Forbidden from accessing the resource
// - 500: Validator internal error
rpc ListRemoteKeys(google.protobuf.Empty) returns (ListRemoteKeysResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/remotekeys"
};
}
// ImportRemoteKeys imports and sets web3signer public validator keys in the keymanager.
//
// HTTP response status codes:
// - 200: Successful response
// - 401: Unauthorized
// - 403: Forbidden from accessing the resource
// - 500: Validator internal error
rpc ImportRemoteKeys(ImportRemoteKeysRequest) returns (ImportRemoteKeysResponse) {
option (google.api.http) = {
post: "/internal/eth/v1/remotekeys",
body: "*"
};
}
// DeleteRemoteKeys removes web3signer public validator keys in the keymanager.
//
// HTTP response status codes:
// - 200: Successful response
// - 401: Unauthorized
// - 403: Forbidden from accessing the resource
// - 500: Validator internal error
rpc DeleteRemoteKeys(DeleteRemoteKeysRequest) returns (DeleteRemoteKeysResponse) {
option (google.api.http) = {
delete: "/internal/eth/v1/remotekeys",
body: "*"
};
}
// ListFeeRecipientByPubkey returns the hex encoded fee recipient address for the given pubkey.
//
// HTTP response status codes:
// - 200: Successful response
// - 401: Unauthorized
// - 403: Forbidden from accessing the resource
// - 500: Validator internal error
rpc ListFeeRecipientByPubkey(PubkeyRequest) returns (GetFeeRecipientByPubkeyResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/validator/{pubkey}/feerecipient"
};
}
// SetFeeRecipientByPubkey sets the fee recipient for the specific public key, overrides the existing one.
//
// HTTP response status codes:
// - 202: Successful response
// - 401: Unauthorized
// - 403: Forbidden from accessing the resource
// - 500: Validator internal error
rpc SetFeeRecipientByPubkey(SetFeeRecipientByPubkeyRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/validator/{pubkey}/feerecipient",
body: "*"
};
}
// DeleteFeeRecipientByPubkey deletes the current settings on the fee recipient and replaces with the default fallback fee recipient.
//
// HTTP response status codes:
// - 204: No Content
// - 401: Unauthorized
// - 403: Forbidden from accessing the resource
// - 500: Validator internal error
rpc DeleteFeeRecipientByPubkey(PubkeyRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/internal/eth/v1/validator/{pubkey}/feerecipient",
body: "*"
};
}
// GetGasLimit returns the execution gas limit for an individual validator.
//
// HTTP response status codes:
// - 400: Bad request
// - 401: Unauthorized
// - 403: Forbidden
// - 500: Validator internal error
rpc GetGasLimit(PubkeyRequest) returns (GetGasLimitResponse) {
option (google.api.http) = {
get: "/internal/eth/v1/validator/{pubkey}/gas_limit"
};
}
// SetGasLimit sets the gas limit for the specific public key, overrides the existing one.
//
// Spec page: https://ethereum.github.io/keymanager-APIs/#/Gas%20Limit/SetGasLimit
//
// HTTP response status codes:
// - 202: Successful response
// - 400: Bad request
// - 401: Unauthorized
// - 403: Forbidden from accessing the resource
// - 404: Path not found
// - 500: Validator internal error
rpc SetGasLimit(SetGasLimitRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/validator/{pubkey}/gas_limit",
body: "*"
};
}
// DeleteGasLimit deletes the gas limit for the specific public key.
//
// Spec page: https://ethereum.github.io/keymanager-APIs/#/Gas%20Limit/DeleteGasLimit
//
// HTTP response status codes:
// - 204: Successfully removed the gas limit or there was no gas limit set for the requested pubkey.
// - 400: Bad request, malformed request
// - 401: Unauthorized, no token is found.
// - 403: A gas limit was found but cannot be removed. This may be because the gas limit was in configuration files that cannot be updated.
// - 404: The key was not found on the server, nothing to delete.
// - 500: Validator internal error
rpc DeleteGasLimit(DeleteGasLimitRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/internal/eth/v1/validator/{pubkey}/gas_limit",
body: "*"
};
}
}
message ListKeystoresResponse {
message Keystore {
bytes validating_pubkey = 1;
string derivation_path = 2;
}
repeated Keystore data = 1;
}
message ImportKeystoresRequest {
repeated string keystores = 1;
repeated string passwords = 2;
string slashing_protection = 3;
}
message ImportKeystoresResponse {
repeated ImportedKeystoreStatus data = 1;
}
message DeleteKeystoresRequest {
repeated bytes pubkeys = 1;
}
message DeleteKeystoresResponse {
repeated DeletedKeystoreStatus data = 1;
string slashing_protection = 2;
}
message ImportedKeystoreStatus {
enum Status {
IMPORTED = 0;
DUPLICATE = 1;
ERROR = 2;
}
Status status = 1;
string message = 2;
}
message DeletedKeystoreStatus {
enum Status {
DELETED = 0;
NOT_FOUND = 1;
NOT_ACTIVE = 2;
ERROR = 3;
}
Status status = 1;
string message = 2;
}
message ListRemoteKeysResponse {
message Keystore {
bytes pubkey = 1;
string url = 2;
bool readonly = 3;
}
repeated Keystore data = 1;
}
message ImportRemoteKeysRequest {
message Keystore {
bytes pubkey = 1;
string url = 2;
}
repeated Keystore remote_keys = 1;
}
message ImportRemoteKeysResponse {
repeated ImportedRemoteKeysStatus data = 1;
}
message DeleteRemoteKeysRequest {
repeated bytes pubkeys = 1;
}
message DeleteRemoteKeysResponse {
repeated DeletedRemoteKeysStatus data = 1;
}
message ImportedRemoteKeysStatus {
enum Status {
UNKNOWN = 0;
IMPORTED = 1;
DUPLICATE = 2;
ERROR = 3;
}
Status status = 1;
string message = 2;
}
message DeletedRemoteKeysStatus {
enum Status {
NOT_FOUND = 0;
DELETED = 1;
ERROR = 3; // skips 2 to match Delete KeyStore status which has error = 3.
}
Status status = 1;
string message = 2;
}
message PubkeyRequest {
bytes pubkey = 1;
}
message GetFeeRecipientByPubkeyResponse {
message FeeRecipient {
bytes pubkey = 1;
bytes ethaddress = 2;
}
FeeRecipient data = 1;
}
message SetFeeRecipientByPubkeyRequest {
bytes pubkey = 1;
bytes ethaddress = 2;
}
message GetGasLimitResponse {
message GasLimit {
bytes pubkey = 1;
uint64 gas_limit = 2;
}
GasLimit data = 1;
}
message SetGasLimitRequest {
bytes pubkey = 1;
uint64 gas_limit = 2;
}
message DeleteGasLimitRequest {
bytes pubkey = 1;
}
// Copyright 2020 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.eth.service;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/empty.proto";
import "eth/v1/node.proto";
option csharp_namespace = "Ethereum.Eth.Service";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/service";
option java_multiple_files = true;
option java_outer_classname = "NodeServiceProto";
option java_package = "org.ethereum.eth.service";
option php_namespace = "Ethereum\\Eth\\Service";
// Beacon chain node API
//
// The beacon chain node API is a set of endpoints to query node information.
service BeaconNode {
// GetIdentity retrieves data about the node's network presence.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getNetworkIdentity
rpc GetIdentity(google.protobuf.Empty) returns (v1.IdentityResponse) {
option (google.api.http) = {get: "/internal/eth/v1/node/identity"};
}
// ListPeers retrieves data about the node's network peers.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getPeers
rpc ListPeers(v1.PeersRequest) returns (v1.PeersResponse) {
option (google.api.http) = {get: "/internal/eth/v1/node/peers"};
}
// GetPeer retrieves data about the given peer.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getPeer
rpc GetPeer(v1.PeerRequest) returns (v1.PeerResponse) {
option (google.api.http) = {get: "/internal/eth/v1/node/peers/{peer_id}"};
}
// PeerCount retrieves number of known peers.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getPeerCount
rpc PeerCount(google.protobuf.Empty) returns (v1.PeerCountResponse) {
option (google.api.http) = {get: "/internal/eth/v1/node/peer_count"};
}
// GetSyncStatus requests the beacon node to describe if it's currently syncing or not, and
// if it is, what block it is up to.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getSyncingStatus
rpc GetSyncStatus(google.protobuf.Empty) returns (v1.SyncingResponse) {
option (google.api.http) = {get: "/internal/eth/v1/node/syncing"};
}
// GetVersion requests that the beacon node identify information about its implementation in a
// format similar to a HTTP User-Agent field.
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getNodeVersion
rpc GetVersion(google.protobuf.Empty) returns (v1.VersionResponse) {
option (google.api.http) = {get: "/internal/eth/v1/node/version"};
}
// GetHealth returns node health status in http status codes. Useful for load balancers.
// Response Usage:
// "200":
// description: Node is ready
// "206":
// description: Node is syncing but can serve incomplete data
// "503":
// description: Node not initialized or having issues
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Node/getHealth
rpc GetHealth(google.protobuf.Empty) returns (google.protobuf.Empty) {
option (google.api.http) = {get: "/internal/eth/v1/node/health"};
}
}
// Copyright 2020 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.eth.service;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/empty.proto";
import "eth/v1/validator.proto";
import "eth/v2/ssz.proto";
import "eth/v2/validator.proto";
option csharp_namespace = "Ethereum.Eth.Service";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/service";
option java_multiple_files = true;
option java_outer_classname = "ValidatorServiceProto";
option java_package = "org.ethereum.eth.service";
option php_namespace = "Ethereum\\Eth\\Service";
// Beacon chain validator API
//
// The beacon chain validator API is a set of endpoints to be used by validators for performing their roles.
//
// This service is defined in the upstream Ethereum consensus APIs repository (beacon-apis/apis/validator).
service BeaconValidator {
// GetAttesterDuties requests the beacon node to provide a set of attestation duties, which should be performed
// by validators, for a particular epoch.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid epoch or index
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/getAttesterDuties
rpc GetAttesterDuties(v1.AttesterDutiesRequest) returns (v1.AttesterDutiesResponse) {
option (google.api.http) = {
post: "/internal/eth/v1/validator/duties/attester/{epoch}"
body: "*"
};
}
// GetProposerDuties requests beacon node to provide all validators that are scheduled to
// propose a block in the given epoch.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid epoch
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/getProposerDuties
rpc GetProposerDuties(v1.ProposerDutiesRequest) returns (v1.ProposerDutiesResponse) {
option (google.api.http) = { get: "/internal/eth/v1/validator/duties/proposer/{epoch}" };
}
// GetSyncCommitteeDuties requests the beacon node to provide a set of sync committee duties for a particular epoch.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid epoch or index
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/getSyncCommitteeDuties
rpc GetSyncCommitteeDuties(v2.SyncCommitteeDutiesRequest) returns (v2.SyncCommitteeDutiesResponse) {
option (google.api.http) = {
post: "/internal/eth/v1/validator/duties/sync/{epoch}"
body: "*"
};
}
// ProduceBlockV2 requests the beacon node to produce a valid unsigned beacon block,
// which can then be signed by a proposer and submitted.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid block production request
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/produceBlockV2
rpc ProduceBlockV2(v1.ProduceBlockRequest) returns (v2.ProduceBlockResponseV2) {
option (google.api.http) = { get: "/internal/eth/v2/validator/blocks/{slot}" };
}
// ProduceBlockV2 requests the beacon node to produce a valid unsigned beacon block,
// which can then be signed by a proposer and submitted.
//
// The produced block is in SSZ form.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid block production request
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/produceBlockV2
rpc ProduceBlockV2SSZ(v1.ProduceBlockRequest) returns (v2.SSZContainer) {
option (google.api.http) = { get: "/internal/eth/v2/validator/blocks/{slot}/ssz" };
}
// ProduceBlindedBlock requests the beacon node to produce a valid unsigned blinded beacon block,
// which can then be signed by a proposer and submitted.
//
// Metadata in the response indicates the type of block produced, and the supported types of block
// will be added to as forks progress.
//
// Pre-Bellatrix, this endpoint will return a regular block.
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid block production request
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/produceBlindedBlock
rpc ProduceBlindedBlock(v1.ProduceBlockRequest) returns (v2.ProduceBlindedBlockResponse) {
option (google.api.http) = { get: "/internal/eth/v1/validator/blinded_blocks/{slot}" };
}
// ProduceBlindedBlock requests the beacon node to produce a valid unsigned blinded beacon block,
// which can then be signed by a proposer and submitted.
//
// The produced block is in SSZ form.
//
// Metadata in the response indicates the type of block produced, and the supported types of block
// will be added to as forks progress.
//
// Pre-Bellatrix, this endpoint will return a regular block.
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid block production request
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/produceBlindedBlock
rpc ProduceBlindedBlockSSZ(v1.ProduceBlockRequest) returns (v2.SSZContainer) {
option (google.api.http) = { get: "/internal/eth/v1/validator/blinded_blocks/{slot}/ssz" };
}
// PrepareBeaconProposer submits fee recipient information to be used when preparing block
// proposal execution payloads.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid block production request
// - 500: Beacon node internal error
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/prepareBeaconProposer
rpc PrepareBeaconProposer(v1.PrepareBeaconProposerRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/validator/prepare_beacon_proposer"
body: "*"
};
}
// SubmitValidatorRegistration prepares the beacon node for engaging with external builders.
// The information will be sent by the beacon node to the builder network.
// It is expected that the validator client will send this information periodically to ensure the beacon node has correct and timely registration information to provide to builders.
// The validator client should not sign blinded beacon blocks that do not adhere to their latest fee recipient and gas limit preferences.
// Note that requests containing currently inactive or unknown validator pubkeys will be accepted, as they may become active at a later epoch.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid request syntax
// - 500: Beacon node internal error
//
// Spec: https://ethereum.github.io/beacon-APIs/#/Validator/registerValidator
rpc SubmitValidatorRegistration (v1.SubmitValidatorRegistrationsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/validator/register_validator"
body: "*"
};
}
// ProduceAttestationData requests that the beacon node produces attestation data for
// the requested committee index and slot based on the nodes current head.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid request syntax
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/produceAttestationData
rpc ProduceAttestationData(v1.ProduceAttestationDataRequest) returns (v1.ProduceAttestationDataResponse) {
option (google.api.http) = { get: "/internal/eth/v1/validator/attestation_data" };
}
// GetAggregateAttestation aggregates all attestations matching the given attestation data root and slot,
// returning the aggregated result.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid request syntax
// - 500: Beacon node internal error
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/getAggregatedAttestation
rpc GetAggregateAttestation(v1.AggregateAttestationRequest) returns (v1.AggregateAttestationResponse) {
option (google.api.http) = { get: "/internal/eth/v1/validator/aggregate_attestation" };
}
// SubmitAggregateAndProofs verifies given aggregate and proofs and publishes them on appropriate gossipsub topic.
//
// Response usage:
// - 200: Successful response
// - 400: Invalid request syntax
// - 500: Beacon node internal error
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/publishAggregateAndProofs
rpc SubmitAggregateAndProofs(v1.SubmitAggregateAndProofsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/validator/aggregate_and_proofs"
body: "*"
};
}
// SubmitBeaconCommitteeSubscription searches using discv5 for peers related to
// the provided subnet information and replaces current peers with those ones if necessary.
//
// If validator is_aggregator, beacon node must:
// - announce subnet topic subscription on gossipsub.
// - aggregate attestations received on that subnet.
//
// Response usage:
// - 200: Slot signature is valid and beacon node has prepared the attestation subnet
// Note that we cannot be certain Beacon node will find peers for that subnet for various reasons
// - 400: Invalid request syntax
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/prepareBeaconCommitteeSubnet
rpc SubmitBeaconCommitteeSubscription(v1.SubmitBeaconCommitteeSubscriptionsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/validator/beacon_committee_subscriptions"
body: "*"
};
}
// SubmitSyncCommitteeSubscription subscribes to a number of sync committee subnets
//
// Response usage:
// - 200: Successful response
// - 400: Invalid request syntax
// - 500: Beacon node internal error
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/prepareSyncCommitteeSubnets
rpc SubmitSyncCommitteeSubscription(v2.SubmitSyncCommitteeSubscriptionsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/validator/sync_committee_subscriptions"
body: "*"
};
}
// ProduceSyncCommitteeContribution requests that the beacon node produces a sync committee contribution.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid request syntax
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/produceSyncCommitteeContribution
rpc ProduceSyncCommitteeContribution(v2.ProduceSyncCommitteeContributionRequest) returns (v2.ProduceSyncCommitteeContributionResponse) {
option (google.api.http) = { get: "/internal/eth/v1/validator/sync_committee_contribution" };
}
// SubmitContributionAndProofs publishes multiple signed sync committee contribution and proofs.
//
// Response usage:
// - 200: Successful response
// - 400: Invalid request syntax
// - 500: Beacon node internal error
//
// Spec: https://ethereum.github.io/beacon-APIs/?urls.primaryName=v2.3.0#/Validator/publishContributionAndProofs
rpc SubmitContributionAndProofs(v2.SubmitContributionAndProofsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/internal/eth/v1/validator/contribution_and_proofs"
body: "*"
};
}
}
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_proto_library")
proto_library(
name = "proto",
srcs = [
"attestation.proto",
"beacon_block.proto",
"beacon_chain_service.proto",
"beacon_debug_service.proto",
"beacon_state.proto",
"node.proto",
"events.proto",
"validator.proto",
"validator_service.proto",
],
visibility = ["//visibility:public"],
deps = [
"//eth/ext:proto",
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:timestamp_proto",
"@go_googleapis//google/api:annotations_proto",
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:event_source_proto",
],
)
##############################################################################
# Go
##############################################################################
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("//tools:ssz.bzl", "SSZ_DEPS", "ssz_gen_marshal")
ssz_gen_marshal(
name = "ssz_generated_files",
go_proto = ":go_proto",
includes = [
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
],
objs = [
"AggregateAttestationAndProof",
"Attestation",
"AttestationData",
"AttesterSlashing",
"BeaconBlock",
"BeaconBlockV1",
"BeaconBlockHeader",
"BeaconBlockBodyV1",
"Checkpoint",
"Deposit",
"DepositData",
"Eth1Data",
"IndexedAttestation",
"ProposerSlashing",
"SignedAggregateAttestationAndProof",
"SignedBeaconBlock",
"SignedBeaconBlockV1",
"SignedBeaconBlockHeader",
"SignedVoluntaryExit",
"Validator",
"VoluntaryExit",
],
)
go_proto_library(
name = "go_proto",
compilers = [
"@com_github_prysmaticlabs_protoc_gen_go_cast//:go_cast_grpc",
],
importpath = "github.com/prysmaticlabs/ethereumapis/eth/v1",
proto = ":proto",
visibility = ["//visibility:public"],
deps = [
"//eth/ext:go_default_library",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@com_github_golang_protobuf//proto:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library", # keep
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
"@org_golang_google_protobuf//types/descriptorpb:go_default_library",
"@org_golang_google_protobuf//types/known/timestamppb:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:event_source_go_proto",
],
)
go_proto_library(
name = "go_grpc_gateway_library",
compilers = [
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway",
],
embed = [":go_proto"],
importpath = "github.com/prysmaticlabs/ethereumapis/eth/v1",
protos = [":proto"],
visibility = ["//visibility:private"],
deps = [
"//eth/ext:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:event_source_go_proto",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
],
)
go_library(
name = "go_default_library",
srcs = [
":ssz_generated_files", # keep
],
embed = [
":go_grpc_gateway_library",
],
importpath = "github.com/prysmaticlabs/ethereumapis/eth/v1",
visibility = ["//visibility:public"],
deps = SSZ_DEPS + [
"//eth/ext:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//utilities:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//grpclog:go_default_library",
"@org_golang_google_grpc//metadata:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@com_github_golang_protobuf//proto:go_default_library",
"@io_bazel_rules_go//proto/wkt:struct_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library", # keep
"@go_googleapis//google/api:annotations_go_proto",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
], # keep
)
##############################################################################
# Java
##############################################################################
java_proto_library(
name = "java_proto",
deps = [":proto"],
)
# gRPC Gateway
This package is contains generated files for applications that wish to use eth/v1alpha as a
[gRPC gateway](https://github.com/grpc-ecosystem/grpc-gateway).
\ No newline at end of file
// Copyright 2020 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.eth.v1;
import "google/protobuf/descriptor.proto";
import "eth/ext/options.proto";
option csharp_namespace = "Ethereum.Eth.V1";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v1";
option java_multiple_files = true;
option java_outer_classname = "AttestationProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
message Attestation {
// A bitfield representation of validator indices that have voted exactly
// the same vote and have been aggregated into this attestation.
bytes aggregation_bits = 1 [(ethereum.eth.ext.ssz_max) = "2048", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitlist"];
AttestationData data = 2;
// 96 byte BLS aggregate signature.
bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"];
}
message AggregateAttestationAndProof {
// The aggregator index that submitted this aggregated attestation and proof.
uint64 aggregator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// The aggregated attestation that was submitted.
Attestation aggregate = 3;
// 96 byte selection proof signed by the aggregator, which is the signature of the slot to aggregate.
bytes selection_proof = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message SignedAggregateAttestationAndProof {
// The aggregated attestation and selection proof itself.
AggregateAttestationAndProof message = 1;
// 96 byte BLS aggregate signature signed by the aggregator over the message.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message AttestationData {
// Attestation data includes information on Casper the Friendly Finality Gadget's votes
// See: https://arxiv.org/pdf/1710.09437.pdf
// Slot of the attestation attesting for.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// The committee index that submitted this attestation.
uint64 index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.CommitteeIndex"];
// 32 byte root of the LMD GHOST block vote.
bytes beacon_block_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// The most recent justified checkpoint in the beacon state
Checkpoint source = 4;
// The checkpoint attempting to be justified for the current epoch and its epoch boundary block
Checkpoint target = 5;
}
message Checkpoint {
// A checkpoint is every epoch's first slot. The goal of Casper FFG
// is to link the check points together for justification and finalization.
// Epoch the checkpoint references.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Block root of the checkpoint references.
bytes root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
}
// Copyright 2021 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.eth.v1;
import "google/protobuf/descriptor.proto";
import "eth/ext/options.proto";
import "eth/v1/attestation.proto";
option csharp_namespace = "Ethereum.Eth.V1";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v1";
option java_multiple_files = true;
option java_outer_classname = "BeaconBlockProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
// The Ethereum consensus beacon block. The message does not contain a validator signature.
message BeaconBlock {
// Beacon chain slot that this block represents.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// Validator index of the validator that proposed the block header.
uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// 32 byte root of the parent block.
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// 32 byte root of the resulting state after processing this block.
bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
// The block body itself.
BeaconBlockBody body = 5;
}
// The signed version of beacon block.
message SignedBeaconBlock {
// The unsigned beacon block itself.
BeaconBlock block = 1;
// 96 byte BLS signature from the validator that produced this block.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
// The block body of an Ethereum consensus beacon block.
message BeaconBlockBody {
// The validators RANDAO reveal 96 byte value.
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
// A reference to the Ethereum 1.x chain.
Eth1Data eth1_data = 2;
// 32 byte field of arbitrary data. This field may contain any data and
// is not used for anything other than a fun message.
bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// Block operations
// Refer to spec constants at https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#max-operations-per-block
// At most MAX_PROPOSER_SLASHINGS.
repeated ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_ATTESTER_SLASHINGS.
repeated AttesterSlashing attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "2"];
// At most MAX_ATTESTATIONS.
repeated Attestation attestations = 6 [(ethereum.eth.ext.ssz_max) = "128"];
// At most MAX_DEPOSITS.
repeated Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_VOLUNTARY_EXITS.
repeated SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"];
}
// Proposer slashings are proofs that a slashable offense has been committed by
// proposing two conflicting blocks from the same validator.
message ProposerSlashing {
// First conflicting signed block header.
SignedBeaconBlockHeader signed_header_1 = 2;
// Second conflicting signed block header.
SignedBeaconBlockHeader signed_header_2 = 3;
}
// Attestor slashings are proofs that a slashable offense has been committed by
// attesting to two conflicting pieces of information by the same validator.
message AttesterSlashing {
// First conflicting attestation.
IndexedAttestation attestation_1 = 1;
// Second conflicting attestation.
IndexedAttestation attestation_2 = 2;
}
// Deposit into the Ethereum consensus from the Ethereum 1.x deposit contract.
message Deposit {
message Data {
// 48 byte BLS public key of the validator.
bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey"];
// A 32 byte hash of the withdrawal address public key.
bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// Deposit amount in gwei.
uint64 amount = 3;
// 96 byte signature from the validators public key.
bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"];
}
// 32 byte roots in the deposit tree branch.
repeated bytes proof = 1 [(ethereum.eth.ext.ssz_size) = "33,32"];
Data data = 2;
}
// A message that represents a validator signaling that they want to voluntarily
// withdraw from the active validator set. The message does not contain a
// validator signature.
message VoluntaryExit {
// The epoch on when exit request becomes valid.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Index of the exiting validator.
uint64 validator_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
}
// The signed version of voluntary exit.
message SignedVoluntaryExit {
// The unsigned voluntary exit itself.
VoluntaryExit message = 1;
// Validator's 96 byte signature
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
// Eth1Data represents references to the Ethereum 1.x deposit contract.
message Eth1Data {
// The 32 byte deposit tree root for the last deposit included in this
// block.
bytes deposit_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
// The total number of deposits included in the beacon chain since genesis
// including the deposits in this block.
uint64 deposit_count = 2;
// The 32 byte block hash of the Ethereum 1.x block considered for deposit
// inclusion.
bytes block_hash = 3 [(ethereum.eth.ext.ssz_size) = "32"];
}
// A beacon block header is essentially a beacon block with only a reference to
// the beacon body as a 32 byte merkle tree root. This type of message is more
// lightweight than a full beacon block. The message does not contain
// a validator signature.
message BeaconBlockHeader {
// Beacon chain slot that this block represents.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// Validator index of the validator that proposed the block header.
uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// 32 byte merkle tree root of the parent ssz encoded block.
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// 32 byte merkle tree root of the resulting ssz encoded state after processing this block.
bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
// 32 byte merkle tree root of the ssz encoded block body.
bytes body_root = 5 [(ethereum.eth.ext.ssz_size) = "32"];
}
message SignedBeaconBlockHeader {
// The unsigned beacon block header itself.
BeaconBlockHeader message = 1;
// 96 byte BLS signature from the validator that produced this block header.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message IndexedAttestation {
repeated uint64 attesting_indices = 1 [(ethereum.eth.ext.ssz_max) = "2048"];
AttestationData data = 2;
// 96 bytes aggregate signature.
bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"];
}
// The sync aggregate object for the beacon chain to track sync committee votes and to
// support light client infra.
message SyncAggregate {
// Sync committee bits as Bitvector to track votes.
bytes sync_committee_bits = 1 [(ethereum.eth.ext.ssz_size) = "sync_committee_bytes.size", (ethereum.eth.ext.cast_type) = "sync_committee_bits.type"];
// BLS aggregated signature of the sync committee for the ones that voted.
bytes sync_committee_signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
// Copyright 2021 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.eth.v1;
import "google/protobuf/descriptor.proto";
import "google/protobuf/timestamp.proto";
import "eth/ext/options.proto";
import "eth/v1/attestation.proto";
import "eth/v1/beacon_block.proto";
import "eth/v1/beacon_state.proto";
import "eth/v1/validator.proto";
option csharp_namespace = "Ethereum.Eth.V1";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v1";
option java_multiple_files = true;
option java_outer_classname = "BeaconChainProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
// Beacon State API related messages.
message GenesisResponse {
Genesis data = 1;
message Genesis {
// UTC time specified in the chain start event in the deposit contract.
google.protobuf.Timestamp genesis_time = 1;
// 32 byte hash tree root of the genesis validator set.
bytes genesis_validators_root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// 4 byte genesis fork version.
bytes genesis_fork_version = 3 [(ethereum.eth.ext.ssz_size) = "4"];
}
}
message StateRequest {
// The state id which can be any of: "head" (canonical head in node's view),
// "genesis", "finalized", "justified", <slot>, <hex encoded stateRoot with 0x prefix>.
bytes state_id = 1;
}
message StateRootResponse {
StateRoot data = 1;
bool execution_optimistic = 2;
message StateRoot {
// SSZ encoded state root for the requested state.
bytes root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
}
}
message StateForkResponse {
Fork data = 1;
bool execution_optimistic = 2;
}
message StateFinalityCheckpointResponse {
StateFinalityCheckpoint data = 1;
bool execution_optimistic = 2;
message StateFinalityCheckpoint {
ethereum.eth.v1.Checkpoint previous_justified = 1;
ethereum.eth.v1.Checkpoint current_justified = 2;
ethereum.eth.v1.Checkpoint finalized = 3;
}
}
message StateValidatorsRequest {
// The state id which can be any of: "head" (canonical head in node's view),
// "genesis", "finalized", "justified", <slot>, <hex encoded stateRoot with 0x prefix>.
bytes state_id = 1;
// An array of either hex encoded public keys (with 0x prefix) or validator indexes.
repeated bytes id = 2;
// The status to query validators for, can be one of: pending_initialized, pending_queued, active_ongoing,
// active_exiting, active_slashed, exited_unslashed, exited_slashed, withdrawal_possible,
// withdrawal_done, active, pending, exited, withdrawal
repeated ValidatorStatus status = 3;
}
message ValidatorBalancesRequest {
// The state id which can be any of: "head" (canonical head in node's view),
// "genesis", "finalized", "justified", <slot>, <hex encoded stateRoot with 0x prefix>.
bytes state_id = 1;
// An array of either hex encoded public keys (with 0x prefix) or validator indexes.
repeated bytes id = 2;
}
message StateValidatorsResponse {
repeated ValidatorContainer data = 1;
bool execution_optimistic = 2;
}
message ValidatorBalancesResponse {
repeated ValidatorBalance data = 1;
bool execution_optimistic = 2;
}
message ValidatorBalance {
// The index of the validator the retrieved balance is for.
uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// The balance of the requested validator.
uint64 balance = 2;
}
message StateValidatorRequest {
// The state id which can be any of: "head" (canonical head in node's view),
// "genesis", "finalized", "justified", <slot>, <hex encoded stateRoot with 0x prefix>.
bytes state_id = 1;
// The public key or index for the validator to retrieve information for.
bytes validator_id = 2;
}
message StateValidatorResponse {
ValidatorContainer data = 1;
bool execution_optimistic = 2;
}
message StateCommitteesRequest {
// The state id which can be any of: "head" (canonical head in node's view),
// "genesis", "finalized", "justified", <slot>, <hex encoded stateRoot with 0x prefix>.
bytes state_id = 1;
// The epoch to retrieve the committees of.
optional uint64 epoch = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Committee index requested.
optional uint64 index = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.CommitteeIndex"];
// Committee slot requested.
optional uint64 slot = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
}
message StateCommitteesResponse {
repeated Committee data = 1;
bool execution_optimistic = 2;
}
// Beacon Block API related messages.
message BlockAttestationsResponse {
repeated ethereum.eth.v1.Attestation data = 1;
bool execution_optimistic = 2;
}
message BlockRootContainer {
// 32 byte merkle tree root of the ssz encoded block.
bytes root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
}
message BlockRootResponse {
BlockRootContainer data = 1;
bool execution_optimistic = 2;
}
message BlockHeadersRequest {
// Beacon chain slot of the requested block.
optional uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// 32 byte merkle tree root of the ssz encoded parent block.
optional bytes parent_root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
}
message BlockHeadersResponse {
repeated BlockHeaderContainer data = 1;
bool execution_optimistic = 2;
}
message BlockRequest {
// The block identifier. Can be one of: "head" (canonical head in node's view), "genesis",
// "finalized", <slot>, <hex encoded blockRoot with 0x prefix>.
bytes block_id = 1;
}
message BlockHeaderResponse {
BlockHeaderContainer data = 1;
bool execution_optimistic = 2;
}
message BlockHeaderContainer {
// 32 byte merkle tree root of the ssz encoded block.
bytes root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
// Boolean indicating whether the block is canonical.
bool canonical = 2;
// Container for a signed beacon block header.
BeaconBlockHeaderContainer header = 3;
}
message BeaconBlockHeaderContainer {
// The unsigned beacon block header.
BeaconBlockHeader message = 1;
// 96 byte BLS signature from the validator that produced this block header.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message BlockResponse {
BeaconBlockContainer data = 1;
}
message BlockSSZResponse {
bytes data = 1;
}
message BeaconBlockContainer {
BeaconBlock message = 1;
// 96 byte BLS signature from the validator that produced this block.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
// Beacon Pool related API service.
message AttestationsPoolRequest {
optional uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
optional uint64 committee_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.CommitteeIndex"];
}
message SubmitAttestationsRequest {
repeated ethereum.eth.v1.Attestation data = 1;
}
message AttestationsPoolResponse {
repeated ethereum.eth.v1.Attestation data = 1;
}
message AttesterSlashingsPoolResponse {
repeated AttesterSlashing data = 1;
}
message ProposerSlashingPoolResponse {
repeated ProposerSlashing data = 1;
}
message VoluntaryExitsPoolResponse {
repeated SignedVoluntaryExit data = 1;
}
// Beacon Config API related messages.
message ForkScheduleResponse {
// The fork data used for beacon chain versioning.
repeated Fork data = 1;
}
// Spec response is a generic flat map of key values.
// Values are returned with following format:
// - any value starting with 0x in the spec is returned as a hex string
// - all other values are returned as string-number
message SpecResponse {
map<string, string> data = 1;
}
message DepositContractResponse {
DepositContract data = 1;
}
message DepositContract {
// The chain_id of the network.
uint64 chain_id = 1;
// The address of the deployed deposit contract in use.
string address = 2;
}
message WeakSubjectivityResponse {
WeakSubjectivityData data = 1;
}
message WeakSubjectivityData {
ethereum.eth.v1.Checkpoint ws_checkpoint = 1;
bytes state_root = 2;
}
message ForkChoiceResponse {
// Latest justified checkpoint in forkchoice store.
Checkpoint justified_checkpoint = 1;
// Latest finalized checkpoint in forkchoice store.
Checkpoint finalized_checkpoint = 2;
// Best justified checkpoint in forkchoice store.
Checkpoint best_justified_checkpoint = 3;
// Unrealized justified checkpoint in forkchoice store.
Checkpoint unrealized_justified_checkpoint = 4;
// Unrealized finalized checkpoint in forkchoice store.
Checkpoint unrealized_finalized_checkpoint = 5;
// Proposer Boost Root in forkchoice store.
bytes proposer_boost_root = 6 [(ethereum.eth.ext.ssz_size) = "32"];
// Previous proposer Boost Root in forkchoice store.
bytes previous_proposer_boost_root = 7 [(ethereum.eth.ext.ssz_size) = "32"];
// Head root in forkchoice store.
bytes head_root = 8 [(ethereum.eth.ext.ssz_size) = "32"];
// The list of the forkchoice nodes in store.
repeated ForkChoiceNode forkchoice_nodes = 9;
}
message ForkChoiceNode {
// Slot of the forkchoice node.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// Root of the forkchoice node.
bytes root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// Parent root of the forkchoice node.
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// Justified epoch of the current forkchoice node.
uint64 justified_epoch = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// finalized epoch of the current forkchoice node.
uint64 finalized_epoch = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Unrealized justified epoch of the current forkchoice node.
uint64 unrealized_justified_epoch = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Unrealized finalized epoch of the current forkchoice node.
uint64 unrealized_finalized_epoch = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Current balance of the current forkchoice node.
uint64 balance = 8;
// Current weight of the current forkchoice node.
uint64 weight = 9;
// Optimistic status of the current forkchoice node.
bool execution_optimistic = 10;
// Execution payload block hash of the current forkchoice node.
bytes execution_payload = 11 [(ethereum.eth.ext.ssz_size) = "32"];
// Timestamp when the node was inserted
uint64 timestamp = 12;
}
// Copyright 2020 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.eth.v1;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/empty.proto";
import "eth/v1/beacon_block.proto";
import "eth/v1/beacon_chain.proto";
option csharp_namespace = "Ethereum.Eth.V1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1";
option java_multiple_files = true;
option java_outer_classname = "BeaconChainServiceProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
// Beacon Chain API
//
// The config API endpoints can be used to query the beacon chain state and information. Such as spec, current fork,
// blocks, and the validator spec.
//
// This service is defined in the upstream Ethereum consensus APIs repository (eth2.0-APIs/apis/).
service BeaconChain {
// Beacon state API related endpoints.
// GetGenesis retrieves details of the chain's genesis which can be used to identify chain.
rpc GetGenesis(google.protobuf.Empty) returns (GenesisResponse) {
option (google.api.http) = { get: "/eth/v1/beacon/genesis" };
}
// GetStateRoot calculates HashTreeRoot for state with given 'stateId'. If stateId is root, same value will be returned.
rpc GetStateRoot(StateRequest) returns (StateRootResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/states/{state_id}/root"
};
}
// GetStateFork returns Fork object for state with given 'stateId'.
rpc GetStateFork(StateRequest) returns (StateForkResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/states/{state_id}/fork"
};
}
// GetFinalityCheckpoints returns finality checkpoints for state with given 'stateId'. In case finality is
// not yet achieved, checkpoint should return epoch 0 and ZERO_HASH as root.
rpc GetFinalityCheckpoints(StateRequest) returns (StateFinalityCheckpointResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/states/{state_id}/finality_checkpoints"
};
}
// ListValidators returns a filterable list of validators with their balance, status and index.
rpc ListValidators(StateValidatorsRequest) returns (StateValidatorsResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/states/{state_id}/validators"
};
}
// GetValidator returns a validator specified by state and id or public key along with status and balance.
rpc GetValidator(StateValidatorRequest) returns (StateValidatorResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/states/{state_id}/validators/{validator_id}"
};
}
// ListValidators returns a filterable list of validator balances.
rpc ListValidatorBalances(ValidatorBalancesRequest) returns (ValidatorBalancesResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/states/{state_id}/validator_balances"
};
}
// ListCommittees retrieves the committees for the given state at the given epoch.
rpc ListCommittees(StateCommitteesRequest) returns (StateCommitteesResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/states/{state_id}/committees"
};
}
// Beacon blocks API related endpoints.
// ListBlockHeaders retrieves block headers matching given query. By default it will fetch current head slot blocks.
rpc ListBlockHeaders(BlockHeadersRequest) returns (BlockHeadersResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/headers"
};
}
// GetBlockHeader retrieves block header for given block id.
rpc GetBlockHeader(BlockRequest) returns (BlockHeaderResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/headers/{block_id}"
};
}
// SubmitBlock instructs the beacon node to broadcast a newly signed beacon block to the beacon network, to be
// included in the beacon chain. The beacon node is not required to validate the signed BeaconBlock, and a successful
// response (20X) only indicates that the broadcast has been successful. The beacon node is expected to integrate the
// new block into its state, and therefore validate the block internally, however blocks which fail the validation are
// still broadcast but a different status code is returned (202).
rpc SubmitBlock(BeaconBlockContainer) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/eth/v1/beacon/blocks"
body: "*"
};
}
// GetBlockRoot retrieves hashTreeRoot of BeaconBlock/BeaconBlockHeader.
rpc GetBlockRoot(BlockRequest) returns (BlockRootResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/blocks/{block_id}/root"
};
}
// GetBlock retrieves block details for given block id.
rpc GetBlock(BlockRequest) returns (BlockResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/blocks/{block_id}"
};
}
// GetBlockSSZ returns the SSZ-serialized version of block details for given block id.
rpc GetBlockSSZ(BlockRequest) returns (BlockSSZResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/blocks/{block_id}/ssz"
};
}
// ListBlockAttestations retrieves attestation included in requested block.
rpc ListBlockAttestations(BlockRequest) returns (BlockAttestationsResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/blocks/{block_id}/attestations"
};
}
// Beacon pools API related endpoints.
// ListPoolAttestations retrieves attestations known by the node but
// not necessarily incorporated into any block.
rpc ListPoolAttestations(AttestationsPoolRequest) returns (AttestationsPoolResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/pool/attestations"
};
}
// SubmitAttestations submits Attestation objects to node. If attestation passes all validation
// constraints, node MUST publish attestation on appropriate subnet.
rpc SubmitAttestations(SubmitAttestationsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/eth/v1/beacon/pool/attestations"
body: "*"
};
}
// ListPoolAttesterSlashings retrieves attester slashings known by the node but
// not necessarily incorporated into any block.
rpc ListPoolAttesterSlashings(google.protobuf.Empty) returns (AttesterSlashingsPoolResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/pool/attester_slashings"
};
}
// SubmitAttesterSlashing submits AttesterSlashing object to node's pool and
// if passes validation node MUST broadcast it to network.
rpc SubmitAttesterSlashing(AttesterSlashing) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/eth/v1/beacon/pool/attester_slashings"
body: "*"
};
}
// ListPoolProposerSlashings retrieves proposer slashings known by the node
// but not necessarily incorporated into any block.
rpc ListPoolProposerSlashings(google.protobuf.Empty) returns (ProposerSlashingPoolResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/pool/proposer_slashings"
};
}
// SubmitProposerSlashing submits AttesterSlashing object to node's pool and if
// passes validation node MUST broadcast it to network.
rpc SubmitProposerSlashing(ProposerSlashing) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/eth/v1/beacon/pool/proposer_slashings"
body: "*"
};
}
// ListPoolVoluntaryExits retrieves voluntary exits known by the node but
// not necessarily incorporated into any block.
rpc ListPoolVoluntaryExits(google.protobuf.Empty) returns (VoluntaryExitsPoolResponse) {
option (google.api.http) = {
get: "/eth/v1/beacon/pool/voluntary_exits"
};
}
// SubmitVoluntaryExit submits SignedVoluntaryExit object to node's pool
// and if passes validation node MUST broadcast it to network.
rpc SubmitVoluntaryExit(SignedVoluntaryExit) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/eth/v1/beacon/pool/voluntary_exits"
body: "*"
};
}
// Beacon config API related endpoints.
// GetForkSchedule retrieve all scheduled upcoming forks this node is aware of.
rpc GetForkSchedule(google.protobuf.Empty) returns (ForkScheduleResponse) {
option (google.api.http) = {get: "/eth/v1/config/fork_schedule"};
}
// Spec retrieves specification configuration (without Phase 1 params) used on this node. Specification params list
// Values are returned with following format:
// - any value starting with 0x in the spec is returned as a hex string
// - all other values are returned as number
rpc GetSpec(google.protobuf.Empty) returns (SpecResponse) {
option (google.api.http) = {get: "/eth/v1/config/spec"};
}
// GetDepositContract retrieves deposit contract address and genesis fork version.
rpc GetDepositContract(google.protobuf.Empty) returns (DepositContractResponse) {
option (google.api.http) = {get: "/eth/v1/config/deposit_contract"};
}
}
// Copyright 2020 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.eth.v1;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/empty.proto";
import "eth/v1/beacon_chain.proto";
import "eth/v1/beacon_state.proto";
option csharp_namespace = "Ethereum.Eth.V1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1";
option java_multiple_files = true;
option java_outer_classname = "BeaconDebugServiceProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
// Beacon chain debug API
//
// The beacon chain debug API is a set of endpoints to debug chain and shouldn't be exposed publicly.
//
// This service is defined in the upstream Ethereum consensus APIs repository (eth2.0-APIs/apis/debug).
service BeaconDebug {
// GetBeaconState returns full BeaconState object for given stateId.
rpc GetBeaconState(StateRequest) returns (BeaconStateResponse) {
option (google.api.http) = {
get: "/eth/v1/debug/beacon/states/{state_id}"
};
}
// GetBeaconStateSSZ returns the SSZ-serialized version of the full BeaconState object for given stateId.
rpc GetBeaconStateSSZ(StateRequest) returns (BeaconStateSSZResponse) {
option (google.api.http) = {
get: "/eth/v1/debug/beacon/states/{state_id}/ssz"
};
}
// ListForkChoiceHeads retrieves all possible chain heads (leaves of fork choice tree).
rpc ListForkChoiceHeads(google.protobuf.Empty) returns (ForkChoiceHeadsResponse) {
option (google.api.http) = {
get: "/eth/v1/debug/beacon/heads"
};
}
}
\ No newline at end of file
// Copyright 2020 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.eth.v1;
import "google/protobuf/descriptor.proto";
import "eth/ext/options.proto";
import "eth/v1/attestation.proto";
import "eth/v1/beacon_block.proto";
import "eth/v1/validator.proto";
option csharp_namespace = "Ethereum.Eth.V1";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v1";
option java_multiple_files = true;
option java_outer_classname = "BeaconStateProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
message BeaconState {
// Versioning [1001-2000]
uint64 genesis_time = 1001;
bytes genesis_validators_root = 1002 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 slot = 1003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
Fork fork = 1004;
// History [2001-3000]
BeaconBlockHeader latest_block_header = 2001;
repeated bytes block_roots = 2002 [(ethereum.eth.ext.ssz_size) = "block_roots.size"];
repeated bytes state_roots = 2003 [(ethereum.eth.ext.ssz_size) = "state_roots.size"];
repeated bytes historical_roots = 2004 [(ethereum.eth.ext.ssz_size) = "?,32", (ethereum.eth.ext.ssz_max) = "16777216"];
// Eth1 [3001-4000]
Eth1Data eth1_data = 3001;
repeated Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"];
uint64 eth1_deposit_index = 3003;
// Registry [4001-5000]
repeated Validator validators = 4001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
repeated uint64 balances = 4002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
// Randomness [5001-6000]
repeated bytes randao_mixes = 5001 [(ethereum.eth.ext.ssz_size) = "randao_mixes.size"];
// Slashings [6001-7000]
repeated uint64 slashings = 6001 [(ethereum.eth.ext.ssz_size) = "slashings.size"];
// Attestations [7001-8000]
repeated PendingAttestation previous_epoch_attestations = 7001 [(ethereum.eth.ext.ssz_max) = "previous_epoch_attestations.max"];
repeated PendingAttestation current_epoch_attestations = 7002 [(ethereum.eth.ext.ssz_max) = "current_epoch_attestations.max"];
// Finality [8001-9000]
// Spec type [4]Bitvector which means this would be a fixed size of 4 bits.
bytes justification_bits = 8001 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"];
Checkpoint previous_justified_checkpoint = 8002;
Checkpoint current_justified_checkpoint = 8003;
Checkpoint finalized_checkpoint = 8004;
}
message PendingAttestation {
// Bitfield representation of validator indices that have voted exactly
// the same vote and have been aggregated into this attestation.
bytes aggregation_bits = 1 [(ethereum.eth.ext.ssz_max) = "2048", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitlist"];
AttestationData data = 2;
// The difference of when attestation gets created and get included on chain.
uint64 inclusion_delay = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// The proposer who included the attestation in the block.
uint64 proposer_index = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
}
message Committee {
uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.CommitteeIndex"];
uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
repeated uint64 validators = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
}
// Fork structure used for indicating beacon chain versioning and forks.
message Fork {
bytes previous_version = 1 [(ethereum.eth.ext.ssz_size) = "4"];
bytes current_version = 2 [(ethereum.eth.ext.ssz_size) = "4"];
uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
}
message ForkChoiceHeadsResponse {
repeated ForkChoiceHead data = 1;
}
message ForkChoiceHead {
bytes root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
}
message BeaconStateResponse {
BeaconState data = 1;
}
// Copyright 2021 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.eth.v1;
import "google/protobuf/descriptor.proto";
import "eth/ext/options.proto";
option csharp_namespace = "Ethereum.Eth.V1";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v1";
option java_multiple_files = true;
option java_outer_classname = "BeaconEventsProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
message StreamEventsRequest {
// List of topics to request for event streaming items. Allowed request topics are
// head, attestation, block, voluntary_exit, finalized_checkpoint, chain_reorg.
repeated string topics = 1;
}
message EventHead {
// Slot of the new chain head.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// Block root of the new chain head.
bytes block = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// State root of the new chain head.
bytes state = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// Whether or not the new chain head is at an epoch transition.
bool epoch_transition = 4;
// The previous dependent root.
bytes previous_duty_dependent_root = 5 [(ethereum.eth.ext.ssz_size) = "32"];
// The current dependent root.
bytes current_duty_dependent_root = 6 [(ethereum.eth.ext.ssz_size) = "32"];
// Information about optimistic sync.
bool execution_optimistic = 7;
}
message EventBlock {
// The slot of the observed block.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// The root of the observed block.
bytes block = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// Information about optimistic sync.
bool execution_optimistic = 3;
}
message EventChainReorg {
// The slot of the observed reorg.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// Depth of the reorg in slots.
uint64 depth = 2;
// Block root of the old head.
bytes old_head_block = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// Block root of the new head.
bytes new_head_block = 4 [(ethereum.eth.ext.ssz_size) = "32"];
// State root of the old state.
bytes old_head_state = 5 [(ethereum.eth.ext.ssz_size) = "32"];
// State root of the new state.
bytes new_head_state = 6 [(ethereum.eth.ext.ssz_size) = "32"];
// Epoch of the observed reorg.
uint64 epoch = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Information about optimistic sync.
bool execution_optimistic = 8;
}
message EventFinalizedCheckpoint {
// Block root of the finalized checkpoint.
bytes block = 1 [(ethereum.eth.ext.ssz_size) = "32"];
// State root of the finalized checkpoint.
bytes state = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// Epoch the checkpoint references.
uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Information about optimistic sync.
bool execution_optimistic = 4;
}
// Copyright 2020 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.eth.v1;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "eth/v1/events.proto";
import "proto/gateway/event_source.proto";
option csharp_namespace = "Ethereum.Eth.V1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1";
option java_multiple_files = true;
option java_outer_classname = "EventsServiceProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
// Events API
//
// This service is defined in the upstream Ethereum consensus APIs repository (eth2.0-APIs/apis/debug).
service Events {
rpc StreamEvents(StreamEventsRequest) returns (stream gateway.EventSource) {
option (google.api.http) = {
get: "/eth/v1/events"
};
}
}
// Copyright 2021 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.eth.v1;
import "google/protobuf/descriptor.proto";
import "eth/ext/options.proto";
option csharp_namespace = "Ethereum.Eth.V1";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v1";
option java_multiple_files = true;
option java_outer_classname = "BeaconNodeProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
message IdentityResponse {
Identity data = 1;
}
message Identity {
// The peer id of the node.
string peer_id = 1;
// The latest ENR of the node.
string enr = 2;
// All the p2p multiaddresses of the peer, specified as a full multiaddr.
repeated string p2p_addresses = 3;
// All the discv5 multiaddresses of the peer, specified as a full multiaddr.
repeated string discovery_addresses = 4;
// Additional metadata that the node would like to provide. Includes extra networking information.
Metadata metadata = 5;
}
message Metadata {
// Sequence number starts at 0 used to version the node's metadata. If any other field in the local MetaData changes,
// the node MUST increment seq_number by 1.
uint64 seq_number = 1;
// Attnets is a bitvector representing the node's persistent attestation subnet subscriptions.
bytes attnets = 2 [(ethereum.eth.ext.ssz_size) = "8", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector64"];
}
message PeerRequest {
// Peer id of the peer requested.
string peer_id = 1;
}
message PeersRequest {
// Requested peer states (available values: disconnected, connecting, connected, disconnecting).
repeated ConnectionState state = 1;
// Requested peer directions (available values: inbound, outbound).
repeated PeerDirection direction = 2;
}
message PeerResponse {
Peer data = 1;
Meta meta = 2;
message Meta {
uint64 count = 1;
}
}
message PeersResponse {
repeated Peer data = 1;
}
message PeerCountResponse {
PeerCount data = 1;
message PeerCount {
// The number of disconnected peers.
uint64 disconnected = 1;
// The number of connecting peers.
uint64 connecting = 2;
// The number of connected peers.
uint64 connected = 3;
// The number of disconnecting peers.
uint64 disconnecting = 4;
}
}
// Peer provides details of a peer on the network.
message Peer {
// The peer id of the peer.
string peer_id = 1;
// The latest ENR of the peer that's in the record.
string enr = 2;
// The address of the peer, as a full multiaddr, for example:
// /ip4/37.221.192.134/tcp/13000/p2p/16Uiu2HAm8maLMjag1TAUM52zPfmLbVMGFdwUAWgoHu1HDQLR6e17
string last_seen_p2p_address = 3;
// The connection state of the peer at the moment of the request. (e.g. Connecting)
ConnectionState state = 4;
// The direction of the connection (inbound/outbound).
PeerDirection direction = 5;
}
// PeerDirection states the direction of the connection to a peer.
enum PeerDirection {
INBOUND = 0;
OUTBOUND = 1;
}
// ConnectionState states the current status of the peer.
enum ConnectionState {
DISCONNECTED = 0;
CONNECTING = 1;
CONNECTED = 2;
DISCONNECTING = 3;
}
message VersionResponse {
Version data = 1;
}
// Information about the node version.
message Version {
// A string that uniquely identifies the node and its version.
string version = 1;
}
message SyncingResponse {
SyncInfo data = 1;
}
message SyncInfo {
// A uint64 states the latest head slot of the current node.
uint64 head_slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// A uint64 indicating how many slots are left for the beacon node sync to complete.
uint64 sync_distance = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// A bool indicating whether the node is currently syncing or not.
bool is_syncing = 3;
// A bool indicating whether the node is currently in optimistic mode.
bool is_optimistic = 4;
}
// Copyright 2020 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.eth.v1;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/empty.proto";
import "eth/v1/node.proto";
option csharp_namespace = "Ethereum.Eth.V1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1";
option java_multiple_files = true;
option java_outer_classname = "NodeServiceProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
// Beacon chain node API
//
// The beacon chain node API is a set of endpoints to query node information.
service BeaconNode {
// GetIdentity retrieves data about the node's network presence.
rpc GetIdentity(google.protobuf.Empty) returns (IdentityResponse) {
option (google.api.http) = {get: "/eth/v1/node/identity"};
}
// ListPeers retrieves data about the node's network peers.
rpc ListPeers(PeersRequest) returns (PeersResponse) {
option (google.api.http) = {get: "/eth/v1/node/peers"};
}
// GetPeer retrieves data about the given peer.
rpc GetPeer(PeerRequest) returns (PeerResponse) {
option (google.api.http) = {get: "/eth/v1/node/peers/{peer_id}"};
}
// PeerCount retrieves number of known peers.
rpc PeerCount(google.protobuf.Empty) returns (PeerCountResponse) {
option (google.api.http) = {get: "/eth/v1/node/peer_count"};
}
// GetSyncStatus requests the beacon node to describe if it's currently syncing or not, and
// if it is, what block it is up to.
rpc GetSyncStatus(google.protobuf.Empty) returns (SyncingResponse) {
option (google.api.http) = {get: "/eth/v1/node/syncing"};
}
// GetVersion requests that the beacon node identify information about its implementation in a
// format similar to a HTTP User-Agent field.
rpc GetVersion(google.protobuf.Empty) returns (VersionResponse) {
option (google.api.http) = {get: "/eth/v1/node/version"};
}
// GetHealth returns node health status in http status codes. Useful for load balancers.
// Response Usage:
// "200":
// description: Node is ready
// "206":
// description: Node is syncing but can serve incomplete data
// "503":
// description: Node not initialized or having issues
rpc GetHealth(google.protobuf.Empty) returns (google.protobuf.Empty) {
option (google.api.http) = {get: "/eth/v1/node/health"};
}
}
// Copyright 2020 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.eth.v1;
import "google/protobuf/descriptor.proto";
import "eth/ext/options.proto";
import "eth/v1/attestation.proto";
import "eth/v1/beacon_block.proto";
option csharp_namespace = "Ethereum.Eth.V1";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v1";
option java_multiple_files = true;
option java_outer_classname = "ValidatorProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
message ValidatorContainer {
uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];;
uint64 balance = 2;
ValidatorStatus status = 3;
Validator validator = 4;
}
// An Ethereum validator.
message Validator {
// 48 byte BLS public key used for the validator's activities.
bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey"];
// 32 byte hash of the withdrawal destination public key.
bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// The validators current effective balance in gwei.
uint64 effective_balance = 3;
// Whether or not the validator has been slashed.
bool slashed = 4;
// Epoch when the validator became eligible for activation. This field may
// be zero if the validator was present in the Ethereum proof of stake genesis. This
// field is FAR_FUTURE_EPOCH if the validator has not been activated.
uint64 activation_eligibility_epoch = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Epoch when the validator was activated. This field may be zero if the
// validator was present in the Ethereum proof of stake genesis. This field is
// FAR_FUTURE_EPOCH if the validator has not been activated.
uint64 activation_epoch = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Epoch when the validator was exited. This field is FAR_FUTURE_EPOCH if
// the validator has not exited.
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum Beacon Chain specification:
// https://github.com/ethereum/consensus-specs/blob/v0.9.2/specs/core/0_beacon-chain.md#constants
uint64 exit_epoch = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Epoch when the validator is eligible to withdraw their funds. This field
// is FAR_FUTURE_EPOCH if the validator has not exited.
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum Beacon Chain specification:
// https://github.com/ethereum/consensus-specs/blob/v0.9.2/specs/core/0_beacon-chain.md#constants
uint64 withdrawable_epoch = 8 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
}
enum ValidatorStatus {
PENDING_INITIALIZED = 0;
PENDING_QUEUED = 1;
ACTIVE_ONGOING = 2;
ACTIVE_EXITING = 3;
ACTIVE_SLASHED = 4;
EXITED_UNSLASHED = 5;
EXITED_SLASHED = 6;
WITHDRAWAL_POSSIBLE = 7;
WITHDRAWAL_DONE = 8;
ACTIVE = 9;
PENDING = 10;
EXITED = 11;
WITHDRAWAL = 12;
}
message AttesterDutiesRequest {
// Epoch to request, should only be allowed 1 epoch ahead.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Validator indices to request duties for.
repeated uint64 index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
}
message AttesterDutiesResponse {
bytes dependent_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
repeated AttesterDuty data = 2;
bool execution_optimistic = 3;
}
message AttesterDuty {
// 48 byte BLS public key for the validator who's assigned to perform a duty.
bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48"];
// The index of the validator in the beacon state.
uint64 validator_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// The index of the committee where the validator belongs to.
uint64 committee_index = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.CommitteeIndex"];
// The length of the committee the validator belongs to.
uint64 committee_length = 4;
// The total amount of committees for this slot.
uint64 committees_at_slot = 5;
// The index of the validator in the committee.
uint64 validator_committee_index = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.CommitteeIndex"];
// The slot this duty is for.
uint64 slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
}
message ProposerDutiesRequest {
// Epoch to request duties for.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
}
message ProposerDutiesResponse {
bytes dependent_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
repeated ProposerDuty data = 2;
bool execution_optimistic = 3;
}
message ProposerDuty {
// 48 byte BLS public key for the validator who's assigned to perform a duty.
bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48"];
// The index of the validator in the beacon state.
uint64 validator_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// The slot this duty is for.
uint64 slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
}
message ProduceBlockRequest {
// The slot to request a block for.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// The validators RANDAO reveal 96 byte value.
bytes randao_reveal = 2 [(ethereum.eth.ext.ssz_size) = "96"];
// 32 byte field of arbitrary data. This field may contain any data and
// is not used for anything other than a fun message.
optional bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
}
message ProduceBlockResponse {
BeaconBlock data = 1;
}
message ProduceAttestationDataRequest {
// Slot for which the attestation data should be retrieved for.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// Committee index for which the attestation data should be retrieved for.
uint64 committee_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.CommitteeIndex"];
}
message ProduceAttestationDataResponse {
AttestationData data = 1;
}
message AggregateAttestationRequest {
// The root of the attestation data requesting the aggregate for.
bytes attestation_data_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
// The slot for the requested aggregate attestation.
uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
}
message AggregateAttestationResponse {
Attestation data = 1;
}
message SubmitAggregateAndProofsRequest {
repeated SignedAggregateAttestationAndProof data = 1;
}
message SubmitBeaconCommitteeSubscriptionsRequest {
repeated BeaconCommitteeSubscribe data = 1;
}
message BeaconCommitteeSubscribe {
// The validator index to subscribe for.
uint64 validator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// The committee index to be subscribed to.
uint64 committee_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.CommitteeIndex"];
// The total amount of committees for the given slot.
uint64 committees_at_slot = 3;
// The slot to be subscribed to.
uint64 slot = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// If subscribing for aggregator, the beacon node will aggregate all attestations received.
bool is_aggregator = 5;
}
message PrepareBeaconProposerRequest {
message FeeRecipientContainer {
// The address of the fee recipient.
bytes fee_recipient = 1 [(ethereum.eth.ext.ssz_size) = "20"];
// The proposer validator index.
uint64 validator_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
}
repeated FeeRecipientContainer recipients = 1;
}
message SubmitValidatorRegistrationsRequest {
message ValidatorRegistration {
// The address of the fee recipient.
bytes fee_recipient = 1 [(ethereum.eth.ext.ssz_size) = "20"];
// gas_limit value in gwei
uint64 gas_limit = 2;
// timestamp in utc seconds from unix epoch
uint64 timestamp = 3;
// validator public key
bytes pubkey = 4 [(ethereum.eth.ext.ssz_size) = "48"];
}
message SignedValidatorRegistration {
ValidatorRegistration message = 1;
// signature of ValidatorRegistration
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
repeated SignedValidatorRegistration registrations = 1;
}
\ No newline at end of file
// Copyright 2020 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.eth.v1;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "google/protobuf/empty.proto";
import "eth/v1/validator.proto";
option csharp_namespace = "Ethereum.Eth.V1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1";
option java_multiple_files = true;
option java_outer_classname = "ValidatorServiceProto";
option java_package = "org.ethereum.eth.v1";
option php_namespace = "Ethereum\\Eth\\v1";
// Beacon chain validator API
//
// The beacon chain validator API is a set of endpoints to be used by validators for performing their roles.
//
// This service is defined in the upstream Ethereum consensus APIs repository (eth2.0-APIs/apis/validator).
service BeaconValidator {
// GetAttesterDuties requests the beacon node to provide a set of attestation duties, which should be performed
// by validators, for a particular epoch.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid epoch or index
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
rpc GetAttesterDuties(AttesterDutiesRequest) returns (AttesterDutiesResponse) {
option (google.api.http) = {
post: "/eth/v1/validator/duties/attester/{epoch}"
body: "*"
};
}
// GetProposerDuties requests beacon node to provide all validators that are scheduled to
// propose a block in the given epoch.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid epoch
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
rpc GetProposerDuties(ProposerDutiesRequest) returns (ProposerDutiesResponse) {
option (google.api.http) = { get: "/eth/v1/validator/duties/proposer/{epoch}" };
}
// ProduceBlock requests the beacon node to produce a valid unsigned beacon block,
// which can then be signed by a proposer and submitted.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid block production request
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
rpc ProduceBlock(ProduceBlockRequest) returns (ProduceBlockResponse) {
option (google.api.http) = { get: "/eth/v1/validator/blocks/{slot}" };
}
// ProduceAttestationData requests that the beacon node produces attestation data for
// the requested committee index and slot based on the nodes current head.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid request syntax
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
rpc ProduceAttestationData(ProduceAttestationDataRequest) returns (ProduceAttestationDataResponse) {
option (google.api.http) = { get: "/eth/v1/validator/attestation_data" };
}
// GetAggregateAttestation aggregates all attestations matching the given attestation data root and slot,
// returning the aggregated result.
//
// HTTP response usage:
// - 200: Successful response
// - 400: Invalid request syntax
// - 500: Beacon node internal error
rpc GetAggregateAttestation(AggregateAttestationRequest) returns (AggregateAttestationResponse) {
option (google.api.http) = { get: "/eth/v1/validator/aggregate_attestation" };
}
// SubmitAggregateAndProofs verifies given aggregate and proofs and publishes them on appropriate gossipsub topic.
//
// Response usage:
// - 200: Successful response
// - 400: Invalid request syntax
// - 500: Beacon node internal error
rpc SubmitAggregateAndProofs(SubmitAggregateAndProofsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/eth/v1/validator/aggregate_and_proofs"
body: "*"
};
}
// SubmitBeaconCommitteeSubscription searches using discv5 for peers related to
// the provided subnet information and replaces current peers with those ones if necessary.
//
// If validator is_aggregator, beacon node must:
// - announce subnet topic subscription on gossipsub.
// - aggregate attestations received on that subnet.
//
// Response usage:
// - 200: Slot signature is valid and beacon node has prepared the attestation subnet
// Note that we cannot be certain Beacon node will find peers for that subnet for various reasons
// - 400: Invalid request syntax
// - 500: Beacon node internal error
// - 503: Beacon node is currently syncing, try again later
rpc SubmitBeaconCommitteeSubscription(SubmitBeaconCommitteeSubscriptionsRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/eth/v1/validator/beacon_committee_subscriptions"
body: "*"
};
}
}
##############################################################################
# Common
##############################################################################
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_java//java:defs.bzl", "java_proto_library")
##############################################################################
# Go
##############################################################################
# gazelle:ignore
load("@io_bazel_rules_go//go:def.bzl", "go_library")
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
load("//tools:ssz.bzl", "SSZ_DEPS", "ssz_gen_marshal")
##############################################################################
# OpenAPI (Swagger) V2
##############################################################################
load("@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2:defs.bzl", "protoc_gen_openapiv2")
proto_library(
name = "proto",
srcs = [
"attestation.proto",
"beacon_block.proto",
"beacon_block_altair.proto",
"beacon_chain.proto",
"sync_committee.proto",
"node.proto",
"validator.proto",
":generated_swagger_proto",
],
visibility = ["//visibility:public"],
deps = [
"//eth/ext:proto",
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_proto",
"@com_google_protobuf//:any_proto",
"@com_google_protobuf//:descriptor_proto",
"@com_google_protobuf//:empty_proto",
"@com_google_protobuf//:timestamp_proto",
"@go_googleapis//google/api:annotations_proto",
],
)
##############################################################################
# Java
##############################################################################
java_proto_library(
name = "java_proto",
deps = [":proto"],
)
##############################################################################
# Go
##############################################################################
ssz_gen_marshal(
name = "ssz_generated_files",
go_proto = ":go_proto",
includes = [
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
],
objs = [
"AggregateAttestationAndProof",
"Attestation",
"AttestationData",
"AttesterSlashing",
"BeaconBlock",
"BeaconBlockAltair",
"BeaconBlockBodyAltair",
"BeaconBlockHeader",
"Checkpoint",
"Deposit",
"Eth1Data",
"IndexedAttestation",
"ProposerSlashing",
"SignedAggregateAttestationAndProof",
"SignedBeaconBlock",
"SignedBeaconBlockAltair",
"SignedBeaconBlockHeader",
"SignedVoluntaryExit",
"Validator",
"VoluntaryExit",
"SyncCommitteeSignature",
"SyncCommitteeContribution",
"ContributionAndProof",
"SignedContributionAndProof",
],
)
go_proto_library(
name = "go_proto",
compilers = [
"@com_github_prysmaticlabs_protoc_gen_go_cast//:go_cast_grpc",
],
importpath = "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1",
proto = ":proto",
visibility = ["//visibility:public"],
deps = [
"//eth/ext:go_default_library",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@com_github_golang_protobuf//proto:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@org_golang_google_protobuf//types/known/timestamppb:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
],
)
go_proto_library(
name = "go_grpc_gateway_library",
compilers = [
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway",
],
embed = [":go_proto"],
importpath = "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1",
protos = [":proto"],
visibility = ["//visibility:private"],
deps = [
"//eth/ext:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
"@go_googleapis//google/api:annotations_go_proto",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
],
)
go_library(
name = "go_default_library",
srcs = [
":ssz_generated_files", # keep
],
embed = [
":go_grpc_gateway_library",
],
importpath = "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1",
visibility = ["//visibility:public"],
deps = SSZ_DEPS + [
"//eth/ext:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//utilities:go_default_library",
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
"@org_golang_google_grpc//:go_default_library",
"@org_golang_google_grpc//codes:go_default_library",
"@org_golang_google_grpc//grpclog:go_default_library",
"@org_golang_google_grpc//metadata:go_default_library",
"@org_golang_google_grpc//status:go_default_library",
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
"@com_github_golang_protobuf//proto:go_default_library",
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
"@com_github_prysmaticlabs_go_bitfield//:go_default_library", # keep
"@go_googleapis//google/api:annotations_go_proto",
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
], # keep
)
protoc_gen_openapiv2(
name = "swagger",
json_names_for_fields = True,
proto = ":proto",
single_output = True,
visibility = ["//visibility:public"],
)
# Genrule for template subsitution.
# See documentation in //tools/replacer.
genrule(
name = "generated_swagger_proto",
srcs = [
"swagger.proto", # A go template compatibile file.
"swagger_description.md", # Replacement for description.
],
outs = ["swagger_generated.proto"],
cmd = "$(location //tools/replacer) $(location swagger.proto) description=$(location swagger_description.md) > $(@)",
tools = ["//tools/replacer"],
)
# gRPC Gateway
This package is contains generated files for applications that wish to use eth/v1alpha as a
[gRPC gateway](https://github.com/grpc-ecosystem/grpc-gateway).
\ No newline at end of file
// Copyright 2020 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.eth.v1alpha1;
import "eth/ext/options.proto";
option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth";
option java_multiple_files = true;
option java_outer_classname = "AttestationProto";
option java_package = "org.ethereum.eth.v1alpha1";
option php_namespace = "Ethereum\\Eth\\v1alpha1";
message Attestation {
// A bitfield representation of validator indices that have voted exactly
// the same vote and have been aggregated into this attestation.
bytes aggregation_bits = 1 [(ethereum.eth.ext.ssz_max) = "2048", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitlist"];
AttestationData data = 2;
// 96 byte BLS aggregate signature.
bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"];
}
message AggregateAttestationAndProof {
// The aggregator index that submitted this aggregated attestation and proof.
uint64 aggregator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// The aggregated attestation that was submitted.
Attestation aggregate = 3;
// 96 byte selection proof signed by the aggregator, which is the signature of the slot to aggregate.
bytes selection_proof = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message SignedAggregateAttestationAndProof {
// The aggregated attestation and selection proof itself.
AggregateAttestationAndProof message = 1;
// 96 byte BLS aggregate signature signed by the aggregator over the message.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message AttestationData {
// Attestation data includes information on Casper the Friendly Finality Gadget's votes
// See: https://arxiv.org/pdf/1710.09437.pdf
// Slot of the attestation attesting for.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// The committee index that submitted this attestation.
uint64 committee_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.CommitteeIndex"];
// 32 byte root of the LMD GHOST block vote.
bytes beacon_block_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// The most recent justified checkpoint in the beacon state
Checkpoint source = 4;
// The checkpoint attempting to be justified for the current epoch and its epoch boundary block
Checkpoint target = 5;
}
message Checkpoint {
// A checkpoint is every epoch's first slot. The goal of Casper FFG
// is to link the check points together for justification and finalization.
// Epoch the checkpoint references.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Block root of the checkpoint references.
bytes root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
}
// Copyright 2020 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.eth.v1alpha1;
import "eth/ext/options.proto";
import "eth/v1alpha1/attestation.proto";
option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth";
option java_multiple_files = true;
option java_outer_classname = "BeaconBlockProto";
option java_package = "org.ethereum.eth.v1alpha1";
option php_namespace = "Ethereum\\Eth\\v1alpha1";
// The Ethereum consensus beacon block. The message does not contain a validator signature.
message BeaconBlock {
// Beacon chain slot that this block represents.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Validator index of the validator that proposed the block header.
uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// 32 byte root of the parent block.
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// 32 byte root of the resulting state after processing this block.
bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
// The block body itself.
BeaconBlockBody body = 5;
}
// The signed version of beacon block.
message SignedBeaconBlock {
// The unsigned beacon block itself.
BeaconBlock block = 1;
// 96 byte BLS signature from the validator that produced this block.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
// The block body of an Ethereum consensus beacon block.
message BeaconBlockBody {
// The validators RANDAO reveal 96 byte value.
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
// A reference to the Ethereum 1.x chain.
Eth1Data eth1_data = 2;
// 32 byte field of arbitrary data. This field may contain any data and
// is not used for anything other than a fun message.
bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// Block operations
// Refer to spec constants at https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#max-operations-per-block
// At most MAX_PROPOSER_SLASHINGS.
repeated ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_ATTESTER_SLASHINGS.
repeated AttesterSlashing attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "2"];
// At most MAX_ATTESTATIONS.
repeated Attestation attestations = 6 [(ethereum.eth.ext.ssz_max) = "128"];
// At most MAX_DEPOSITS.
repeated Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_VOLUNTARY_EXITS.
repeated SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"];
}
// Proposer slashings are proofs that a slashable offense has been committed by
// proposing two conflicting blocks from the same validator.
message ProposerSlashing {
// First conflicting signed block header.
SignedBeaconBlockHeader header_1 = 2;
// Second conflicting signed block header.
SignedBeaconBlockHeader header_2 = 3;
}
// Attestor slashings are proofs that a slashable offense has been committed by
// attestating to two conflicting pieces of information by the same validator.
message AttesterSlashing {
// First conflicting attestation.
IndexedAttestation attestation_1 = 1;
// Second conflicting attestation.
IndexedAttestation attestation_2 = 2;
}
// Deposit into the Ethereum consensus from the Ethereum 1.x deposit contract.
message Deposit {
// DepositData that is encoded into a deposit signature.
message Data {
// 48 byte BLS public key of the validator.
bytes public_key = 1 [(ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey"];
// A 32 byte hash of the withdrawal address public key.
bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// Deposit amount in gwei.
uint64 amount = 3;
// 96 byte signature from the validators public key.
bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"];
}
// 32 byte roots in the deposit tree branch.
repeated bytes proof = 1 [(ethereum.eth.ext.ssz_size) = "33,32"];
Data data = 2;
}
// A message that represents a validator signaling that they want to voluntarily
// withdraw from the active validator set. The message does not contain a
// validator signature.
message VoluntaryExit {
// The epoch on when exit request becomes valid.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Index of the exiting validator.
uint64 validator_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
}
// The signed version of voluntary exit.
message SignedVoluntaryExit {
// The unsigned voluntary exit itself.
VoluntaryExit exit = 1;
// Validator's 96 byte signature
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
// Eth1Data represents references to the Ethereum 1.x deposit contract.
message Eth1Data {
// The 32 byte deposit tree root for the last deposit included in this
// block.
bytes deposit_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
// The total number of deposits included in the beacon chain since genesis
// including the deposits in this block.
uint64 deposit_count = 2;
// The 32 byte block hash of the Ethereum 1.x block considered for deposit
// inclusion.
bytes block_hash = 3 [(ethereum.eth.ext.ssz_size) = "32"];
}
// A beacon block header is essentially a beacon block with only a reference to
// the beacon body as a 32 byte merkle tree root. This type of message is more
// lightweight than a full beacon block. The message does not contain
// a validator signature.
message BeaconBlockHeader {
// Beacon chain slot that this block represents.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Validator index of the validator that proposed the block header.
uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// 32 byte merkle tree root of the parent ssz encoded block.
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// 32 byte merkle tree root of the resulting ssz encoded state after processing this block.
bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
// 32 byte merkle tree root of the ssz encoded block body.
bytes body_root = 5 [(ethereum.eth.ext.ssz_size) = "32"];
}
message SignedBeaconBlockHeader {
// The unsigned beacon block header itself.
BeaconBlockHeader header = 1;
// 96 byte BLS signature from the validator that produced this block header.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message IndexedAttestation {
repeated uint64 attesting_indices = 1 [(ethereum.eth.ext.ssz_max) = "2048"];
AttestationData data = 2;
// 96 bytes aggregate signature.
bytes signature = 3 [(ethereum.eth.ext.ssz_size) = "96"];
}
// Copyright 2021 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.eth.v1alpha1;
import "eth/ext/options.proto";
import "eth/v1alpha1/attestation.proto";
import "eth/v1alpha1/beacon_block.proto";
option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth";
option java_multiple_files = true;
option java_outer_classname = "BeaconBlockAltairProto";
option java_package = "org.ethereum.eth.v1alpha1";
option php_namespace = "Ethereum\\Eth\\v1alpha1";
// The signed version of a Altair(HF1) beacon block.
message SignedBeaconBlockAltair {
// The unsigned beacon block itself.
BeaconBlockAltair block = 1;
// 96 byte BLS signature from the validator that produced this block.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
// The unsigned version of a Altair(HF1) beacon block.. The message does not contain a validator signature.
message BeaconBlockAltair {
// Beacon chain slot that this block represents.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Validator index of the validator that proposed the block header.
uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// 32 byte root of the parent block.
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// 32 byte root of the resulting state after processing this block.
bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
// The Altair beacon block body.
BeaconBlockBodyAltair body = 5;
}
// The block body of an Altair(HF1) beacon block.
// The new addition for Altair is SyncAggregate for light client support.
message BeaconBlockBodyAltair {
// The validators RANDAO reveal 96 byte value.
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
// A reference to the Ethereum 1.x chain.
Eth1Data eth1_data = 2;
// 32 byte field of arbitrary data. This field may contain any data and
// is not used for anything other than a fun message.
bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// Block operations
// Refer to spec constants at https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#max-operations-per-block
// At most MAX_PROPOSER_SLASHINGS.
repeated ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_ATTESTER_SLASHINGS.
repeated AttesterSlashing attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "2"];
// At most MAX_ATTESTATIONS.
repeated Attestation attestations = 6 [(ethereum.eth.ext.ssz_max) = "128"];
// At most MAX_DEPOSITS.
repeated Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_VOLUNTARY_EXITS.
repeated SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"];
// Sync aggregate object to track sync committee votes for light client support. [New in Altair]
SyncAggregate sync_aggregate = 9;
}
// The sync aggregate object for the beacon chain to track sync committee votes and to
// support light client infra.
message SyncAggregate {
// Sync committee bits as Bitvector to track votes.
bytes sync_committee_bits = 1 [(ethereum.eth.ext.ssz_size) = "64", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector512"];
// BLS aggregated signature of the sync committee for the ones that voted.
bytes sync_committee_signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
// Copyright 2020 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.eth.v1alpha1;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "eth/ext/options.proto";
import "eth/v1alpha1/attestation.proto";
import "eth/v1alpha1/beacon_block.proto";
import "eth/v1alpha1/validator.proto";
option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth";
option java_multiple_files = true;
option java_outer_classname = "BeaconChainProto";
option java_package = "org.ethereum.eth.v1alpha1";
option php_namespace = "Ethereum\\Eth\\v1alpha1";
// Beacon chain API
//
// The beacon chain API can be used to access data relevant to the Ethereum Beacon Chain.
service BeaconChain {
// TODO(preston): Batch requests?
// Retrieve attestations by block root, slot, or epoch.
//
// The server may return an empty list when no attestations match the given
// filter criteria. This RPC should not return NOT_FOUND. Only one filter
// criteria should be used. This endpoint allows for retrieval of genesis
// information via a boolean query filter.
rpc ListAttestations(ListAttestationsRequest) returns (ListAttestationsResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/attestations"
};
}
// Retrieve indexed attestations by block root, slot, or epoch.
//
// The server may return an empty list when no indexed attestations match the given
// filter criteria. This RPC should not return NOT_FOUND. Only one filter
// criteria should be used. This endpoint allows for retrieval of genesis
// information via a boolean query filter.
rpc ListIndexedAttestations(ListIndexedAttestationsRequest) returns (ListIndexedAttestationsResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/attestations/indexed"
};
}
// Server-side stream of attestations as they are received by
// the beacon chain node.
rpc StreamAttestations(google.protobuf.Empty) returns (stream Attestation) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/attestations/stream"
};
}
// Server-side stream of indexed attestations as they are received by
// the beacon chain node.
rpc StreamIndexedAttestations(google.protobuf.Empty) returns (stream IndexedAttestation) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/attestations/indexed/stream"
};
}
// Retrieve attestations from pool.
//
// The server returns a list of attestations that have been seen but not
// yet processed. Pool attestations eventually expire as the slot
// advances, so an attestation missing from this request does not imply
// that it was included in a block. The attestation may have expired.
// Refer to the Ethereum Beacon Chain specification for more details on how
// attestations are processed and when they are no longer valid.
// https://github.com/ethereum/eth2.0-specs/blob/dev/specs/core/0_beacon-chain.md#attestations
rpc AttestationPool(AttestationPoolRequest) returns (AttestationPoolResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/attestations/pool"
};
}
// Retrieve blocks by root, slot, or epoch.
//
// The server may return multiple blocks in the case that a slot or epoch is
// provided as the filter criteria. The server may return an empty list when
// no blocks in their database match the filter criteria. This RPC should
// not return NOT_FOUND. Only one filter criteria should be used. This endpoint
// allows for retrieval of genesis information via a boolean query filter.
rpc ListBlocks(ListBlocksRequest) returns (ListBlocksResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/blocks"
};
}
// Server-side stream of all signed blocks as they are received by
// the beacon chain node.
rpc StreamBlocks(StreamBlocksRequest) returns (stream SignedBeaconBlock) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/blocks/stream"
};
}
// Server-side stream of information about the head of the beacon chain
// from the view of the beacon chain node.
//
// This includes the head block slot and root as well as information about
// the most recent finalized and justified slots.
rpc StreamChainHead(google.protobuf.Empty) returns (stream ChainHead) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/chainhead/stream"
};
}
// Retrieve information about the head of the beacon chain from the view of
// the beacon chain node.
//
// This includes the head block slot and root as well as information about
// the most recent finalized and justified slots.
rpc GetChainHead(google.protobuf.Empty) returns (ChainHead) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/chainhead"
};
}
// Retrieve information about the weak subjectivity of the beacon chain from the view of
// the beacon chain node.
//
// This includes the weak subjectivity block root, state root and epoch number.
rpc GetWeakSubjectivityCheckpoint(google.protobuf.Empty) returns (WeakSubjectivityCheckpoint) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/weak_subjectivity_checkpoint"
};
}
// Retrieve the beacon chain committees for a given epoch.
//
// If no filter criteria is specified, the response returns
// all beacon committees for the current epoch. The results are paginated by default.
// This endpoint allows for retrieval of genesis information via a boolean query filter.
rpc ListBeaconCommittees(ListCommitteesRequest) returns (BeaconCommittees) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/committees"
};
}
// Retrieve validator balances for a given set of public keys at a specific
// epoch in time. This endpoint allows for retrieval of genesis information
// via a boolean query filter.
rpc ListValidatorBalances(ListValidatorBalancesRequest) returns (ValidatorBalances) {
option (google.api.http) = {
get: "/eth/v1alpha1/validators/balances"
};
}
// Retrieve the current validator registry.
//
// The request may include an optional historical epoch to retrieve a
// specific validator set in time. This endpoint allows for retrieval of genesis
// information via a boolean query filter.
rpc ListValidators(ListValidatorsRequest) returns (Validators) {
option (google.api.http) = {
get: "/eth/v1alpha1/validators"
};
}
// Retrieve information about a specific validator in the registry.
//
// This request may query by validator index or public key.
rpc GetValidator(GetValidatorRequest) returns (Validator) {
option (google.api.http) = {
get: "/eth/v1alpha1/validator"
};
}
// Retrieve the active set changes for a given epoch.
//
// This data includes any activations, voluntary exits, and involuntary
// ejections. This endpoint allows for retrieval of genesis
// information via a boolean query filter.
rpc GetValidatorActiveSetChanges(GetValidatorActiveSetChangesRequest) returns (ActiveSetChanges) {
option (google.api.http) = {
get: "/eth/v1alpha1/validators/activesetchanges"
};
}
// Retrieve the current validator queue information.
rpc GetValidatorQueue(google.protobuf.Empty) returns (ValidatorQueue) {
option (google.api.http) = {
get: "/eth/v1alpha1/validators/queue"
};
}
// GetValidatorPerformance reports a validator's latest balance along with other important
// metrics on rewards and penalties throughout its lifecycle in the beacon chain.
// The request takes in a list of validator public keys and returns a performance report
// for all of them respectively.
rpc GetValidatorPerformance(ValidatorPerformanceRequest) returns (ValidatorPerformanceResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/validators/performance"
};
}
// Retrieve the validator assignments for a given epoch.
//
// This request may specify optional validator indices or public keys to
// filter validator assignments. This endpoint allows for retrieval of genesis
// information via a boolean query filter.
rpc ListValidatorAssignments(ListValidatorAssignmentsRequest) returns (ValidatorAssignments) {
option (google.api.http) = {
get: "/eth/v1alpha1/validators/assignments"
};
}
// Retrieve the validator participation information for a given epoch.
//
// This method returns information about the global participation of
// validator attestations. This endpoint allows for retrieval of genesis
// information via a boolean query filter.
rpc GetValidatorParticipation(GetValidatorParticipationRequest) returns (ValidatorParticipationResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/validators/participation"
};
}
// Retrieve the current configuration parameters of the beacon chain.
rpc GetBeaconConfig(google.protobuf.Empty) returns (BeaconConfig) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/config"
};
}
// Server-side stream of validator information at each epoch.
rpc StreamValidatorsInfo(stream ValidatorChangeSet) returns (stream ValidatorInfo) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/validators/info/stream"
};
}
// Submit an attester slashing object to the beacon node.
rpc SubmitAttesterSlashing(AttesterSlashing) returns (SubmitSlashingResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/slashings/attester/submit"
};
}
// Submit a proposer slashing object to the beacon node.
rpc SubmitProposerSlashing(ProposerSlashing) returns (SubmitSlashingResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/slashings/proposer/submit"
};
}
// Returns a list of validators individual vote status of a given epoch.
rpc GetIndividualVotes(IndividualVotesRequest) returns (IndividualVotesRespond) {
option (google.api.http) = {
get: "/eth/v1alpha1/beacon/individual_votes"
};
}
}
// SetAction defines the type of action that should be applied to the keys in a validator change set.
enum SetAction {
// ADD_VALIDATOR_KEYS adds to the existing keys.
ADD_VALIDATOR_KEYS = 0;
// REMOVE_VALIDATOR_KEYS removes from the existing keys.
REMOVE_VALIDATOR_KEYS = 1;
// SET_VALIDATOR_KEYS overwrites the existing keys.
SET_VALIDATOR_KEYS = 2;
}
// ValidatorChangeSet updates the server's list of keys on which to operate.
message ValidatorChangeSet {
// Action (add/remove/set).
SetAction action = 1;
// 48 byte BLS public keys of validators on which the operation occurs.
repeated bytes public_keys = 2;
}
// Request for indexed attestations by target epoch.
message ListIndexedAttestationsRequest {
oneof query_filter {
// Retrieve attestations by epoch processed.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Optional criteria to retrieve genesis epoch attestations.
bool genesis_epoch = 2;
}
// The maximum number of IndexedAttestations to return in the response.
// This field is optional.
int32 page_size = 3;
// A pagination token returned from a previous call to `ListIndexedAttestations`
// that indicates where this listing should continue from.
// This field is optional.
string page_token = 4;
}
// Request for attestations.
message ListAttestationsRequest {
// TODO(preston): Test oneof with gRPC gateway.
oneof query_filter {
// Filter attestations by epoch processed.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Optional criteria to retrieve attestations from 0 epoch.
bool genesis_epoch = 2;
}
// The maximum number of Attestations to return in the response.
// This field is optional.
int32 page_size = 3;
// A pagination token returned from a previous call to `ListAttestations`
// that indicates where this listing should continue from.
// This field is optional.
string page_token = 4;
}
message ListAttestationsResponse {
repeated Attestation attestations = 1;
// A pagination token returned from a previous call to `ListAttestations`
// that indicates from where listing should continue.
// This field is optional.
string next_page_token = 2;
// Total count of Attestations matching the request filter.
int32 total_size = 3;
}
message ListIndexedAttestationsResponse {
repeated IndexedAttestation indexed_attestations = 1;
// A pagination token returned from a previous call to `ListIndexedAttestations`
// that indicates from where listing should continue.
// This field is optional.
string next_page_token = 2;
// Total count of Attestations matching the request filter.
int32 total_size = 3;
}
message ListBlocksRequest {
oneof query_filter {
// Block root filter to return a single block.
bytes root = 1;
// Slot to lookup a block. If the slot is not yet finalized, this
// criteria may yield multiple valid blocks if the node has seen blocks
// from another fork.
uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// The epoch number for which to retrieve blocks. If specified, this
// will return all blocks found within the span of the specified epoch.
uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Optional criteria to retrieve genesis block.
bool genesis = 4;
}
// The maximum number of Blocks to return in the response.
// This field is optional.
int32 page_size = 5;
// A pagination token returned from a previous call to `ListBlocks`
// that indicates where this listing should continue from.
// This field is optional.
string page_token = 6;
}
message ListBlocksResponse {
repeated BeaconBlockContainer blockContainers = 1;
// A pagination token returned from a previous call to `ListBlocks`
// that indicates from where listing should continue.
// This field is optional.
string next_page_token = 2;
// Total count of Blocks matching the request filter.
int32 total_size = 3;
}
// Request to only return blocks that is verified by the beacon node.
message StreamBlocksRequest {
bool verified_only = 1;
}
// A container that contains both the beacon block
// and its corresponding root.
message BeaconBlockContainer {
// The contained Ethereum beacon block.
SignedBeaconBlock block = 1;
// 32 byte merkle tree root of contained beacon block.
bytes block_root = 2;
// Boolean indicating whether the block is canonical.
bool canonical = 3;
}
// Information about the head of the beacon chain.
message ChainHead {
// Slot of the head block.
uint64 head_slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Epoch of the head block.
uint64 head_epoch = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// 32 byte merkle tree root of the canonical head block in the beacon node.
bytes head_block_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// Most recent slot that contains the finalized block.
uint64 finalized_slot = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Epoch of the finalized block.
uint64 finalized_epoch = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Most recent 32 byte finalized block root.
bytes finalized_block_root = 6 [(ethereum.eth.ext.ssz_size) = "32"];
// Most recent slot that contains the justified block.
uint64 justified_slot = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Epoch of the justified block.
uint64 justified_epoch = 8 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Most recent 32 byte justified block root.
bytes justified_block_root = 9 [(ethereum.eth.ext.ssz_size) = "32"];
// Most recent slot that contains the previous justified block.
uint64 previous_justified_slot = 10 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Epoch of the previous justified block.
uint64 previous_justified_epoch = 11 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Previous 32 byte justified block root.
bytes previous_justified_block_root = 12 [(ethereum.eth.ext.ssz_size) = "32"];
}
message ListCommitteesRequest {
oneof query_filter {
// Optional criteria to retrieve data at a specific epoch.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Optional criteria to retrieve genesis data.
bool genesis = 2;
}
}
message BeaconCommittees {
message CommitteeItem {
// A committee is a list of validator indices participating in consensus at a slot.
repeated uint64 validator_indices = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
}
message CommitteesList {
// A list of committees.
repeated CommitteeItem committees = 1;
}
// The epoch for which the committees in the response belong to.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// A map of validator committees by slot.
map<uint64, CommitteesList> committees = 2;
// The number of active validators at the given epoch.
uint64 active_validator_count = 3;
}
message ListValidatorBalancesRequest {
oneof query_filter {
// Optional criteria to retrieve balances at a specific epoch.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Optional criteria to retrieve the genesis list of balances.
bool genesis = 2;
}
// Validator 48 byte BLS public keys to filter validators for the given
// epoch.
repeated bytes public_keys = 3 [(ethereum.eth.ext.ssz_size) = "?,48"];
// Validator indices to filter validators for the given epoch.
repeated uint64 indices = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// The maximum number of Validators to return in the response.
// This field is optional.
int32 page_size = 5;
// A pagination token returned from a previous call to `GetValidators`
// that indicates where this listing should continue from.
// This field is optional.
string page_token = 6;
}
message ValidatorBalances {
// Epoch which the state was considered to determine the validator balances.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
message Balance {
// Validator's 48 byte BLS public key.
bytes public_key = 1 [(ethereum.eth.ext.ssz_size) = "48"];
// Validator's index in the validator set.
uint64 index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// Validator's balance in gwei.
uint64 balance = 3;
// Validator's status, UNKNOWN if not found.
string status = 4;
}
repeated Balance balances = 2;
// A pagination token returned from a previous call to `GetListValidatorBalances`
// that indicates from where listing should continue.
string next_page_token = 3;
// Total count of items matching the request filter.
int32 total_size = 4;
}
message ListValidatorsRequest {
oneof query_filter {
// Optional criteria to retrieve validators at a specific epoch.
// Omitting this field or setting it to zero will retrieve a response
// with the current active validator set.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Optional criteria to retrieve the genesis set of validators.
bool genesis = 2;
}
// Specify whether or not you want to retrieve only active validators.
bool active = 3;
// The maximum number of Validators to return in the response.
// This field is optional.
int32 page_size = 4;
// A pagination token returned from a previous call to `GetValidators`
// that indicates where this listing should continue from.
// This field is optional.
string page_token = 5;
// Specify which validators you would like to retrieve by their public keys.
// This field is optional.
repeated bytes public_keys = 6;
// Specify which validators you would like to retrieve by their indices.
// This field is optional.
repeated uint64 indices = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
}
message GetValidatorRequest {
oneof query_filter {
// Validator index in the registry.
uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// 48 byte validator public key.
bytes public_key = 2 [(ethereum.eth.ext.ssz_size) = "48"];
}
}
message Validators {
// Epoch which the state was considered to determine the active validator
// set. This field is not optional. Zero value epoch indicates the validator
// set is from the Ethereum proof of stake genesis set.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
message ValidatorContainer {
uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
Validator validator = 2;
}
repeated ValidatorContainer validator_list = 2;
// A pagination token returned from a previous call to `GetValidators`
// that indicates from where listing should continue.
// This field is optional.
string next_page_token = 3;
// Total count of Validators matching the request filter.
int32 total_size = 4;
}
message GetValidatorActiveSetChangesRequest {
oneof query_filter {
// Optional criteria to retrieve balances at a specific epoch.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Optional criteria to retrieve the genesis list of balances.
bool genesis = 2;
}
}
message ActiveSetChanges {
// Epoch which the state was considered to determine the active validator
// set.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// 48 byte validator public keys that have been activated in the given epoch.
repeated bytes activated_public_keys = 2 [(ethereum.eth.ext.ssz_size) = "?,48"];
// Indices of validators activated in the given epoch.
repeated uint64 activated_indices = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// 48 byte validator public keys that have been voluntarily exited in the given epoch.
repeated bytes exited_public_keys = 4 [(ethereum.eth.ext.ssz_size) = "?,48"];
// Indices of validators exited in the given epoch.
repeated uint64 exited_indices = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// 48 byte validator public keys that have been slashed in the given epoch.
repeated bytes slashed_public_keys = 6 [(ethereum.eth.ext.ssz_size) = "?,48"];
// Indices of validators slashed in the given epoch.
repeated uint64 slashed_indices = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// 48 byte validator public keys that have been involuntarily ejected in this epoch.
repeated bytes ejected_public_keys = 8 [(ethereum.eth.ext.ssz_size) = "?,48"];
// Indices of validators ejected in the given epoch.
repeated uint64 ejected_indices = 9 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
}
message ValidatorPerformanceRequest {
// A list of 48 byte validator public keys.
repeated bytes public_keys = 1 [deprecated = true];
// A list of validator indices to retrieve performance by their indices.
repeated uint64 indices = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
}
message ValidatorPerformanceResponse {
// A list of validator effective balances mapped 1-to-1 with the request's
// public keys.
repeated uint64 current_effective_balances = 1;
// The slot of when validator's attestation got included in the chain at previous epoch, the slot
// is mapped 1-to-1 with the request's public keys.
repeated uint64 inclusion_slots = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// The distance of when validator submitted and got included in the chain, the distance
// is mapped 1-to-1 with the request's public keys.
repeated uint64 inclusion_distances = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Whether the list of validator recently correctly voted for source at previous epoch, the result
// is mapped 1-to-1 with the request's public keys.
repeated bool correctly_voted_source = 4;
// Whether the list of validator recently correctly voted for target at previous epoch, the result
// is mapped 1-to-1 with the request's public keys.
repeated bool correctly_voted_target = 5;
// Whether the list of validator recently correctly voted for head at previous epoch, the result
// is mapped 1-to-1 with the request's public keys.
repeated bool correctly_voted_head = 6;
// The balance of validators before epoch transition, the balance is mapped 1-to-1 with the requests's
// public keys.
repeated uint64 balances_before_epoch_transition = 7;
// The balance of validators after epoch transition, the balance is mapped 1-to-1 with the requests's
// public keys.
repeated uint64 balances_after_epoch_transition = 8;
// The total number of validators from the request not found in
// in the beacon chain.
repeated bytes missing_validators = 9;
// The average active validator balance in the beacon chain.
float average_active_validator_balance = 10;
// The public keys in the order they are in of the response.
repeated bytes public_keys = 11 [(ethereum.eth.ext.ssz_size) = "?,48"];
}
message ValidatorQueue {
// The amount of ether in gwei allowed to enter or exit the active
// validator set.
uint64 churn_limit = 1;
// Ordered list of 48 byte public keys awaiting activation. 0th index is the
// next key to be processed.
repeated bytes activation_public_keys = 2 [(ethereum.eth.ext.ssz_size) = "?,48", deprecated = true];
// Ordered list of public keys awaiting exit. 0th index is the next key to
// be processed.
repeated bytes exit_public_keys = 3 [(ethereum.eth.ext.ssz_size) = "?,48", deprecated = true];
// Ordered list of validator indices awaiting activation. 0th item in the list is the
// next validator index to be processed.
repeated uint64 activation_validator_indices = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// Ordered list of validator indices awaiting exit. 0th item in the list is the
// next validator index to be processed.
repeated uint64 exit_validator_indices = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
}
message ListValidatorAssignmentsRequest {
oneof query_filter {
// Epoch to validator assignments for.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Whether or not to query for the genesis information.
bool genesis = 2;
}
// 48 byte validator public keys to filter assignments for the given epoch.
repeated bytes public_keys = 3 [(ethereum.eth.ext.ssz_size) = "?,48"];
// Validator indicies to filter assignments for the given epoch.
repeated uint64 indices = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// The maximum number of ValidatorAssignments to return in the response.
// This field is optional.
int32 page_size = 5;
// A pagination token returned from a previous call to `ListValidatorAssignments`
// that indicates where this listing should continue from.
// This field is optional.
string page_token = 6;
}
message ValidatorAssignments {
message CommitteeAssignment {
// Beacon committees are responsible for crosslinking committee data back to the beacon chain,
// they also attest and produce beacon chain blocks. This is a list of validator indices that
// are in the same committee as requested validator, everyone in the committee is assigned to the
// same slot and same committee.
repeated uint64 beacon_committees = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// Committee index represents the committee of validator that's in.
uint64 committee_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.CommitteeIndex"];
// Beacon chain slot in which the validator must perform its assigned
// duty as an attester.
uint64 attester_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Beacon chain slots in which the validator must perform its assigned
// duty as a proposer.
repeated uint64 proposer_slots = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// 48 byte BLS public key.
bytes public_key = 5 [(ethereum.eth.ext.ssz_size) = "48", deprecated = true];
// Validator index in the beacon state.
uint64 validator_index = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
}
// The epoch for which this set of validator assignments is valid.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
repeated CommitteeAssignment assignments = 2;
// A pagination token returned from a previous call to `ListValidatorAssignmentsRequest`
// that indicates where this listing should continue from.
// This field is optional.
string next_page_token = 3;
// Total count of CommitteeAssignments matching the request filter.
int32 total_size = 4;
}
message GetValidatorParticipationRequest {
oneof query_filter {
// Epoch to request participation information.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Whether or not to query for the genesis information.
bool genesis = 2;
}
}
message ValidatorParticipationResponse {
// Epoch which this message is applicable.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Whether or not epoch has been finalized.
bool finalized = 2;
// The actual validator participation metrics.
ValidatorParticipation participation = 3;
}
message AttestationPoolRequest {
// The maximum number of objects to return in the response.
// This field is optional.
int32 page_size = 1;
// A pagination token returned from a previous call
// that indicates where this listing should continue from.
// This field is optional.
string page_token = 2;
}
message AttestationPoolResponse {
// List of attestations currently in the pool of the beacon chain.
repeated Attestation attestations = 1;
// A pagination token returned from a previous call
// that indicates where this listing should continue from.
// This field is optional.
string next_page_token = 2;
// Total count of objects matching the request filter.
int32 total_size = 3;
}
// Information about the configuration parameters of the beacon node, such
// as the slots per epoch, slots per eth1 voting period, and more.
message BeaconConfig {
map<string, string> config = 1;
}
message SubmitSlashingResponse {
// Indices of the validators to be slashed by the submitted
// proposer/attester slashing object.
repeated uint64 slashed_indices = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
}
message IndividualVotesRequest {
// Epoch of the request.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Validator 48 byte BLS public keys to filter validators for the given epoch.
repeated bytes public_keys = 2;
// Validator indices to filter validators for the given epoch.
repeated uint64 indices = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
}
message IndividualVotesRespond {
message IndividualVote {
// The epoch of the vote status request.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// The public key of the vote status request.
bytes public_key = 2;
// The validator index of the request.
uint64 validator_index = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// Has the validator been slashed.
bool is_slashed = 4;
// Is the validator withdrawable.
bool is_withdrawable_in_current_epoch = 5;
// Is the validator active in current epoch.
bool is_active_in_current_epoch = 6;
// Was the validator active in previous epoch.
bool is_active_in_previous_epoch = 7;
// Did validator attest for current epoch.
bool is_current_epoch_attester = 8;
// Did validator attest target for current epoch.
bool is_current_epoch_target_attester = 9;
// Did validator attest for previous epoch.
bool is_previous_epoch_attester = 10;
// Did validator attest target for previous epoch.
bool is_previous_epoch_target_attester = 11;
// Did validator attest head for previous epoch.
bool is_previous_epoch_head_attester = 12;
// The current effective balance of the validator.
uint64 current_epoch_effective_balance_gwei = 13;
// The slots of when the validator's attestation got included in the block.
uint64 inclusion_slot = 14 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// How many slots have passed until the validator's attestation got included in the block.
uint64 inclusion_distance = 15 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
}
repeated IndividualVote individual_votes = 1;
}
message WeakSubjectivityCheckpoint {
// The block root of weak subjectivity checkpoint.
bytes block_root = 1;
// The state root of weak subjectivity checkpoint.
bytes state_root = 2;
// The epoch of weak subjectivity checkpoint.
uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
}
// Copyright 2020 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.eth.v1alpha1;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "eth/ext/options.proto";
option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth";
option java_multiple_files = true;
option java_outer_classname = "NodeProto";
option java_package = "org.ethereum.eth.v1alpha1";
option php_namespace = "Ethereum\\Eth\\v1alpha1";
// Node service API
//
// Node service provides general information about the node itself, the services
// it supports, chain information and node version.
service Node {
// Retrieve the current network sync status of the node.
rpc GetSyncStatus(google.protobuf.Empty) returns (SyncStatus) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/syncing"
};
}
// Retrieve information about the genesis of Ethereum proof of stake.
rpc GetGenesis(google.protobuf.Empty) returns (Genesis) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/genesis"
};
}
// Retrieve information about the running Ethereum Beacon Node.
rpc GetVersion(google.protobuf.Empty) returns (Version) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/version"
};
}
// Retrieve the list of services implemented and enabled by this node.
//
// Any service not present in this list may return UNIMPLEMENTED or
// PERMISSION_DENIED. The server may also support fetching services by grpc
// reflection.
rpc ListImplementedServices(google.protobuf.Empty) returns (ImplementedServices) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/services"
};
}
// Retrieves the peer data of the local peer.
rpc GetHost(google.protobuf.Empty) returns (HostData) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/p2p"
};
}
// Retrieve the peer corresponding to the provided peer id.
rpc GetPeer(PeerRequest) returns (Peer) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/peer"
};
}
// Retrieve the list of peers currently connected to this node.
rpc ListPeers(google.protobuf.Empty) returns (Peers) {
option (google.api.http) = {
get: "/eth/v1alpha1/node/peers"
};
}
}
// Information about the current network sync status of the node.
message SyncStatus {
// Whether or not the node is currently syncing.
bool syncing = 1;
}
// Information about the genesis of Ethereum proof of stake.
message Genesis {
// UTC time specified in the chain start event in the deposit contract.
google.protobuf.Timestamp genesis_time = 1;
// Address of the deposit contract in the Ethereum 1 chain.
bytes deposit_contract_address = 2;
// Root of the genesis validators deposits; used for domain separation
// when signing data structures for this chain.
bytes genesis_validators_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
}
// Information about the node version.
message Version {
// A string that uniquely identifies the node and its version.
string version = 1;
// Additional metadata that the node would like to provide. This field may
// be used to list any meaningful data to the client.
string metadata = 2;
}
message ImplementedServices {
repeated string services = 1;
}
message PeerRequest {
// Peer id of the peer requested.
string peer_id = 1;
}
// Peers is a list of peer messages.
message Peers {
repeated Peer peers = 1;
}
// Peer provides details of a peer on the network.
message Peer {
// The address of the peer, as a full multiaddr, for example:
// /ip4/37.221.192.134/tcp/13000/p2p/16Uiu2HAm8maLMjag1TAUM52zPfmLbVMGFdwUAWgoHu1HDQLR6e17
string address = 1;
// The direction of the connection (inbound/outbound).
PeerDirection direction = 2;
// The connection state of the peer at the moment of the request. (e.g. Connecting)
ConnectionState connection_state = 3;
// The peer id of the peer.
string peer_id = 4;
// The latest ENR of the peer that's in the record.
string enr = 5;
}
// P2P Data on the local host.
message HostData{
// All the multiaddress of the peer, specified as a full multiaddr, for example:
// /ip4/37.221.192.134/tcp/13000/p2p/16Uiu2HAm8maLMjag1TAUM52zPfmLbVMGFdwUAWgoHu1HDQLR6e17
repeated string addresses = 1;
// The peer id of the peer.
string peer_id = 2;
// The latest ENR of the local peer.
string enr = 3;
}
// PeerDirection states the direction of the connection to a peer.
enum PeerDirection {
UNKNOWN = 0;
INBOUND = 1;
OUTBOUND = 2;
}
// ConnectionState states the current status of the peer.
enum ConnectionState {
DISCONNECTED = 0;
DISCONNECTING = 1;
CONNECTED = 2;
CONNECTING = 3;
}
// Copyright 2020 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.
// This is an optional proto that provides some gRPC gateway metadata for
// generating the OpenAPIv2(swagger) header.
syntax = "proto3";
package ethereum.eth.v1alpha1;
import "protoc-gen-openapiv2/options/annotations.proto";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "Ethereum Serenity APIs";
version: "v1alpha1";
license: {
name: "Licenced under Apache 2.0";
url: "http://www.apache.org/licenses/LICENSE-2.0";
};
description: "{{ index . "description" }}";
};
external_docs: {
url: "https://github.com/ethereum/eth2.0-specs";
description: "Ethereum Consensus Specification on Github";
};
host: "api.prylabs.net",
schemes: HTTPS;
schemes: WSS;
consumes: "application/json";
consumes: "application/grpc-web-text";
consumes: "application/grpc-web-json";
produces: "application/json";
produces: "application/grpc-web-text";
produces: "application/grpc-web-json";
};
{
"swagger": "2.0",
"info": {
"title": "Ethereum Serenity APIs",
"description": "{{ index . description }}",
"version": "v1alpha1",
"license": {
"name": "Licenced under Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0"
}
},
"host": "api.prylabs.net",
"schemes": [
"https",
"wss"
],
"consumes": [
"application/json",
"application/grpc-web-text",
"application/grpc-web-json"
],
"produces": [
"application/json",
"application/grpc-web-text",
"application/grpc-web-json"
],
"paths": {},
"definitions": {
"protobufAny": {
"type": "object",
"properties": {
"typeUrl": {
"type": "string"
},
"value": {
"type": "string",
"format": "byte"
}
}
},
"rpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"$ref": "#/definitions/protobufAny"
}
}
}
}
},
"externalDocs": {
"description": "Ethereum 2.0 Specification on Github",
"url": "https://github.com/ethereum/eth2.0-specs"
}
}
[![Build status](https://badge.buildkite.com/62be08099e9e228b165c2dba69c637eb9ca7a1ca95efd54b9f.svg?branch=master)](https://buildkite.com/prysmatic-labs/ethereum-apis)[![Discord](https://user-images.githubusercontent.com/7288322/34471967-1df7808a-efbb-11e7-9088-ed0b04151291.png)](https://discord.gg/KSA7rPr)[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/prysmaticlabs/geth-sharding?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)[![ETH2.0_Spec_Version 0.12.1](https://img.shields.io/badge/ETH2.0%20Spec%20Version-v0.12.1-blue.svg)](https://github.com/ethereum/eth2.0-specs/tree/v0.12.1)
This swagger site hosts the service interface definitions for the Ethereum Serenity JSON API.
## Service Overview
At the core of Ethereum Serenity lies the "Beacon Chain", a proof-of-stake based blockchain managing a set of validators and "shards" across a network, which are stateful, smaller blockchains used for transaction and smart contract execution. The Beacon Chain reconciles consensus results across shards to provide the backbone of Ethereum Serenity. The services below allow for retrieval of current and historical information relating to validators, consensus, blocks, and staking participation.
| Package | Service | Version | Description |
|---------|---------|---------|-------------|
| eth | BeaconChain | v1alpha1 | This service is used to retrieve critical data relevant to the Ethereum Beacon Chain, including the most recent head block, current pending deposits, the chain state and more. |
| eth | Node | v1alpha1 | The Node service returns information about the Ethereum node itself, including versioning and general information as well as network sync status and a list of services currently implemented on the node.
| eth | Validator | v1alpha1 | This API provides the information a validator needs to retrieve throughout its lifecycle, including recieved assignments from the network, its current index in the state, as well the rewards and penalties that have been applied to it.
### JSON Mapping
The majority of field primitive types for Ethereum are either `bytes` or `uint64`. The canonical JSON mapping for those fields are a Base64 encoded string for `bytes`, or a string representation of `uint64`. Since JavaScript loses precision for values over [MAX_SAFE_INTEGER](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER), uint64 must be a JSON string in order to accommodate those values. If the field value not changed and is still set to protobuf's default, this field will be omitted from the JSON encoding entirely.
For more details on JSON mapping for other types, view the relevant section in the [proto3 language guide](https://developers.google.com/protocol-buffers/docs/proto3#json).
### Helpful gRPC Tooling and Resources
- [Google's API Style Guide](https://cloud.google.com/apis/design/)
- [Language reference for protoc3](https://developers.google.com/protocol-buffers/docs/proto3)
- [Awesome gRPC](https://github.com/grpc-ecosystem/awesome-grpc)
- [Protocol Buffer Basics: Go](https://developers.google.com/protocol-buffers/docs/gotutorial)
- [Transcoding gRPC to JSON/HTTP using Envoy](https://blog.jdriven.com/2018/11/transcoding-grpc-to-http-json-using-envoy/)
## Contributing
We have put all of our contribution guidelines into [CONTRIBUTING.md](https://github.com/prysmaticlabs/prysm/blob/master/CONTRIBUTING.md)! Check it out to get started.
\ No newline at end of file
// Copyright 2021 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.eth.v1alpha1;
import "eth/ext/options.proto";
option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth";
option java_multiple_files = true;
option java_outer_classname = "SyncCommitteeProto";
option java_package = "org.ethereum.eth.v1alpha1";
option php_namespace = "Ethereum\\Eth\\v1alpha1";
// Sync committee object to support light client.
message SyncCommitteeSignature {
// Slot to which this contribution pertains.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// 32 byte block root for this signature.
bytes block_root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// Index of the validator that produced this signature.
uint64 validator_index = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// Signature by the validator over the block root of `slot`.
bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"];
}
// Aggregated sync committee object to support light client.
message SyncCommitteeContribution {
// Slot to which this contribution pertains.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// 32 byte block root for this signature.
bytes block_root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// The subcommittee this contribution pertains to out of the broader sync committee.
uint64 subcommittee_index = 3;
// A bit is set if a signature from the validator at the corresponding
// index in the subcommittee is present in the aggregate `signature`.
bytes aggregation_bits = 4 [(ethereum.eth.ext.ssz_size) = "32"];
// Signature by the validator(s) over the block root of `slot`.
bytes signature = 5 [(ethereum.eth.ext.ssz_size) = "96"];
}
// Aggregated sync committee signature object with selection proof to support light client.
message ContributionAndProof {
// Index of the aggregator that produced this proof.
uint64 aggregator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
SyncCommitteeContribution contribution = 2;
// The selection proof itself.
bytes selection_proof = 3 [(ethereum.eth.ext.ssz_size) = "96"];
}
// Signed aggregated sync committee signature object with selection proof to support light client.
message SignedContributionAndProof {
ContributionAndProof message = 1;
// Signature of the aggregator that produced `message`.
bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"];
}
// Copyright 2020 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.eth.v1alpha1;
import "google/api/annotations.proto";
import "google/protobuf/empty.proto";
import "eth/ext/options.proto";
import "eth/v1alpha1/beacon_block.proto";
import "eth/v1alpha1/attestation.proto";
option csharp_namespace = "Ethereum.Eth.v1alpha1";
option go_package = "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1;eth";
option java_multiple_files = true;
option java_outer_classname = "ValidatorProto";
option java_package = "org.ethereum.eth.v1alpha1";
option php_namespace = "Ethereum\\Eth\\v1alpha1";
// Beacon node validator API
//
// The beacon node validator API enables a validator to connect
// and perform its obligations on the Ethereum Beacon Chain.
service BeaconNodeValidator {
// Retrieves validator duties for the requested validators.
//
// The duties consist of:
// Proposer - the validator that creates a beacon chain block.
// Attester — a validator that is part of a committee that needs to sign off on a beacon chain
// block while simultaneously creating a cross link to a recent shard block on a particular shard chain.
// The server returns a list of duties which are the actions should be performed by validators for a given epoch.
// Validator duties should be polled every epoch, but due to chain reorg of >MIN_SEED_LOOKAHEAD could occur,
// the validator duties could chain. For complete safety, it is recommended to poll at every slot to ensure
// validator is fully aware of any sudden chain reorg.
rpc GetDuties(DutiesRequest) returns (DutiesResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/validator/duties"
};
}
// Stream validator duties for the requested validators.
//
// The duties consist of:
// Proposer - the validator that creates a beacon chain block.
// Attester — a validator that is part of a committee that needs to sign off on a beacon chain
rpc StreamDuties(DutiesRequest) returns (stream DutiesResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/validator/duties/stream"
};
}
// DomainData fetches the current BLS signature domain version information from the
// running beacon node's state. This information is used when validators sign
// blocks and attestations appropriately based on their duty.
rpc DomainData(DomainRequest) returns (DomainResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/validator/domain"
};
}
// WaitForChainStart queries the logs of the Validator Deposit Contract on the Ethereum
// proof-of-work chain to verify the beacon chain has started its runtime and
// validators are ready to begin their responsibilities.
//
// If the chain has not yet started, this endpoint starts a server-side stream which updates
// the client when the beacon chain is ready.
rpc WaitForChainStart(google.protobuf.Empty) returns (stream ChainStartResponse) {
option deprecated = true;
option (google.api.http) = {
get: "/eth/v1alpha1/validator/chainstart/stream"
};
}
// WaitForActivation checks if a validator public key exists in the active validator
// registry of the current beacon state. If the validator is NOT yet active, it starts a
// server-side stream which updates the client whenever the validator becomes active in
// the beacon node's state.
//
// The input to this endpoint is a list of validator public keys, and the corresponding
// stream will respond until at least a single corresponding validator to those
// keys is activated.
rpc WaitForActivation(ValidatorActivationRequest) returns (stream ValidatorActivationResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/validator/activation/stream"
};
}
// ValidatorIndex retrieves a validator's index location in the beacon state's
// validator registry looking up whether the validator exists based on its
// public key. This method returns NOT_FOUND if no index is found for the public key
// specified in the request.
rpc ValidatorIndex(ValidatorIndexRequest) returns (ValidatorIndexResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/validator/index"
};
}
// ValidatorStatus returns a validator's status based on the current epoch.
// The request can specify either a validator's public key or validator index.
//
// The status response can be one of the following:
// DEPOSITED - validator's deposit has been recognized by Ethereum 1, not yet recognized by Ethereum.
// PENDING - validator is in Ethereum's activation queue.
// ACTIVE - validator is active.
// EXITING - validator has initiated an an exit request, or has dropped below the ejection balance and is being kicked out.
// EXITED - validator is no longer validating.
// SLASHING - validator has been kicked out due to meeting a slashing condition.
// UNKNOWN_STATUS - validator does not have a known status in the network.
rpc ValidatorStatus(ValidatorStatusRequest) returns (ValidatorStatusResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/validator/status"
};
}
// MultipleValidatorStatus returns a list of validator statuses on the current epoch.
// The request can specify a list of validator public keys.
//
// Returns a list of ValidatorStatusResponses.
rpc MultipleValidatorStatus(MultipleValidatorStatusRequest) returns (MultipleValidatorStatusResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/validator/statuses"
};
}
// Retrieves the latest valid beacon block to be proposed on the beacon chain.
//
// The server returns a new beacon block, without proposer signature, that can be
// proposed on the beacon chain. The block should be filled with all the necessary
// data for proposer to sign.
rpc GetBlock(BlockRequest) returns (BeaconBlock) {
option (google.api.http) = {
get: "/eth/v1alpha1/validator/block"
};
}
// Sends the newly signed beacon block to beacon node.
//
// The validator sends the newly signed beacon block to the beacon node so the beacon block can
// be included in the beacon chain. The beacon node is expected to validate and process the
// beacon block into its state.
rpc ProposeBlock(SignedBeaconBlock) returns (ProposeResponse) {
option (google.api.http) = {
post: "/eth/v1alpha1/validator/block"
body: "*"
};
}
// Retrieves the latest valid attestation data to be attested on the beacon chain.
//
// The server returns the latest valid data which represents the correct vote
// for the head of the beacon chain.
rpc GetAttestationData(AttestationDataRequest) returns (AttestationData) {
option (google.api.http) = {
get: "/eth/v1alpha1/validator/attestation"
};
}
// Sends the newly signed attestation to beacon node.
//
// The validator sends the newly signed attestation to the beacon node for the attestation to
// be included in the beacon chain. The beacon node is expected to validate and publish attestation on
// appropriate committee subnet.
rpc ProposeAttestation(Attestation) returns (AttestResponse) {
option (google.api.http) = {
post: "/eth/v1alpha1/validator/attestation"
body: "*"
};
}
// Submit selection proof to the beacon node to aggregate all matching wire attestations with the same data root.
// the beacon node responses with an aggregate and proof object back to validator to sign over.
rpc SubmitAggregateSelectionProof(AggregateSelectionRequest) returns (AggregateSelectionResponse) {
option (google.api.http) = {
post: "/eth/v1alpha1/validator/aggregate"
body: "*"
};
}
// Submit a signed aggregate and proof object, the beacon node will broadcast the
// signed aggregated attestation and proof object.
rpc SubmitSignedAggregateSelectionProof(SignedAggregateSubmitRequest) returns (SignedAggregateSubmitResponse) {
option (google.api.http) = {
post: "/eth/v1alpha1/validator/aggregate"
body: "*"
};
}
// Propose to leave the list of active validators.
//
// The beacon node is expected to validate the request and make it available for inclusion in
// the next proposed block.
rpc ProposeExit(SignedVoluntaryExit) returns (ProposeExitResponse) {
option (google.api.http) = {
post: "/eth/v1alpha1/validator/exit"
body: "*"
};
}
// Subscribe to particular committee ID subnets given validator's duty.
//
// The beacon node is expected to subscribe to the committee ID subnet given by the request. With this,
// beacon node serving attesters can find persistent peers on the subnet to publish attestation,
// and beacon node serving aggregator can join the subnet.
rpc SubscribeCommitteeSubnets(CommitteeSubnetsSubscribeRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
post: "/eth/v1alpha1/validator/subnet/subscribe"
body: "*"
};
}
// Checks the beacon node if another instance of the provided validator keys have been
// attesting/proposing for you.
rpc CheckDoppelGanger(DoppelGangerRequest) returns (DoppelGangerResponse) {
option (google.api.http) = {
get: "/eth/v1alpha1/validator/doppelganger"
};
}
}
message DomainRequest {
// The epoch for which the domain is being requested.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// The bytes domain specified by the validator.
bytes domain = 2;
}
message DomainResponse {
// The signature domain is a byte array used by validators when
// signing data related to block proposals and attestations.
bytes signature_domain = 1;
}
message ValidatorActivationRequest {
// A list of 48 byte validator public keys.
repeated bytes public_keys = 1 [(ethereum.eth.ext.ssz_size) = "?,48"];
}
message ValidatorActivationResponse {
message Status {
// A 48 byte validator public key.
bytes public_key = 1;
// A wrapper representing a validator's status object.
ValidatorStatusResponse status = 2;
// The validators index in the beacon state.
uint64 index = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
}
// A list of validator statuses mapped 1-to-1 with the public keys
// in the request.
repeated Status statuses = 1;
}
message ChainStartResponse {
// A boolean specifying whether or not the chain has started.
bool started = 1;
// The genesis time of the beacon chain.
uint64 genesis_time = 2;
// 32 byte hash tree root of the genesis validator set.
bytes genesis_validators_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
}
message SyncedResponse {
// A boolean specifying whether or not the beacon node is synced and ready for the validator.
bool synced = 1;
// The genesis time of the beacon chain.
uint64 genesis_time = 2;
}
message ValidatorIndexRequest {
// A 48 byte validator public key.
bytes public_key = 1 [(ethereum.eth.ext.ssz_size) = "48"];
}
message ValidatorIndexResponse {
// The validator's index in the beacon chain state's validator registry.
uint64 index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
}
message ValidatorStatusRequest {
// A 48 byte validator public key.
bytes public_key = 1 [(ethereum.eth.ext.ssz_size) = "48"];
}
enum ValidatorStatus {
UNKNOWN_STATUS = 0;
DEPOSITED = 1;
PENDING = 2;
ACTIVE = 3;
EXITING = 4;
SLASHING = 5;
EXITED = 6;
INVALID = 7;
PARTIALLY_DEPOSITED = 8;
}
message ValidatorStatusResponse {
// The corresponding validator status.
ValidatorStatus status = 1;
// The block number of the Ethereum proof-of-work chain
// where the deposit for the validator was included.
uint64 eth1_deposit_block_number = 2;
// The slot in the beacon chain in which the validator's
// deposit was included in a block.
uint64 deposit_inclusion_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// The epoch in the beacon chain in which the validator
// is determined as active.
uint64 activation_epoch = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// The position in the activation queue of pending validators.
uint64 position_in_activation_queue = 5;
}
message MultipleValidatorStatusRequest {
// A list of 48 byte validator public keys.
repeated bytes public_keys = 1 [(ethereum.eth.ext.ssz_size) = "?,48"];
// A list of validator indices.
repeated int64 indices = 2;
}
message MultipleValidatorStatusResponse {
// A list of 48 byte validator public keys.
repeated bytes public_keys = 1 [(ethereum.eth.ext.ssz_size) = "?,48"];
// A list of ValidatorStatusResponses mapped 1-to-1 with the public keys.
repeated ValidatorStatusResponse statuses = 2;
// A list of validator indices.
repeated uint64 indices = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
}
message DutiesRequest {
// Epoch at which validators should perform their duties.
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Array of byte encoded BLS public keys.
repeated bytes public_keys = 2 [(ethereum.eth.ext.ssz_size) = "?,48"];
}
message DutiesResponse {
repeated Duty duties = 1 [deprecated = true];
repeated Duty current_epoch_duties = 2;
repeated Duty next_epoch_duties = 3;
message Duty {
// The committee a validator is assigned to.
repeated uint64 committee = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// The index into the committee where the validator belongs in.
uint64 committee_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.CommitteeIndex"];
// Slot at which a validator must attest.
uint64 attester_slot = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Slots at which a validator must propose a beacon chain block.
repeated uint64 proposer_slots = 4 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// 48 byte BLS public key for the validator who's assigned to perform a duty.
bytes public_key = 5 [(ethereum.eth.ext.ssz_size) = "48"];
// The current status of the validator assigned to perform the duty.
ValidatorStatus status = 6;
// The index of the validator in the beacon state.
uint64 validator_index = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// Whether the validator belongs in the sync committee and has to perform sync committee duty.
bool is_sync_committee = 8;
}
}
message BlockRequest {
// Slot for which the block should be proposed.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Validator's 32 byte randao reveal secret of the current epoch.
bytes randao_reveal = 2 [(ethereum.eth.ext.ssz_size) = "48"];
// Validator's 32 byte graffiti message for the new block.
bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
}
message ProposeResponse {
// The block root of the successfully proposed beacon block.
bytes block_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
}
message ProposeExitResponse {
// The root of the successfully proposed voluntary exit.
bytes exit_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
}
message AttestationDataRequest {
// Slot for which the attestation should be created.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Committee index the attestation should be created for.
uint64 committee_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.CommitteeIndex"];
}
message AttestResponse {
// The root of the attestation data successfully submitted to the beacon node.
bytes attestation_data_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
}
message AggregateSelectionRequest {
// Slot for which the aggregation request applies.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// Committee index of the validator at the given slot.
uint64 committee_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.CommitteeIndex"];
// 48 byte public key of the validator.
bytes public_key = 3 [(ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey"];
// 96 byte signature of the validator on the slot. This is used as proof that the validator is
// an aggregator for the given slot.
bytes slot_signature = 4 [(ethereum.eth.ext.ssz_size) = "96"];
}
message AggregateSelectionResponse {
// The aggregate and proof message without the signature.
AggregateAttestationAndProof aggregate_and_proof = 1;
}
message SignedAggregateSubmitRequest {
// The signed aggregate and proof message with the signature.
SignedAggregateAttestationAndProof signed_aggregate_and_proof = 1;
}
message SignedAggregateSubmitResponse {
// The 32 byte hash tree root of the aggregated attestation data.
bytes attestation_data_root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
}
message CommitteeSubnetsSubscribeRequest {
// A list of intended slots to subscribe.
repeated uint64 slots = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Slot"];
// A list of intended committee ids to subscribe. It is mapped 1-to-1 with the slots
repeated uint64 committee_ids = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.CommitteeIndex"];
// Whether to subscribe as an aggregator or by default attester.
// It is mapped 1-to-1 with the slots and committee ids.
// Subscribe as an aggregator means to join the subnet.
// Subscribe as an attester means finding persistent peers on the subnet to be able to publish attestations.
repeated bool is_aggregator = 3;
}
// An Ethereum validator.
message Validator {
// 48 byte BLS public key used for the validator's activities.
bytes public_key = 1 [(ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey"];
// 32 byte hash of the withdrawal destination public key.
bytes withdrawal_credentials = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// The validators current effective balance in gwei.
uint64 effective_balance = 3;
// Whether or not the validator has been slashed.
bool slashed = 4;
// Epoch when the validator became eligible for activation. This field may
// be zero if the validator was present in the Ethereum proof of stake genesis. This
// field is FAR_FUTURE_EPOCH if the validator has not been activated.
uint64 activation_eligibility_epoch = 5 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Epoch when the validator was activated. This field may be zero if the
// validator was present in the Ethereum proof of stake genesis. This field is
// FAR_FUTURE_EPOCH if the validator has not been activated.
uint64 activation_epoch = 6 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Epoch when the validator was exited. This field is FAR_FUTURE_EPOCH if
// the validator has not exited.
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum Beacon Chain specification:
// https://github.com/ethereum/eth2.0-specs/blob/v0.9.2/specs/core/0_beacon-chain.md#constants
uint64 exit_epoch = 7 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// Epoch when the validator is eligible to withdraw their funds. This field
// is FAR_FUTURE_EPOCH if the validator has not exited.
// FAR_FUTURE_EPOCH is a constant defined by the official Ethereum Beacon Chain specification:
// https://github.com/ethereum/eth2.0-specs/blob/v0.9.2/specs/core/0_beacon-chain.md#constants
uint64 withdrawable_epoch = 8 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
}
// ValidatorParticipation stores participation metrics during a given epoch.
message ValidatorParticipation {
// Percentage of validator participation in the given epoch. This field
// contains a value between 0 and 1.
float global_participation_rate = 1 [deprecated = true];
// The total amount of ether, in gwei, that has been used in voting.
uint64 voted_ether = 2 [deprecated = true];
// The total amount of ether, in gwei, that is eligible for voting.
uint64 eligible_ether = 3 [deprecated = true];
// Total staked gwei that was active (i.e. eligible to vote) during the current epoch.
uint64 current_epoch_active_gwei = 4;
// Total staked gwei that had attestations included in a block during the current epoch,
// attestations by the same validator do not increase this figure.
uint64 current_epoch_attesting_gwei = 5;
// Total staked gwei that attested to the majority-elected Casper FFG target epoch during the current epoch.
uint64 current_epoch_target_attesting_gwei = 6;
// Same as current_epoch_active_gwei but for previous epoch.
uint64 previous_epoch_active_gwei = 7;
// Same as current_epoch_attesting_gwei but for previous epoch.
uint64 previous_epoch_attesting_gwei = 8;
// Same as current_epoch_target_attesting_gwei but for previous epoch.
uint64 previous_epoch_target_attesting_gwei = 9;
// Total staked gwei that attested to a head beacon block that is in the canonical chain.
uint64 previous_epoch_head_attesting_gwei = 10;
}
// ValidatorInfo gives information about the state of a validator at a certain epoch.
message ValidatorInfo {
// The validator's 48 byte BLS public key.
bytes public_key = 1;
// The validator's index in the beacon state.
uint64 index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.ValidatorIndex"];
// The epoch for which the information pertains.
uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// The validator's current status.
ValidatorStatus status = 4;
// The unix timestamp when the validator enters the next state.
// This could be in the past. Some values depend on chain operation and so will vary from epoch to epoch.
// Specific times for each state are as follows:
// - state == DEPOSITED: time at which Ethereum 1 deposit will be stored on-chain by Ethereum (variable, can be 0).
// - state == PENDING: time at which validator will be activated (variable).
// - state == ACTIVE: no value (next transition depends on user and network actions).
// - state == EXITING: time at which validator will exit.
// - state == SLASHING: time at which validator will exit.
// - state == EXITED: time at which validator funds will be withdrawable.
uint64 transition_timestamp = 5;
// The validator's current balance in GWei.
uint64 balance = 6;
// The validator's current effective balance in GWei.
// Only valid for states ACTIVE, EXITING, SLASHING.
uint64 effective_balance = 7;
}
// DoppelGangerRequest represents the request sent by the validator in order to determine
// if there is any duplicate instance of it running in the network.
message DoppelGangerRequest {
repeated ValidatorRequest validator_requests = 1;
// ValidatorRequest data type which represents a request for each validator.
message ValidatorRequest {
// The validator's 48 byte BLS public key.
bytes public_key = 1 [(ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey"];
// The validator's last recorded epoch to attest.
uint64 epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/eth2-types.Epoch"];
// The validator's last recorded signed root.
bytes signed_root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
}
}
// DoppelGangerResponse is the response payload sent by the beacon node
// after it has checked for all duplicate keys in the network.
message DoppelGangerResponse {
message ValidatorResponse {
// The validator's 48 byte BLS public key.
bytes public_key = 1 [(ethereum.eth.ext.ssz_size) = "48", (ethereum.eth.ext.spec_name) = "pubkey"];
// Whether a duplicate of the validator exists.
bool duplicate_exists = 2;
}
repeated ValidatorResponse responses = 1;
}
package wrapper
import (
"github.com/pkg/errors"
types "github.com/prysmaticlabs/eth2-types"
eth "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
"github.com/prysmaticlabs/prysm/proto/interfaces"
prysmv2 "github.com/prysmaticlabs/prysm/proto/prysm/v2"
"github.com/prysmaticlabs/prysm/shared/copyutil"
"github.com/prysmaticlabs/prysm/shared/version"
"google.golang.org/protobuf/proto"
)
// Phase0SignedBeaconBlock is a convenience wrapper around a phase 0 beacon block
// object. This wrapper allows us to conform to a common interface so that beacon
// blocks for future forks can also be applied across prysm without issues.
type Phase0SignedBeaconBlock struct {
b *eth.SignedBeaconBlock
}
// WrappedPhase0SignedBeaconBlock is constructor which wraps a protobuf phase 0 block
// with the block wrapper.
func WrappedPhase0SignedBeaconBlock(b *eth.SignedBeaconBlock) interfaces.SignedBeaconBlock {
return Phase0SignedBeaconBlock{b: b}
}
// Signature returns the respective block signature.
func (w Phase0SignedBeaconBlock) Signature() []byte {
return w.b.Signature
}
// Block returns the underlying beacon block object.
func (w Phase0SignedBeaconBlock) Block() interfaces.BeaconBlock {
return WrappedPhase0BeaconBlock(w.b.Block)
}
// IsNil checks if the underlying beacon block is
// nil.
func (w Phase0SignedBeaconBlock) IsNil() bool {
return w.b == nil || w.Block().IsNil()
}
// Copy performs a deep copy of the signed beacon block
// object.
func (w Phase0SignedBeaconBlock) Copy() interfaces.SignedBeaconBlock {
return WrappedPhase0SignedBeaconBlock(copyutil.CopySignedBeaconBlock(w.b))
}
// MarshalSSZ marshals the signed beacon block to its relevant ssz
// form.
func (w Phase0SignedBeaconBlock) MarshalSSZ() ([]byte, error) {
return w.b.MarshalSSZ()
}
// MarshalSSZTo marshals the signed beacon block to its relevant ssz
// form to the provided byte buffer.
func (w Phase0SignedBeaconBlock) MarshalSSZTo(dst []byte) ([]byte, error) {
return w.b.MarshalSSZTo(dst)
}
// SizeSSZ returns the size of serialized signed block
func (w Phase0SignedBeaconBlock) SizeSSZ() int {
return w.b.SizeSSZ()
}
// UnmarshalSSZ unmarshalls the signed beacon block from its relevant ssz
// form.
func (w Phase0SignedBeaconBlock) UnmarshalSSZ(buf []byte) error {
return w.b.UnmarshalSSZ(buf)
}
// Proto returns the block in its underlying protobuf
// interface.
func (w Phase0SignedBeaconBlock) Proto() proto.Message {
return w.b
}
// PbPhase0Block returns the underlying protobuf object.
func (w Phase0SignedBeaconBlock) PbPhase0Block() (*eth.SignedBeaconBlock, error) {
return w.b, nil
}
// AltairBlock returns the underlying protobuf object.
func (w Phase0SignedBeaconBlock) PbAltairBlock() (*prysmv2.SignedBeaconBlockAltair, error) {
return nil, errors.New("unsupported altair block")
}
// Version of the underlying protobuf object.
func (w Phase0SignedBeaconBlock) Version() int {
return version.Phase0
}
// Phase0BeaconBlock is the wrapper for the actual block.
type Phase0BeaconBlock struct {
b *eth.BeaconBlock
}
// WrappedPhase0BeaconBlock is constructor which wraps a protobuf phase 0 object
// with the block wrapper.
func WrappedPhase0BeaconBlock(b *eth.BeaconBlock) interfaces.BeaconBlock {
return Phase0BeaconBlock{b: b}
}
// Slot returns the respective slot of the block.
func (w Phase0BeaconBlock) Slot() types.Slot {
return w.b.Slot
}
// ProposerIndex returns proposer index of the beacon block.
func (w Phase0BeaconBlock) ProposerIndex() types.ValidatorIndex {
return w.b.ProposerIndex
}
// ParentRoot returns the parent root of beacon block.
func (w Phase0BeaconBlock) ParentRoot() []byte {
return w.b.ParentRoot
}
// StateRoot returns the state root of the beacon block.
func (w Phase0BeaconBlock) StateRoot() []byte {
return w.b.StateRoot
}
// Body returns the underlying block body.
func (w Phase0BeaconBlock) Body() interfaces.BeaconBlockBody {
return WrappedPhase0BeaconBlockBody(w.b.Body)
}
// IsNil checks if the beacon block is nil.
func (w Phase0BeaconBlock) IsNil() bool {
return w.b == nil || w.Body().IsNil()
}
// HashTreeRoot returns the ssz root of the block.
func (w Phase0BeaconBlock) HashTreeRoot() ([32]byte, error) {
return w.b.HashTreeRoot()
}
// MarshalSSZ marshals the block into its respective
// ssz form.
func (w Phase0BeaconBlock) MarshalSSZ() ([]byte, error) {
return w.b.MarshalSSZ()
}
// MarshalSSZTo marshals the beacon block to its relevant ssz
// form to the provided byte buffer.
func (w Phase0BeaconBlock) MarshalSSZTo(dst []byte) ([]byte, error) {
return w.b.MarshalSSZTo(dst)
}
// SizeSSZ returns the size of serialized block.
func (w Phase0BeaconBlock) SizeSSZ() int {
return w.b.SizeSSZ()
}
// UnmarshalSSZ unmarshalls the beacon block from its relevant ssz
// form.
func (w Phase0BeaconBlock) UnmarshalSSZ(buf []byte) error {
return w.b.UnmarshalSSZ(buf)
}
// Proto returns the underlying block object in its
// proto form.
func (w Phase0BeaconBlock) Proto() proto.Message {
return w.b
}
// Version of the underlying protobuf object.
func (w Phase0BeaconBlock) Version() int {
return version.Phase0
}
// Phase0BeaconBlockBody is a wrapper of a beacon block body.
type Phase0BeaconBlockBody struct {
b *eth.BeaconBlockBody
}
// WrappedPhase0BeaconBlockBody is constructor which wraps a protobuf phase 0 object
// with the block wrapper.
func WrappedPhase0BeaconBlockBody(b *eth.BeaconBlockBody) interfaces.BeaconBlockBody {
return Phase0BeaconBlockBody{b: b}
}
// RandaoReveal returns the randao reveal from the block body.
func (w Phase0BeaconBlockBody) RandaoReveal() []byte {
return w.b.RandaoReveal
}
// Eth1Data returns the eth1 data in the block.
func (w Phase0BeaconBlockBody) Eth1Data() *eth.Eth1Data {
return w.b.Eth1Data
}
// Graffiti returns the graffiti in the block.
func (w Phase0BeaconBlockBody) Graffiti() []byte {
return w.b.Graffiti
}
// ProposerSlashings returns the proposer slashings in the block.
func (w Phase0BeaconBlockBody) ProposerSlashings() []*eth.ProposerSlashing {
return w.b.ProposerSlashings
}
// AttesterSlashings returns the attester slashings in the block.
func (w Phase0BeaconBlockBody) AttesterSlashings() []*eth.AttesterSlashing {
return w.b.AttesterSlashings
}
// Attestations returns the stored attestations in the block.
func (w Phase0BeaconBlockBody) Attestations() []*eth.Attestation {
return w.b.Attestations
}
// Deposits returns the stored deposits in the block.
func (w Phase0BeaconBlockBody) Deposits() []*eth.Deposit {
return w.b.Deposits
}
// VoluntaryExits returns the voluntary exits in the block.
func (w Phase0BeaconBlockBody) VoluntaryExits() []*eth.SignedVoluntaryExit {
return w.b.VoluntaryExits
}
// SyncAggregate returns the sync aggregate in the block.
func (w Phase0BeaconBlockBody) SyncAggregate() (*prysmv2.SyncAggregate, error) {
return nil, errors.New("Sync aggregate is not supported in phase 0 block")
}
// IsNil checks if the block body is nil.
func (w Phase0BeaconBlockBody) IsNil() bool {
return w.b == nil
}
// HashTreeRoot returns the ssz root of the block body.
func (w Phase0BeaconBlockBody) HashTreeRoot() ([32]byte, error) {
return w.b.HashTreeRoot()
}
// Proto returns the underlying proto form of the block
// body.
func (w Phase0BeaconBlockBody) Proto() proto.Message {
return w.b
}
// Copyright 2021 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.eth.v2;
import "eth/ext/options.proto";
import "eth/v1/attestation.proto";
import "eth/v1/beacon_block.proto";
import "eth/v2/version.proto";
import "proto/engine/v1/execution_engine.proto";
option csharp_namespace = "Ethereum.Eth.V2";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v2;eth";
option java_multiple_files = true;
option java_outer_classname = "SyncCommitteeProto";
option java_package = "org.ethereum.eth.v2";
option php_namespace = "Ethereum\\Eth\\v2";
message BlockRequestV2 {
// The block identifier. Can be one of: "head" (canonical head in node's view), "genesis",
// "finalized", <slot>, <hex encoded blockRoot with 0x prefix>.
bytes block_id = 1;
}
message BlockResponseV2 {
v2.Version version = 1;
SignedBeaconBlockContainer data = 2;
bool execution_optimistic = 3;
}
message BlindedBlockResponse {
v2.Version version = 1;
SignedBlindedBeaconBlockContainer data = 2;
bool execution_optimistic = 3;
}
message BeaconBlockContainerV2 {
oneof block {
v1.BeaconBlock phase0_block = 1;
BeaconBlockAltair altair_block = 2;
BeaconBlockBellatrix bellatrix_block = 3;
}
}
message SignedBeaconBlockContainer {
oneof message {
v1.BeaconBlock phase0_block = 1;
BeaconBlockAltair altair_block = 2;
BeaconBlockBellatrix bellatrix_block = 3;
}
// 96 byte BLS signature from the validator that produced this block.
bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"];
}
message BlindedBeaconBlockContainer {
oneof block {
v1.BeaconBlock phase0_block = 1;
BeaconBlockAltair altair_block = 2;
BlindedBeaconBlockBellatrix bellatrix_block = 3;
}
}
message SignedBlindedBeaconBlockContainer {
oneof message {
v1.BeaconBlock phase0_block = 1;
BeaconBlockAltair altair_block = 2;
BlindedBeaconBlockBellatrix bellatrix_block = 3;
}
// 96 byte BLS signature from the validator that produced this block.
bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"];
}
message SignedBeaconBlockBellatrix {
BeaconBlockBellatrix message = 1;
// 96 byte BLS signature from the validator that produced this block.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message SignedBlindedBeaconBlockBellatrix {
BlindedBeaconBlockBellatrix message = 1;
// 96 byte BLS signature from the validator that produced this block.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
message SignedBeaconBlockAltair {
BeaconBlockAltair message = 1;
// 96 byte BLS signature from the validator that produced this block.
bytes signature = 2 [(ethereum.eth.ext.ssz_size) = "96"];
}
// The Ethereum consensus beacon block. The message does not contain a validator signature.
message BeaconBlockBellatrix {
// Beacon chain slot that this block represents.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// Validator index of the validator that proposed the block header.
uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// 32 byte root of the parent block.
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// 32 byte root of the resulting state after processing this block.
bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
// The block body itself.
BeaconBlockBodyBellatrix body = 5;
}
// The Ethereum consensus beacon block. The message does not contain a validator signature.
message BlindedBeaconBlockBellatrix {
// Beacon chain slot that this block represents.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// Validator index of the validator that proposed the block header.
uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// 32 byte root of the parent block.
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// 32 byte root of the resulting state after processing this block.
bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
// The block body itself.
BlindedBeaconBlockBodyBellatrix body = 5;
}
// The Ethereum consensus beacon block. The message does not contain a validator signature.
message BeaconBlockAltair {
// Beacon chain slot that this block represents.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// Validator index of the validator that proposed the block header.
uint64 proposer_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// 32 byte root of the parent block.
bytes parent_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// 32 byte root of the resulting state after processing this block.
bytes state_root = 4 [(ethereum.eth.ext.ssz_size) = "32"];
// The block body itself.
BeaconBlockBodyAltair body = 5;
}
message BeaconBlockBodyBellatrix {
// The validators RANDAO reveal 96 byte value.
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
// A reference to the Ethereum 1.x chain.
v1.Eth1Data eth1_data = 2;
// 32 byte field of arbitrary data. This field may contain any data and
// is not used for anything other than a fun message.
bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// Block operations
// Refer to spec constants at https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#max-operations-per-block
// At most MAX_PROPOSER_SLASHINGS.
repeated v1.ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_ATTESTER_SLASHINGS.
repeated v1.AttesterSlashing attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "2"];
// At most MAX_ATTESTATIONS.
repeated v1.Attestation attestations = 6 [(ethereum.eth.ext.ssz_max) = "128"];
// At most MAX_DEPOSITS.
repeated v1.Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_VOLUNTARY_EXITS.
repeated v1.SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"];
// Sync aggregate object to track sync committee votes for light client support.
v1.SyncAggregate sync_aggregate = 9;
// Execution payload: the embedded execution payload of the block [New in Bellatrix]
ethereum.engine.v1.ExecutionPayload execution_payload = 10;
}
message BlindedBeaconBlockBodyBellatrix {
// The validators RANDAO reveal 96 byte value.
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
// A reference to the Ethereum 1.x chain.
v1.Eth1Data eth1_data = 2;
// 32 byte field of arbitrary data. This field may contain any data and
// is not used for anything other than a fun message.
bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// Block operations
// Refer to spec constants at https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#max-operations-per-block
// At most MAX_PROPOSER_SLASHINGS.
repeated v1.ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_ATTESTER_SLASHINGS.
repeated v1.AttesterSlashing attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "2"];
// At most MAX_ATTESTATIONS.
repeated v1.Attestation attestations = 6 [(ethereum.eth.ext.ssz_max) = "128"];
// At most MAX_DEPOSITS.
repeated v1.Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_VOLUNTARY_EXITS.
repeated v1.SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"];
// Sync aggregate object to track sync committee votes for light client support.
v1.SyncAggregate sync_aggregate = 9;
// Execution payload header: the embedded execution payload of the block [New in Bellatrix]
ethereum.engine.v1.ExecutionPayloadHeader execution_payload_header = 10;
}
message BeaconBlockBodyAltair {
// The validators RANDAO reveal 96 byte value.
bytes randao_reveal = 1 [(ethereum.eth.ext.ssz_size) = "96"];
// A reference to the Ethereum 1.x chain.
v1.Eth1Data eth1_data = 2;
// 32 byte field of arbitrary data. This field may contain any data and
// is not used for anything other than a fun message.
bytes graffiti = 3 [(ethereum.eth.ext.ssz_size) = "32"];
// Block operations
// Refer to spec constants at https://github.com/ethereum/consensus-specs/blob/dev/specs/core/0_beacon-chain.md#max-operations-per-block
// At most MAX_PROPOSER_SLASHINGS.
repeated v1.ProposerSlashing proposer_slashings = 4 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_ATTESTER_SLASHINGS.
repeated v1.AttesterSlashing attester_slashings = 5 [(ethereum.eth.ext.ssz_max) = "2"];
// At most MAX_ATTESTATIONS.
repeated v1.Attestation attestations = 6 [(ethereum.eth.ext.ssz_max) = "128"];
// At most MAX_DEPOSITS.
repeated v1.Deposit deposits = 7 [(ethereum.eth.ext.ssz_max) = "16"];
// At most MAX_VOLUNTARY_EXITS.
repeated v1.SignedVoluntaryExit voluntary_exits = 8 [(ethereum.eth.ext.ssz_max) = "16"];
// Sync aggregate object to track sync committee votes for light client support. [New in ]
v1.SyncAggregate sync_aggregate = 9;
}
// Copyright 2021 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.eth.v2;
import "eth/ext/options.proto";
import "eth/v1/attestation.proto";
import "eth/v1/beacon_block.proto";
import "eth/v1/beacon_state.proto";
import "eth/v1/validator.proto";
import "eth/v2/sync_committee.proto";
import "eth/v2/version.proto";
import "proto/engine/v1/execution_engine.proto";
option csharp_namespace = "Ethereum.Eth.V2";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v2;eth";
option java_multiple_files = true;
option java_outer_classname = "SyncCommitteeProto";
option java_package = "org.ethereum.eth.v2";
option php_namespace = "Ethereum\\Eth\\v2";
message BeaconState {
// Versioning [1001-2000]
uint64 genesis_time = 1001;
bytes genesis_validators_root = 1002 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 slot = 1003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
v1.Fork fork = 1004;
// History [2001-3000]
v1.BeaconBlockHeader latest_block_header = 2001;
repeated bytes block_roots = 2002 [(ethereum.eth.ext.ssz_size) = "block_roots.size"];
repeated bytes state_roots = 2003 [(ethereum.eth.ext.ssz_size) = "state_roots.size"];
repeated bytes historical_roots = 2004 [(ethereum.eth.ext.ssz_size) = "?,32", (ethereum.eth.ext.ssz_max) = "16777216"];
// Eth1 [3001-4000]
v1.Eth1Data eth1_data = 3001;
repeated v1.Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"];
uint64 eth1_deposit_index = 3003;
// Registry [4001-5000]
repeated v1.Validator validators = 4001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
repeated uint64 balances = 4002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
// Randomness [5001-6000]
repeated bytes randao_mixes = 5001 [(ethereum.eth.ext.ssz_size) = "randao_mixes.size"];
// Slashings [6001-7000]
repeated uint64 slashings = 6001 [(ethereum.eth.ext.ssz_size) = "slashings.size"];
// Participation [7001-8000]
bytes previous_epoch_participation = 7001 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; // [New in Altair, replaced previous_epoch_attestations]
bytes current_epoch_participation = 7002 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; // [New in Altair, replaced current_epoch_attestations]
// Finality [8001-9000]
// Spec type [4]Bitvector which means this would be a fixed size of 4 bits.
bytes justification_bits = 8001 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"];
v1.Checkpoint previous_justified_checkpoint = 8002;
v1.Checkpoint current_justified_checkpoint = 8003;
v1.Checkpoint finalized_checkpoint = 8004;
// New Altair fields [9001-10000]
repeated uint64 inactivity_scores = 9001 [(ethereum.eth.ext.ssz_max) = "1099511627776"]; // [New in Altair]
SyncCommittee current_sync_committee = 9002; // [New in Altair]
SyncCommittee next_sync_committee = 9003; // [New in Altair]
}
message BeaconStateBellatrix {
// Versioning [1001-2000]
uint64 genesis_time = 1001;
bytes genesis_validators_root = 1002 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 slot = 1003 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
v1.Fork fork = 1004;
// History [2001-3000]
v1.BeaconBlockHeader latest_block_header = 2001;
repeated bytes block_roots = 2002 [(ethereum.eth.ext.ssz_size) = "block_roots.size"];
repeated bytes state_roots = 2003 [(ethereum.eth.ext.ssz_size) = "state_roots.size"];
repeated bytes historical_roots = 2004 [(ethereum.eth.ext.ssz_size) = "?,32", (ethereum.eth.ext.ssz_max) = "16777216"];
// Eth1 [3001-4000]
v1.Eth1Data eth1_data = 3001;
repeated v1.Eth1Data eth1_data_votes = 3002 [(ethereum.eth.ext.ssz_max) = "eth1_data_votes.size"];
uint64 eth1_deposit_index = 3003;
// Registry [4001-5000]
repeated v1.Validator validators = 4001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
repeated uint64 balances = 4002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
// Randomness [5001-6000]
repeated bytes randao_mixes = 5001 [(ethereum.eth.ext.ssz_size) = "randao_mixes.size"];
// Slashings [6001-7000]
repeated uint64 slashings = 6001 [(ethereum.eth.ext.ssz_size) = "slashings.size"];
// Participation [7001-8000]
bytes previous_epoch_participation = 7001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
bytes current_epoch_participation = 7002 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
// Finality [8001-9000]
// Spec type [4]Bitvector which means this would be a fixed size of 4 bits.
bytes justification_bits = 8001 [(ethereum.eth.ext.ssz_size) = "1", (ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitvector4"];
v1.Checkpoint previous_justified_checkpoint = 8002;
v1.Checkpoint current_justified_checkpoint = 8003;
v1.Checkpoint finalized_checkpoint = 8004;
// Altair fields [9001-10000]
repeated uint64 inactivity_scores = 9001 [(ethereum.eth.ext.ssz_max) = "1099511627776"];
SyncCommittee current_sync_committee = 9002; // [New in Altair]
SyncCommittee next_sync_committee = 9003; // [New in Altair]
// Bellatrix fields [10001-11000]
engine.v1.ExecutionPayloadHeader latest_execution_payload_header = 10001; // [New in Bellatrix]
}
message BeaconStateRequestV2 {
// The state id which can be any of: "head" (canonical head in node's view),
// "genesis", "finalized", "justified", <slot>, <hex encoded stateRoot with 0x prefix>.
bytes state_id = 1;
}
message BeaconStateResponseV2 {
Version version = 1;
BeaconStateContainer data = 2;
bool execution_optimistic = 3;
}
message BeaconStateSSZResponseV2 {
v2.Version version = 1;
bytes data = 2;
}
message BeaconStateContainer {
oneof state {
v1.BeaconState phase0_state = 1;
BeaconState altair_state = 2;
BeaconStateBellatrix bellatrix_state = 3;
}
}
message ForkChoiceHeadsResponse {
repeated ForkChoiceHead data = 1;
}
message ForkChoiceHead {
bytes root = 1 [(ethereum.eth.ext.ssz_size) = "32"];
uint64 slot = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
bool execution_optimistic = 3;
}
// 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.eth.v2;
option csharp_namespace = "Ethereum.Eth.V2";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v2;eth";
option java_multiple_files = true;
option java_outer_classname = "SszProto";
option java_package = "org.ethereum.eth.v2";
option php_namespace = "Ethereum\\Eth\\v2";
import "eth/v2/version.proto";
message SSZContainer {
Version version = 1;
bool execution_optimistic = 2;
bytes data = 3;
}
\ No newline at end of file
// Copyright 2021 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.eth.v2;
import "eth/ext/options.proto";
option csharp_namespace = "Ethereum.Eth.V2";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v2;eth";
option java_multiple_files = true;
option java_outer_classname = "SyncCommitteeProto";
option java_package = "org.ethereum.eth.v2";
option php_namespace = "Ethereum\\Eth\\v2";
message SubmitSyncCommitteeSignaturesRequest {
repeated SyncCommitteeMessage data = 1;
}
// SyncCommittee serves as committees to facilitate light client syncing to beacon chain.
message SyncCommittee {
repeated bytes pubkeys = 1 [(ethereum.eth.ext.ssz_size) = "sync_committee_bits.size,48"];
bytes aggregate_pubkey = 2 [(ethereum.eth.ext.ssz_size) = "48"];
}
message SubmitPoolSyncCommitteeSignatures {
repeated SyncCommitteeMessage data = 1;
}
// Sync committee object to support light client.
message SyncCommitteeMessage {
// Slot to which this contribution pertains.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// 32 byte block root for this signature.
bytes beacon_block_root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// Index of the validator that produced this signature.
uint64 validator_index = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// Signature by the validator over the block root of `slot`.
bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"];
}
message StateSyncCommitteesRequest {
// The state id which can be any of: "head" (canonical head in node's view),
// "genesis", "finalized", "justified", <slot>, <hex encoded stateRoot with 0x prefix>.
bytes state_id = 1;
// The epoch to retrieve the committees of.
optional uint64 epoch = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
}
message StateSyncCommitteesResponse {
SyncCommitteeValidators data = 1;
bool execution_optimistic = 2;
}
message SyncCommitteeValidators {
// All of the validator indices in the current sync committee.
repeated uint64 validators = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
repeated SyncSubcommitteeValidators validator_aggregates = 2;
}
message SyncSubcommitteeValidators {
// Subcommittee slices of the current sync committee.
repeated uint64 validators = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
}
// Copyright 2021 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.eth.v2;
import "eth/ext/options.proto";
import "eth/v2/beacon_block.proto";
import "eth/v2/version.proto";
option csharp_namespace = "Ethereum.Eth.V2";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v2;eth";
option java_multiple_files = true;
option java_outer_classname = "ValidatorProto";
option java_package = "org.ethereum.eth.v2";
option php_namespace = "Ethereum\\Eth\\v2";
message SyncCommitteeDutiesRequest {
// Must fulfill: epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD <= current_epoch // EPOCHS_PER_SYNC_COMMITTEE_PERIOD + 1
uint64 epoch = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
// Validator indices to request duties for.
repeated uint64 index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
}
message SyncCommitteeDutiesResponse {
repeated SyncCommitteeDuty data = 1;
bool execution_optimistic = 2;
}
message SyncCommitteeDuty {
// The validator's BLS public key, uniquely identifying them.
bytes pubkey = 1 [(ethereum.eth.ext.ssz_size) = "48"];
// Index of validator in validator registry.
uint64 validator_index = 2 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// The indices of the validator in the sync committee.
repeated uint64 validator_sync_committee_indices = 3;
}
message ProduceBlockResponseV2 {
Version version = 1;
BeaconBlockContainerV2 data = 2;
}
message ProduceBlindedBlockResponse {
Version version = 1;
BlindedBeaconBlockContainer data = 2;
}
message SubmitSyncCommitteeSubscriptionsRequest {
repeated SyncCommitteeSubscription data = 1;
}
message SyncCommitteeSubscription {
// The validator index to subscribe for.
uint64 validator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
// The sync committee indices to be subscribed to.
repeated uint64 sync_committee_indices = 2;
// The final epoch (exclusive value) that the specified validator requires the subscription for.
uint64 until_epoch = 3 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Epoch"];
}
message ProduceSyncCommitteeContributionRequest {
// The slot for which a sync committee contribution should be created.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// The subcommittee index for which to produce the contribution.
uint64 subcommittee_index = 2;
// The block root for which to produce the contribution.
bytes beacon_block_root = 3 [(ethereum.eth.ext.ssz_size) = "32"];
}
message ProduceSyncCommitteeContributionResponse {
SyncCommitteeContribution data = 1;
}
// Aggregated sync committee object to support light client.
message SyncCommitteeContribution {
// Slot to which this contribution pertains.
uint64 slot = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.Slot"];
// 32 byte block root for this signature.
bytes beacon_block_root = 2 [(ethereum.eth.ext.ssz_size) = "32"];
// The subcommittee this contribution pertains to out of the broader sync committee.
uint64 subcommittee_index = 3;
// A bit is set if a signature from the validator at the corresponding
// index in the subcommittee is present in the aggregate `signature`.
bytes aggregation_bits = 4 [(ethereum.eth.ext.ssz_size) = "sync_committee_aggregate_bytes.size", (ethereum.eth.ext.cast_type) = "sync_committee_aggregate_bits.type"];
// Signature by the validator(s) over the block root of `slot`.
bytes signature = 5 [(ethereum.eth.ext.ssz_size) = "96"];
}
message SubmitContributionAndProofsRequest {
repeated SignedContributionAndProof data = 1;
}
// Aggregated sync committee signature object with selection proof to support light client.
message ContributionAndProof {
// Index of the aggregator that produced this proof.
uint64 aggregator_index = 1 [(ethereum.eth.ext.cast_type) = "github.com/prysmaticlabs/prysm/v3/consensus-types/primitives.ValidatorIndex"];
SyncCommitteeContribution contribution = 2;
// The selection proof itself.
bytes selection_proof = 3 [(ethereum.eth.ext.ssz_size) = "96"];
}
// Signed aggregated sync committee signature object with selection proof to support light client.
message SignedContributionAndProof {
ContributionAndProof message = 1;
// Signature of the aggregator that produced `message`.
bytes signature = 4 [(ethereum.eth.ext.ssz_size) = "96"];
}
// Copyright 2021 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.eth.v2;
option csharp_namespace = "Ethereum.Eth.V2";
option go_package = "github.com/prysmaticlabs/prysm/v3/proto/eth/v2;eth";
option java_multiple_files = true;
option java_outer_classname = "VersionProto";
option java_package = "org.ethereum.eth.v2";
option php_namespace = "Ethereum\\Eth\\v2";
// Version states the version of the returned accompanying message.
enum Version {
PHASE0 = 0;
ALTAIR = 1;
BELLATRIX = 2;
}
...@@ -7,90 +7,15 @@ import "google/protobuf/field_mask.proto"; ...@@ -7,90 +7,15 @@ import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto"; import "google/protobuf/timestamp.proto";
import "meta/txchecker/v1/resource.proto"; import "meta/txchecker/v1/resource.proto";
// The standard List request definition.
message ListShelvesRequest {
// Only retrieve shelves after this time.
google.protobuf.Timestamp after_time = 1;
// Only retrieve shelves before this time.
google.protobuf.Timestamp before_time = 2;
// The start index for pagination.
uint64 start = 3;
// The maximum number of shelves to return.
uint64 max_size = 4;
// The unique id of the parent example for which to list the shelves.
string example_id = 5;
}
// The standard List response definition.
message ListShelvesResponse {
// The retrieved list of shelves.
repeated Shelf shelves = 1;
// True if more shelves are available.
bool next = 2;
}
// The standard BatchGet request definition. // The standard BatchGet request definition.
message BatchGetShelvesRequest { message BatchCheckTxRequest {
// The ids of the requested shelves. // The ids of the requested shelves.
repeated string ids = 1; repeated bytes txs = 1;
repeated bytes from = 2;
} }
// The standard BatchGet response definition. // The standard BatchGet response definition.
message BatchGetShelvesResponse { message BatchCheckTxResponse {
// The retrieved shelves. // The retrieved shelves.
repeated Shelf shelves = 1; repeated bool status = 1;
}
// The standard Get request definition.
message GetShelfRequest {
// The id of the requested shelf.
string id = 1;
}
// The standard Get response definition.
message GetShelfResponse {
// The retrieved shelf.
Shelf shelf = 1;
}
// The standard Create request definition.
message CreateShelfRequest {
// The shelf to create.
Shelf shelf = 1;
// The unique id of the parent example where the shelf is to be created.
string example_id = 2;
}
// The standard Create response definition.
message CreateShelfResponse {
// The created shelf.
Shelf shelf = 1;
}
// The standard Update request definition.
message UpdateShelfRequest {
// The id of the shelf to be updated.
string id = 1;
// The shelf which replaces the shelf on the server.
Shelf shelf = 2;
// The update mask applied to the shelf. See https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask.
google.protobuf.FieldMask update_mask = 3;
}
// The standard Update response definition.
message UpdateShelfResponse {
// The updated shelf.
Shelf shelf = 1;
}
// The standard Delete request definition.
message DeleteShelfRequest {
// The id of the shelf to be deleted.
string id = 1;
}
// The standard Delete response definition.
message DeleteShelfResponse {
// The deleted shelf.
Shelf shelf = 1;
} }
...@@ -4,16 +4,16 @@ package meta.txchecker.v1; ...@@ -4,16 +4,16 @@ package meta.txchecker.v1;
option go_package = "txcheckerv1"; option go_package = "txcheckerv1";
import "google/protobuf/timestamp.proto"; import "google/protobuf/timestamp.proto";
// The default Shelf resource representation. // // The default Shelf resource representation.
message Shelf { // message Shelf {
// The unique shelf id. // // The unique shelf id.
string id = 1; // string id = 1;
// Indicates when the shelf was created. // // Indicates when the shelf was created.
google.protobuf.Timestamp create_time = 2; // google.protobuf.Timestamp create_time = 2;
// Indicates when the shelf was last updated. // // Indicates when the shelf was last updated.
google.protobuf.Timestamp update_time = 3; // google.protobuf.Timestamp update_time = 3;
// The unique id of the parent example resource. // // The unique id of the parent example resource.
string example_id = 4; // string example_id = 4;
// The display name for the shelf. // // The display name for the shelf.
string display_name = 5; // string display_name = 5;
} // }
...@@ -4,18 +4,8 @@ package meta.txchecker.v1; ...@@ -4,18 +4,8 @@ package meta.txchecker.v1;
option go_package = "txcheckerv1"; option go_package = "txcheckerv1";
import "meta/txchecker/v1/request_response.proto"; import "meta/txchecker/v1/request_response.proto";
// ShelfService defines methods for managing shelves.
service ShelfService { service ShelfService {
// ListShelves retrieves a list of shelf resources from the server.
rpc ListShelves(ListShelvesRequest) returns (ListShelvesResponse) {} rpc BatchGetShelves(BatchCheckTxRequest) returns (BatchCheckTxResponse) {}
// BatchGetShelves retrieves multiple shelf resources from the server.
rpc BatchGetShelves(BatchGetShelvesRequest) returns (BatchGetShelvesResponse) {}
// GetShelf retrieves a single shelf resource from the server.
rpc GetShelf(GetShelfRequest) returns (GetShelfResponse) {}
// CreateShelf creates a new shelf resource on the server.
rpc CreateShelf(CreateShelfRequest) returns (CreateShelfResponse) {}
// UpdateShelf updates the shelf resource on the server.
rpc UpdateShelf(UpdateShelfRequest) returns (UpdateShelfResponse) {}
// DeleteShelf deletes the shelf resource from the server.
rpc DeleteShelf(DeleteShelfRequest) returns (DeleteShelfResponse) {}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment