lighthouse/protos/src/services.proto
Age Manning 468015f9bb Initial Interop Updates (#492)
* Add interop chain spec and rename chain_id

* Add ability to connect to raw libp2p nodes

* Adds Identify protocol, clean up RPC protocol name handling

* Update to latest libp2p, gossipsub improvements

* Updates to latest interop branch.

- Shifts decoding of objects into message handler.
- Updates to latest interop gossipsub.
- Adds interop spec constant.

* Configuration updates allow for verbosity CLI flag and spec constants

* Update submodules to master

* Correct minimal chainspec modifications

* Duplication of validator polls are no longer fatal

* Apply PR suggestions
2019-08-10 11:44:17 +10:00

160 lines
3.5 KiB
Protocol Buffer

// 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 maintenance as the `BeaconBlock` definition changes.
syntax = "proto3";
package ethereum.beacon.rpc.v1;
// Service that currently identifies a beacon node
service BeaconNodeService {
rpc Info(Empty) returns (NodeInfoResponse);
}
/// Service that handles block production
service BeaconBlockService {
// Requests a block to be signed from the beacon node.
rpc ProduceBeaconBlock(ProduceBeaconBlockRequest) returns (ProduceBeaconBlockResponse);
// Responds to the node the signed block to be published.
rpc PublishBeaconBlock(PublishBeaconBlockRequest) returns (PublishBeaconBlockResponse);
}
/// Service that provides the validator client with requisite knowledge about
//its public keys
service ValidatorService {
// Gets the block proposer slot and committee slot that a validator needs to
// perform work on.
rpc GetValidatorDuties(GetDutiesRequest) returns (GetDutiesResponse);
}
/// Service that handles validator attestations
service AttestationService {
rpc ProduceAttestationData(ProduceAttestationDataRequest) returns (ProduceAttestationDataResponse);
rpc PublishAttestation(PublishAttestationRequest) returns (PublishAttestationResponse);
}
/*
* Beacon Node Service Message
*/
message NodeInfoResponse {
string version = 1;
Fork fork = 2;
uint32 network_id = 3;
uint64 genesis_time = 4;
uint64 genesis_slot = 5;
}
message Fork {
bytes previous_version = 1;
bytes current_version = 2;
uint64 epoch = 3;
}
message Empty {}
/*
* Block Production Service Messages
*/
// Validator requests an unsigned proposal.
message ProduceBeaconBlockRequest {
uint64 slot = 1;
bytes randao_reveal = 2;
}
// 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 successfully submitted proposal.
message PublishBeaconBlockResponse {
bool success = 1;
bytes msg = 2;
}
message BeaconBlock {
bytes ssz = 1;
}
/*
* Validator Service Messages
*/
// Validator Assignment
// the public keys of the validators
message Validators {
repeated bytes public_keys = 1;
}
// Propose slot
message GetDutiesRequest {
uint64 epoch = 1;
Validators validators = 2;
}
message GetDutiesResponse {
repeated ActiveValidator active_validators = 1;
}
message ActiveValidator {
oneof duty_oneof {
bool none = 1;
ValidatorDuty duty = 2;
}
}
message ValidatorDuty {
oneof block_oneof {
bool none = 1;
uint64 block_production_slot = 2;
}
uint64 attestation_slot = 3;
uint64 attestation_shard = 4;
uint64 committee_index = 5;
uint64 committee_len = 6;
}
/*
* Attestation Service Messages
*/
message ProduceAttestationDataRequest {
uint64 slot = 1;
uint64 shard = 2;
}
message ProduceAttestationDataResponse {
AttestationData attestation_data = 1;
}
message PublishAttestationRequest {
Attestation attestation = 1;
}
message Attestation {
bytes ssz = 1;
}
message PublishAttestationResponse {
bool success = 1;
bytes msg = 2;
}
message AttestationData {
bytes ssz = 1;
}