-
Notifications
You must be signed in to change notification settings - Fork 38
/
enclave.proto
338 lines (283 loc) · 8.13 KB
/
enclave.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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
syntax = "proto3";
option go_package = "enclave/rpc/generated";
package generated;
service EnclaveProto {
rpc Status(StatusRequest) returns (StatusResponse) {}
rpc Attestation(AttestationRequest) returns (AttestationResponse) {}
rpc GenerateSecret(GenerateSecretRequest) returns (GenerateSecretResponse) {}
rpc InitEnclave(InitEnclaveRequest) returns (InitEnclaveResponse) {}
rpc EnclaveID(EnclaveIDRequest) returns (EnclaveIDResponse) {}
rpc RPCEncryptionKey(RPCEncryptionKeyRequest) returns (RPCEncryptionKeyResponse) {}
rpc SubmitL1Block(SubmitBlockRequest) returns (SubmitBlockResponse) {}
rpc EncryptedRPC(EncCallRequest) returns (EncCallResponse){}
rpc SubmitBatch(SubmitBatchRequest) returns (SubmitBatchResponse) {}
rpc Stop(StopRequest) returns (StopResponse) {}
rpc GetCode(GetCodeRequest) returns (GetCodeResponse) {}
rpc Subscribe(SubscribeRequest) returns (SubscribeResponse) {}
rpc Unsubscribe(UnsubscribeRequest) returns (UnsubscribeResponse) {}
rpc HealthCheck(EmptyArgs) returns (HealthCheckResponse) {}
rpc GetBatch(GetBatchRequest) returns (GetBatchResponse) {}
rpc GetBatchBySeqNo(GetBatchBySeqNoRequest) returns (GetBatchResponse) {}
rpc GetRollupData(GetRollupDataRequest) returns (GetRollupDataResponse) {}
rpc CreateBatch(CreateBatchRequest) returns (CreateBatchResponse) {}
rpc CreateRollup(CreateRollupRequest) returns (CreateRollupResponse) {}
rpc ExportCrossChainData(ExportCrossChainDataRequest) returns (ExportCrossChainDataResponse) {}
rpc DebugTraceTransaction(DebugTraceTransactionRequest) returns (DebugTraceTransactionResponse) {}
rpc StreamL2Updates(StreamL2UpdatesRequest) returns (stream EncodedUpdateResponse) {}
rpc GetTotalContractCount(GetTotalContractCountRequest) returns (GetTotalContractCountResponse) {}
rpc EnclavePublicConfig(EnclavePublicConfigRequest) returns (EnclavePublicConfigResponse) {}
rpc MakeActive(MakeActiveRequest) returns (MakeActiveResponse) {}
rpc AddSequencer(AddSequencerRequest) returns (AddSequencerResponse) {}
}
message EnclavePublicConfigRequest {}
message EnclavePublicConfigResponse{
bytes l2MessageBusAddress = 1;
bytes transactionPostProcessorAddress = 2;
map<string, bytes> publicSystemContracts = 3;
SystemError systemError = 4;
}
message GetBatchRequest {
bytes knownHead = 1;
}
message GetBatchBySeqNoRequest {
uint64 seqNo = 1;
}
message GetBatchResponse {
bytes batch = 1;
SystemError systemError = 2;
}
message GetRollupDataRequest {
bytes hash = 1;
}
message GetRollupDataResponse {
PublicRollupDataMsg msg = 1;
SystemError systemError = 2;
}
message PublicRollupDataMsg {
uint64 startSeq = 1;
uint64 timestamp = 2;
}
message StreamL2UpdatesRequest {}
message EncodedUpdateResponse {
bytes batch = 1;
}
message Pagination{
int32 offset = 1;
int32 size = 2;
}
message SystemError{
int32 errorCode = 1;
string errorString = 2;
}
message GetTotalContractCountRequest {}
message GetTotalContractCountResponse{
int64 count = 1;
SystemError systemError = 2;
}
message DebugTraceTransactionRequest{
bytes txHash = 1;
bytes config = 2;
}
message DebugTraceTransactionResponse{
string msg = 1;
SystemError systemError = 2;
}
message CreateBatchRequest{
bool skipIfEmpty = 1;
}
message CreateBatchResponse{
string error = 2;
}
message CreateRollupRequest{
optional uint64 fromSequenceNumber = 1;
}
message CreateRollupResponse{
ExtRollupMsg msg = 1;
SystemError systemError = 2;
}
message ExportCrossChainDataRequest {
uint64 fromSeqNo = 1;
uint64 toSeqNo = 2;
}
message ExportCrossChainDataResponse {
bytes msg = 1;
}
message StatusRequest {}
message StatusResponse {
int32 statusCode = 1;
bytes l1Head = 2; // hash for the L1 head block in enclave's view of the canonical chain
bytes l2Head = 3; // seq number (big.Int) for the L2 head batch that the enclave has seen
bytes enclaveID = 4; // enclave ID derived from the public key
SystemError systemError = 5;
}
message MakeActiveRequest {}
message MakeActiveResponse {
SystemError systemError = 1;
}
message AddSequencerRequest {
bytes enclaveId = 1;
bytes proof = 2;
}
message AddSequencerResponse {
SystemError systemError = 2;
}
message AttestationRequest {}
message AttestationResponse {
AttestationReportMsg attestationReportMsg = 1;
SystemError systemError = 2;
}
message GenerateSecretRequest {}
message GenerateSecretResponse {
bytes encryptedSharedEnclaveSecret = 1;
SystemError systemError = 2;
}
message InitEnclaveRequest {
bytes encryptedSharedEnclaveSecret = 1;
}
message InitEnclaveResponse {
SystemError systemError = 1;
}
message EnclaveIDRequest {}
message EnclaveIDResponse {
bytes enclaveID = 1;
SystemError systemError = 2;
}
message RPCEncryptionKeyRequest {}
message RPCEncryptionKeyResponse {
bytes rpcPubKey = 1;
SystemError systemError = 2;
}
message StartRequest {
bytes encodedBlock = 1;
}
message StartResponse {
SystemError systemError = 1;
}
message SubmitBlockRequest {
bytes encodedBlock = 1;
bytes encodedReceipts = 2;
}
message SubmitBlockResponse {
BlockSubmissionResponseMsg blockSubmissionResponse = 1;
SystemError systemError = 2;
}
message EncCallRequest {
bytes encryptedParams = 1;
}
message EncCallResponse {
bytes encodedEnclaveResponse = 1;
SystemError systemError = 2;
}
message SubmitBatchRequest {
ExtBatchMsg batch = 1;
}
message SubmitBatchResponse {
SystemError systemError = 1;
}
message StopRequest {}
message StopResponse {
SystemError systemError = 1;
}
message GetCodeRequest {
bytes address = 1;
bytes blockNrOrHash = 2;
}
message GetCodeResponse {
bytes code = 1;
SystemError systemError = 2;
}
message SubscribeRequest {
bytes id = 1;
bytes encryptedSubscription = 2;
}
message SubscribeResponse {
SystemError systemError = 2;
}
message UnsubscribeRequest {
bytes id = 1;
}
message UnsubscribeResponse {
SystemError systemError = 2;
}
message HealthCheckResponse {
bool status = 1;
SystemError systemError = 2;
}
message EmptyArgs {}
// Nested message types.
message AttestationReportMsg {
bytes Report = 1; // The actual report bytes so it can be shared and verified by other nodes
bytes PubKey = 2; // Public key to encrypt traffic back to this enclave
bytes EnclaveID = 3;
string HostAddress = 4; // The IP address on which the host can be contacted by other Obscuro hosts for peer-to-peer communication
SystemError systemError = 5;
}
message BlockSubmissionResponseMsg {
repeated SecretResponseMsg producedSecretResponses = 1;
BlockSubmissionErrorMsg error = 2; // todo (@matt) - remove this BlockSubmissionError field once we are using the Status() to update host view of enclave state
}
message BlockSubmissionErrorMsg {
string cause = 1; // error cause description
bytes l1Head = 2; // hash for the L1 head block in enclave's view of the canonical chain
}
message CrossChainMsg {
bytes Sender = 1;
uint64 Sequence = 2;
uint32 Nonce = 3;
uint32 Topic = 4;
bytes Payload = 5;
}
message ExtBatchMsg {
BatchHeaderMsg header = 1;
repeated bytes txHashes = 2;
bytes txs = 3;
}
message BatchHeaderMsg {
bytes ParentHash = 1;
bytes Proof = 2;
bytes Root = 3;
bytes TxHash = 4;
uint64 Number = 5;
uint64 SequencerOrderNo = 6;
bytes ReceiptHash = 7;
bytes Extra = 8;
bytes Signature = 9;
uint64 GasLimit = 10;
uint64 GasUsed = 11;
uint64 Time = 12;
uint64 BaseFee = 13;
bytes LatestInboundCrossChainHeight = 14;
bytes LatestInboundCrossChainHash = 15;
repeated CrossChainMsg CrossChainMessages = 16;
bytes TransferTree = 17;
bytes Coinbase = 18;
bytes CrossChainTree = 19;
}
message ExtRollupMsg {
RollupHeaderMsg header = 1;
bytes batchPayloads = 2;
bytes calldataRollupHeader = 3;
}
message RollupHeaderMsg {
bytes ParentHash = 1;
bytes CompressionL1Head = 2;
uint64 ProofNumber = 3;
uint64 Number = 4;
uint64 Time = 5;
bytes EnclaveID = 6;
repeated CrossChainMsg CrossChainMessages = 7;
bytes Signature = 8;
uint64 LastBatchSeqNo = 9;
}
message SecretResponseMsg {
bytes Secret = 1;
bytes RequesterID = 2;
bytes AttesterID = 3;
string HostAddress = 4;
SystemError systemError = 5;
}
message WithdrawalMsg {
bytes amount = 1;
bytes recipient = 2;
bytes contract = 3;
}