2018-08-01 05:35:08 +00:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package ethereum.beacon.rpc.v1;
|
|
|
|
|
2018-11-20 19:43:07 +00:00
|
|
|
import "proto/beacon/p2p/v1/types.proto";
|
2018-08-09 22:54:59 +00:00
|
|
|
import "google/protobuf/empty.proto";
|
2018-09-05 03:35:32 +00:00
|
|
|
import "google/protobuf/timestamp.proto";
|
2018-08-01 05:35:08 +00:00
|
|
|
|
|
|
|
service BeaconService {
|
2019-01-30 12:28:53 +00:00
|
|
|
rpc WaitForChainStart(google.protobuf.Empty) returns (stream ChainStartResponse);
|
|
|
|
// CanonicalHead can be called on demand to fetch the current, head block of a beacon node.
|
2018-09-21 14:32:20 +00:00
|
|
|
rpc CanonicalHead(google.protobuf.Empty) returns (ethereum.beacon.p2p.v1.BeaconBlock);
|
2019-01-30 12:28:53 +00:00
|
|
|
// LatestAttestation streams the latest aggregated attestation to connected validator clients.
|
2018-12-22 20:30:59 +00:00
|
|
|
rpc LatestAttestation(google.protobuf.Empty) returns (stream ethereum.beacon.p2p.v1.Attestation);
|
2018-08-09 22:54:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
service AttesterService {
|
2018-09-11 17:08:31 +00:00
|
|
|
rpc AttestHead(AttestRequest) returns (AttestResponse);
|
2018-08-09 22:54:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
service ProposerService {
|
2019-01-28 19:41:04 +00:00
|
|
|
rpc ProposerIndex(ProposerIndexRequest) returns (ProposerIndexResponse);
|
2019-01-10 02:56:26 +00:00
|
|
|
rpc ProposeBlock(ethereum.beacon.p2p.v1.BeaconBlock) returns (ProposeResponse);
|
|
|
|
rpc ComputeStateRoot(ethereum.beacon.p2p.v1.BeaconBlock) returns (StateRootResponse);
|
2018-08-01 05:35:08 +00:00
|
|
|
}
|
|
|
|
|
2018-09-18 02:36:09 +00:00
|
|
|
service ValidatorService {
|
2019-01-29 12:56:14 +00:00
|
|
|
rpc ValidatorIndex(ValidatorIndexRequest) returns (ValidatorIndexResponse);
|
2019-01-25 03:26:03 +00:00
|
|
|
rpc ValidatorEpochAssignments(ValidatorEpochAssignmentsRequest) returns (ValidatorEpochAssignmentsResponse);
|
2018-08-01 05:35:08 +00:00
|
|
|
}
|
|
|
|
|
2019-01-30 12:28:53 +00:00
|
|
|
message ChainStartResponse {
|
|
|
|
bool started = 1;
|
|
|
|
uint64 genesis_time = 2;
|
|
|
|
}
|
|
|
|
|
2018-08-01 05:35:08 +00:00
|
|
|
message ProposeRequest {
|
2018-09-22 18:19:34 +00:00
|
|
|
bytes parent_hash = 1;
|
|
|
|
uint64 slot_number = 2;
|
2018-12-03 16:10:47 +00:00
|
|
|
bytes randao_reveal_hash32 = 3;
|
2018-09-22 18:19:34 +00:00
|
|
|
bytes attestation_bitmask = 4;
|
2019-01-30 10:11:13 +00:00
|
|
|
repeated uint64 attestation_aggregate_sig = 5;
|
2018-09-22 18:19:34 +00:00
|
|
|
google.protobuf.Timestamp timestamp = 6;
|
2018-08-01 05:35:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message ProposeResponse {
|
|
|
|
bytes block_hash = 1;
|
|
|
|
}
|
|
|
|
|
2019-01-10 02:56:26 +00:00
|
|
|
message ProposerIndexRequest {
|
|
|
|
uint64 slot_number = 1;
|
|
|
|
}
|
|
|
|
|
2019-01-28 19:41:04 +00:00
|
|
|
message ProposerIndexResponse {
|
2019-01-30 10:11:13 +00:00
|
|
|
uint64 index = 1;
|
2019-01-28 19:41:04 +00:00
|
|
|
}
|
|
|
|
|
2019-01-10 02:56:26 +00:00
|
|
|
message StateRootResponse {
|
|
|
|
bytes state_root = 1;
|
|
|
|
}
|
|
|
|
|
2018-09-11 17:08:31 +00:00
|
|
|
message AttestRequest {
|
2018-12-22 20:30:59 +00:00
|
|
|
ethereum.beacon.p2p.v1.Attestation attestation = 1;
|
2018-08-01 05:35:08 +00:00
|
|
|
}
|
|
|
|
|
2018-09-11 17:08:31 +00:00
|
|
|
message AttestResponse {
|
|
|
|
bytes attestation_hash = 1;
|
2018-09-05 03:35:32 +00:00
|
|
|
}
|
2018-09-18 02:36:09 +00:00
|
|
|
|
2018-09-24 15:18:27 +00:00
|
|
|
enum ValidatorRole {
|
2018-09-27 02:34:35 +00:00
|
|
|
UNKNOWN = 0;
|
|
|
|
ATTESTER = 1;
|
|
|
|
PROPOSER = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Assignment defines a validator's assignment responsibilities.
|
|
|
|
message Assignment {
|
2018-09-25 03:01:26 +00:00
|
|
|
bytes public_key = 1;
|
2019-01-29 12:56:14 +00:00
|
|
|
uint64 shard = 2;
|
|
|
|
uint64 attester_slot = 3;
|
|
|
|
uint64 proposer_slot = 4;
|
2018-09-18 02:36:09 +00:00
|
|
|
}
|
|
|
|
|
2019-01-29 12:56:14 +00:00
|
|
|
message ValidatorIndexRequest {
|
|
|
|
bytes public_key = 1;
|
2018-09-18 02:36:09 +00:00
|
|
|
}
|
|
|
|
|
2019-01-28 19:41:04 +00:00
|
|
|
message ValidatorIndexResponse {
|
2019-01-30 10:11:13 +00:00
|
|
|
uint64 index = 1;
|
2018-09-18 02:36:09 +00:00
|
|
|
}
|
|
|
|
|
2019-01-25 03:26:03 +00:00
|
|
|
message ValidatorEpochAssignmentsRequest {
|
|
|
|
uint64 epoch_start = 1;
|
2019-01-29 12:56:14 +00:00
|
|
|
bytes public_key = 2;
|
2019-01-25 03:26:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message ValidatorEpochAssignmentsResponse {
|
2019-01-29 12:56:14 +00:00
|
|
|
Assignment assignment = 2;
|
2019-01-25 03:26:03 +00:00
|
|
|
}
|