2018-08-01 00:35:08 -05:00
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package ethereum.beacon.rpc.v1;
|
|
|
|
|
|
|
|
import "proto/beacon/p2p/v1/messages.proto";
|
2018-08-09 17:54:59 -05:00
|
|
|
import "google/protobuf/empty.proto";
|
2018-09-04 23:35:32 -04:00
|
|
|
import "google/protobuf/timestamp.proto";
|
2018-08-01 00:35:08 -05:00
|
|
|
|
|
|
|
service BeaconService {
|
2018-09-21 09:32:20 -05:00
|
|
|
rpc GenesisTimeAndCanonicalState(google.protobuf.Empty) returns (GenesisTimeAndStateResponse);
|
|
|
|
rpc CanonicalHead(google.protobuf.Empty) returns (ethereum.beacon.p2p.v1.BeaconBlock);
|
2018-08-09 17:54:59 -05:00
|
|
|
rpc LatestCrystallizedState(google.protobuf.Empty) returns (stream ethereum.beacon.p2p.v1.CrystallizedState);
|
2018-09-16 09:12:36 +08:00
|
|
|
rpc LatestAttestation(google.protobuf.Empty) returns (stream ethereum.beacon.p2p.v1.AggregatedAttestation);
|
2018-08-09 17:54:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
service AttesterService {
|
2018-09-11 10:08:31 -07:00
|
|
|
rpc AttestHead(AttestRequest) returns (AttestResponse);
|
2018-08-09 17:54:59 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
service ProposerService {
|
2018-08-01 00:35:08 -05:00
|
|
|
rpc ProposeBlock(ProposeRequest) returns (ProposeResponse);
|
|
|
|
}
|
|
|
|
|
2018-09-17 19:36:09 -07:00
|
|
|
service ValidatorService {
|
2018-09-22 13:19:34 -05:00
|
|
|
// These endpoints can be called on demand in the future
|
|
|
|
// by some web3 API for users to conveniently know their assignment.
|
2018-09-17 19:36:09 -07:00
|
|
|
rpc ValidatorShardID(PublicKey) returns (ShardIDResponse);
|
|
|
|
rpc ValidatorIndex(PublicKey) returns (IndexResponse);
|
2018-09-24 10:18:27 -05:00
|
|
|
rpc ValidatorSlotAndResponsibility(PublicKey) returns (SlotResponsibilityResponse);
|
2018-09-22 13:19:34 -05:00
|
|
|
// This endpoint is called by all validator clients to watch for assignments
|
|
|
|
// for a subset of public keys in the active validator set.
|
|
|
|
rpc ValidatorAssignment(ValidatorAssignmentRequest) returns(stream ValidatorAssignmentResponse);
|
2018-09-17 19:36:09 -07:00
|
|
|
}
|
|
|
|
|
2018-09-21 09:32:20 -05:00
|
|
|
message GenesisTimeAndStateResponse {
|
2018-09-22 13:19:34 -05:00
|
|
|
google.protobuf.Timestamp genesis_timestamp = 1;
|
|
|
|
ethereum.beacon.p2p.v1.CrystallizedState latest_crystallized_state = 2;
|
2018-08-01 00:35:08 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
message ProposeRequest {
|
2018-09-22 13:19:34 -05:00
|
|
|
bytes parent_hash = 1;
|
|
|
|
uint64 slot_number = 2;
|
|
|
|
bytes randao_reveal = 3;
|
|
|
|
bytes attestation_bitmask = 4;
|
|
|
|
repeated uint32 attestation_aggregate_sig = 5;
|
|
|
|
google.protobuf.Timestamp timestamp = 6;
|
2018-08-01 00:35:08 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
message ProposeResponse {
|
|
|
|
bytes block_hash = 1;
|
|
|
|
}
|
|
|
|
|
2018-09-11 10:08:31 -07:00
|
|
|
message AttestRequest {
|
2018-09-15 07:51:17 -07:00
|
|
|
ethereum.beacon.p2p.v1.AggregatedAttestation attestation = 1;
|
2018-08-01 00:35:08 -05:00
|
|
|
}
|
|
|
|
|
2018-09-11 10:08:31 -07:00
|
|
|
message AttestResponse {
|
|
|
|
bytes attestation_hash = 1;
|
2018-09-04 23:35:32 -04:00
|
|
|
}
|
2018-09-17 19:36:09 -07:00
|
|
|
|
2018-09-22 13:19:34 -05:00
|
|
|
// Request assignment updates for either all validators or a subset of validators
|
|
|
|
// defined by their public keys.
|
|
|
|
message ValidatorAssignmentRequest {
|
|
|
|
bool all_validators = 1;
|
|
|
|
repeated PublicKey public_keys = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ValidatorAssignmentResponse {
|
|
|
|
repeated Assignment assignments = 1;
|
|
|
|
uint64 slot = 2;
|
|
|
|
|
|
|
|
message Assignment {
|
|
|
|
PublicKey public_key = 1;
|
|
|
|
uint64 shard_id = 2;
|
2018-09-24 10:18:27 -05:00
|
|
|
ValidatorRole role = 3;
|
2018-09-22 13:19:34 -05:00
|
|
|
}
|
2018-09-24 10:18:27 -05:00
|
|
|
}
|
2018-09-22 13:19:34 -05:00
|
|
|
|
2018-09-24 10:18:27 -05:00
|
|
|
enum ValidatorRole {
|
|
|
|
UNKNOWN = 0;
|
|
|
|
ATTESTER = 1;
|
|
|
|
PROPOSER = 2;
|
2018-09-22 13:19:34 -05:00
|
|
|
}
|
|
|
|
|
2018-09-17 19:36:09 -07:00
|
|
|
message PublicKey {
|
|
|
|
uint64 public_key = 1;
|
|
|
|
}
|
|
|
|
|
2018-09-24 10:18:27 -05:00
|
|
|
message SlotResponsibilityResponse {
|
2018-09-22 13:19:34 -05:00
|
|
|
uint64 slot = 1;
|
2018-09-24 10:18:27 -05:00
|
|
|
ValidatorRole role = 2;
|
2018-09-17 19:36:09 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
message IndexResponse {
|
|
|
|
uint32 index = 1;
|
|
|
|
}
|
|
|
|
|
2018-09-22 13:19:34 -05:00
|
|
|
message ShardIDResponse {
|
|
|
|
uint64 shard_id = 1;
|
2018-09-17 19:36:09 -07:00
|
|
|
}
|