2019-01-14 01:55:55 +00:00
|
|
|
// TODO: This setup requires that the BN (beacon node) holds the block in state
|
|
|
|
// during the interval between the `GenerateProposalRequest` and the
|
|
|
|
// `SubmitProposalRequest`.
|
|
|
|
//
|
|
|
|
// This is sub-optimal as if a validator client switches BN during this process
|
|
|
|
// the block will be lost.
|
|
|
|
//
|
|
|
|
// This "stateful" method is being used presently because it's easier and
|
|
|
|
// requires less maintainence as the `BeaconBlock` definition changes.
|
|
|
|
|
|
|
|
syntax = "proto3";
|
|
|
|
|
|
|
|
package ethereum.beacon.rpc.v1;
|
|
|
|
|
|
|
|
service BeaconBlockService {
|
|
|
|
rpc ProduceBeaconBlock(ProduceBeaconBlockRequest) returns (ProduceBeaconBlockResponse);
|
|
|
|
rpc PublishBeaconBlock(PublishBeaconBlockRequest) returns (PublishBeaconBlockResponse);
|
2019-01-21 08:38:28 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
service ValidatorService {
|
2019-01-21 07:29:28 +00:00
|
|
|
rpc ValidatorAssignment(ValidatorAssignmentRequest) returns (ValidatorAssignmentResponse);
|
2019-01-14 01:55:55 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message BeaconBlock {
|
|
|
|
uint64 slot = 1;
|
|
|
|
bytes block_root = 2;
|
|
|
|
bytes randao_reveal = 3;
|
|
|
|
bytes signature = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Validator requests an unsigned proposal.
|
|
|
|
message ProduceBeaconBlockRequest {
|
|
|
|
uint64 slot = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Beacon node returns an unsigned proposal.
|
|
|
|
message ProduceBeaconBlockResponse {
|
|
|
|
BeaconBlock block = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Validator submits a signed proposal.
|
|
|
|
message PublishBeaconBlockRequest {
|
|
|
|
BeaconBlock block = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Beacon node indicates a sucessfully submitted proposal.
|
|
|
|
message PublishBeaconBlockResponse {
|
|
|
|
bool success = 1;
|
|
|
|
bytes msg = 2;
|
|
|
|
}
|
2019-01-21 07:29:28 +00:00
|
|
|
|
|
|
|
message ValidatorAssignment {
|
|
|
|
oneof block_production_slot_oneof {
|
|
|
|
bool block_production_slot_none = 1;
|
|
|
|
uint64 block_production_slot = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
message ValidatorAssignmentRequest {
|
|
|
|
uint64 epoch = 1;
|
|
|
|
bytes public_key = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ValidatorAssignmentResponse {
|
|
|
|
ValidatorAssignment validator_assignment = 1;
|
|
|
|
}
|