-
Notifications
You must be signed in to change notification settings - Fork 15
/
action.proto
414 lines (354 loc) · 9.18 KB
/
action.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
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
// Copyright (c) 2018 IoTeX
// This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no
// warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent
// permitted by law, all liability for your use of the code is disclaimed. This source code is governed by Apache
// License 2.0 that can be found in the LICENSE file.
// To compile the proto, run:
// protoc --go_out=plugins=grpc:$GOPATH/src *.proto
syntax = "proto3";
package iotextypes;
option go_package = "github.com/iotexproject/iotex-proto/golang/iotextypes";
option java_multiple_files = true;
option java_package = "com.github.iotexproject.grpc.types";
message Transfer {
// used by state-based model
string amount = 1;
string recipient = 2;
bytes payload = 3;
}
// Candidates and list of candidates
message Candidate {
string address = 1;
bytes votes = 2;
bytes pubKey = 3;
string rewardAddress = 4;
}
message CandidateList {
repeated Candidate candidates = 1;
}
message PutPollResult {
uint64 height = 1;
CandidateList candidates = 2;
}
message TxContainer {
bytes raw = 1;
}
message Execution {
string amount = 1;
string contract = 2;
bytes data = 3;
}
message AccessTuple {
string address = 1;
repeated string storageKeys = 2;
}
message BlobTxSidecar {
repeated bytes blobs = 1; // Blobs needed by the blob pool
repeated bytes commitments = 2; // Commitments needed by the blob pool
repeated bytes proofs = 3; // Proofs needed by the blob pool
}
message BlobTxData {
string blobFeeCap = 1;
repeated bytes blobHashes = 2;
BlobTxSidecar blobTxSidecar = 3;
}
message BlobTxSidecars {
repeated bytes txHash = 1;
repeated BlobTxSidecar sidecars = 2;
}
// create stake
message StakeCreate {
string candidateName = 1;
string stakedAmount = 2;
uint32 stakedDuration = 3;
bool autoStake = 4;
bytes payload = 5;
}
// migrate stake
message StakeMigrate {
uint64 bucketIndex = 1;
}
// unstake or withdraw
message StakeReclaim {
uint64 bucketIndex = 1;
bytes payload = 2;
}
// add the amount of bucket
message StakeAddDeposit {
uint64 bucketIndex = 1;
string amount = 2;
bytes payload = 3;
}
// restake the duration and autoStake flag of bucket
message StakeRestake {
uint64 bucketIndex = 1;
uint32 stakedDuration = 2;
bool autoStake = 3;
bytes payload = 4;
}
// move the bucket to vote for another candidate or transfer the ownership of bucket to another voters
message StakeChangeCandidate {
uint64 bucketIndex = 1;
string candidateName = 2;
bytes payload = 3;
}
message StakeTransferOwnership {
uint64 bucketIndex = 1;
string voterAddress = 2;
bytes payload = 3;
}
message CandidateBasicInfo {
string name = 1;
string operatorAddress = 2;
string rewardAddress = 3;
}
message CandidateRegister {
CandidateBasicInfo candidate = 1;
string stakedAmount = 2;
uint32 stakedDuration = 3;
bool autoStake = 4;
string ownerAddress = 5; // if ownerAddress is absent, owner of candidate is the sender
bytes payload = 6;
}
message CandidateTransferOwnership {
string newOwnerAddress = 1;
bytes payload = 2;
}
message CandidateActivate {
uint64 bucketIndex = 1;
}
message CandidateEndorsement {
uint64 bucketIndex = 1;
bool endorse = 2; // deprecated
uint32 op = 3;
}
message StartSubChain {
// TODO: chainID chould be assigned by system and returned via a receipt
uint32 chainID = 1;
string securityDeposit = 2;
string operationDeposit = 3;
uint64 startHeight = 4;
uint64 parentHeightOffset = 5;
}
message StopSubChain {
uint32 chainID = 1;
uint64 stopHeight = 2;
string subChainAddress = 3;
}
message MerkleRoot {
string name = 1;
bytes value = 2;
}
message PutBlock {
string subChainAddress = 1;
uint64 height = 2;
repeated MerkleRoot roots = 3;
}
message CreateDeposit {
uint32 chainID = 1;
string amount = 2;
string recipient = 3;
}
message SettleDeposit {
string amount = 1;
string recipient = 2;
uint64 index = 3;
}
// plum main chain APIs
message CreatePlumChain {
}
message TerminatePlumChain {
string subChainAddress = 1;
}
message PlumPutBlock {
string subChainAddress = 1;
uint64 height = 2;
map<string, bytes> roots = 3;
}
message PlumCreateDeposit {
string subChainAddress = 1;
string amount = 2;
string recipient = 3;
}
message PlumStartExit {
string subChainAddress = 1;
bytes previousTransfer = 2;
bytes previousTransferBlockProof = 3;
uint64 previousTransferBlockHeight = 4;
bytes exitTransfer = 5;
bytes exitTransferBlockProof = 6;
uint64 exitTransferBlockHeight = 7;
}
message PlumChallengeExit {
string subChainAddress = 1;
uint64 coinID = 2;
bytes challengeTransfer = 3;
bytes challengeTransferBlockProof = 4;
uint64 challengeTransferBlockHeight = 5;
}
message PlumResponseChallengeExit {
string subChainAddress = 1;
uint64 coinID = 2;
bytes challengeTransfer = 3;
bytes responseTransfer = 4;
bytes responseTransferBlockProof = 5;
uint64 previousTransferBlockHeight = 6;
}
message PlumFinalizeExit {
string subChainAddress = 1;
uint64 coinID = 2;
}
// plum sub chain APIs
message PlumSettleDeposit {
uint64 coinID = 1;
}
message PlumTransfer {
uint64 coinID = 1;
bytes denomination = 2;
string owner = 3;
string recipient = 4;
}
message ActionCore {
uint32 version = 1;
uint64 nonce = 2;
uint64 gasLimit = 3;
string gasPrice = 4;
uint32 chainID = 5;
string gasTipCap = 6;
string gasFeeCap = 7;
BlobTxData blobTxData = 8;
repeated AccessTuple accessList = 9;
uint32 txType = 28;
oneof action {
Transfer transfer = 10;
TxContainer txContainer = 11;
Execution execution = 12;
// FedChain
StartSubChain startSubChain = 13;
StopSubChain stopSubChain = 14;
PutBlock putBlock = 15;
CreateDeposit createDeposit = 16;
SettleDeposit settleDeposit = 17;
// PlumChain
CreatePlumChain createPlumChain = 18;
TerminatePlumChain terminatePlumChain = 19;
PlumPutBlock plumPutBlock = 20;
PlumCreateDeposit plumCreateDeposit = 21;
PlumStartExit plumStartExit = 22;
PlumChallengeExit plumChallengeExit = 23;
PlumResponseChallengeExit plumResponseChallengeExit = 24;
PlumFinalizeExit plumFinalizeExit = 25;
PlumSettleDeposit plumSettleDeposit = 26;
PlumTransfer plumTransfer = 27;
// Rewarding protocol actions
DepositToRewardingFund depositToRewardingFund = 30;
ClaimFromRewardingFund claimFromRewardingFund = 31;
GrantReward grantReward = 32;
// Native staking
StakeCreate stakeCreate = 40;
StakeReclaim stakeUnstake = 41;
StakeReclaim stakeWithdraw = 42;
StakeAddDeposit stakeAddDeposit = 43;
StakeRestake stakeRestake = 44;
StakeChangeCandidate stakeChangeCandidate = 45;
StakeTransferOwnership stakeTransferOwnership = 46;
CandidateRegister candidateRegister = 47;
CandidateBasicInfo candidateUpdate = 48;
CandidateActivate candidateActivate = 49;
CandidateEndorsement candidateEndorsement = 51;
CandidateTransferOwnership candidateTransferOwnership = 52;
StakeMigrate stakeMigrate = 53;
PutPollResult putPollResult = 50;
}
}
enum Encoding {
option allow_alias = true;
IOTEX_PROTOBUF = 0;
ETHEREUM_EIP155 = 1;
ETHEREUM_RLP = 1;
ETHEREUM_UNPROTECTED = 2;
TX_CONTAINER = 128;
}
message Action {
ActionCore core = 1;
bytes senderPubKey = 2;
bytes signature = 3;
Encoding encoding = 4;
}
// a pack of actions
message Actions {
repeated Action actions = 1;
}
message ActionHash {
bytes hash = 1;
}
message Receipt {
uint64 status = 1;
uint64 blkHeight = 2;
bytes actHash = 3;
uint64 gasConsumed = 4;
string contractAddress = 5;
repeated Log logs = 6;
string executionRevertMsg = 7;
uint32 txIndex = 8;
uint64 blobGasUsed = 9;
string blobGasPrice = 10;
string effectiveGasPrice = 11;
}
message Log {
string contractAddress = 1;
repeated bytes topics = 2;
bytes data = 3;
uint64 blkHeight = 4;
bytes actHash = 5;
uint32 index = 6;
bytes blkHash = 7;
uint32 txIndex = 8;
}
message Logs {
repeated Log logs = 1;
}
// Deprecated
message EvmTransfer {
bytes amount = 1;
string from = 2;
string to = 3;
}
// Deprecated
message EvmTransferList {
repeated EvmTransfer evmTransfers = 1;
}
// Deprecated
message ActionEvmTransfer {
bytes actionHash = 1;
uint64 numEvmTransfers = 2;
repeated EvmTransfer evmTransfers = 3;
}
// Deprecated
message BlockEvmTransfer {
uint64 blockHeight = 1;
uint64 numEvmTransfers = 2;
repeated ActionEvmTransfer actionEvmTransfers = 3;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
// BELOW ARE DEFINITIONS FOR BLOCK PRODUCER PROTOCOL
////////////////////////////////////////////////////////////////////////////////////////////////////
message DepositToRewardingFund {
string amount = 1;
bytes data = 2;
}
message ClaimFromRewardingFund {
string amount = 1;
bytes data = 2;
// address the claim of rewards for, if empty denoting the sender's address
// more information see iip27: https://iotex.larksuite.com/wiki/EtDewVEz6i5BeCkyj6vudtdHsCh
string address = 3;
}
enum RewardType {
BlockReward = 0;
EpochReward = 1;
}
message GrantReward {
RewardType type = 1;
uint64 height = 2;
}