-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.proto
147 lines (107 loc) · 4.21 KB
/
test.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
syntax = "proto3";
package v1;
option go_package = "github.com/prysmaticlabs/protoc-gen-go-cast/test";
import "google/protobuf/descriptor.proto";
extend google.protobuf.FieldOptions {
string ssz_size = 50000;
string ssz_max = 50001;
string spec_name = 50002;
string cast_type = 50003;
}
// The greeting service definition.
service Greeter {
// Sends a greeting
rpc SayHello (HelloRequest) returns (HelloReply) {}
rpc ValidatorIndex(HelloRequest) returns (HelloReply) {}
}
// The request message containing the user's name.
message HelloRequest {
string name = 1;
}
// The response message containing the greetings
message HelloReply {
string message = 1;
}
message Deposit {
message Data {
// 48 byte BLS public key of the validator.
bytes public_key = 1 [(ssz_size) = "48", (spec_name) = "pubkey"];
// A 32 byte hash of the withdrawal address public key.
bytes withdrawal_credentials = 2 [(ssz_size) = "32"];
// Deposit amount in gwei.
uint64 amount = 3;
// 96 byte signature from the validators public key.
bytes signature = 4 [(ssz_size) = "96"];
}
// 32 byte roots in the deposit tree branch.
repeated bytes proof = 1 [(ssz_size) = "33,32"];
Data data = 2;
}
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 [(ssz_max) = "2048", (cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitlist"];
AttestationData data = 2;
// 96 byte BLS aggregate signature.
bytes signature = 3 [(ssz_size) = "96"];
}
message AggregateAttestationAndProof {
// The aggregator index that submitted this aggregated attestation and proof.
uint64 aggregator_index = 1;
// 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 [(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 [(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;
// The committee index that submitted this attestation.
uint64 committee_index = 2;
// 32 byte root of the LMD GHOST block vote.
bytes beacon_block_root = 3 [(ssz_size) = "32"];
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.
optional uint64 epoch = 1;
// Block root of the checkpoint references.
bytes validator_index = 2 [(ssz_max) = "2048", (cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitlist"];
}
// 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 RealCheckpoint {
// 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.
optional uint64 epoch = 1;
// Block root of the checkpoint references.
bytes validator_index = 2;
}
message ListAttestationsRequest {
// TODO(preston): Test oneof with gRPC gateway.
oneof query_filter {
// Filter attestations by epoch processed.
bytes epoch = 1 [(cast_type) = "github.com/prysmaticlabs/go-bitfield.Bitlist"];
// 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;
}