-
Notifications
You must be signed in to change notification settings - Fork 4
/
codec.proto
1049 lines (880 loc) · 32.7 KB
/
codec.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
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
syntax = "proto3";
package dfuse.eosio.codec.v1;
option go_package = "github.com/dfuse-io/dfuse-eosio/pb/dfuse/eosio/codec/v1;pbcodec";
import "google/protobuf/timestamp.proto";
message Block {
string id = 1;
uint32 number = 2;
uint32 version = 3;
BlockHeader header = 4;
string producer_signature = 5;
repeated Extension block_extensions = 7;
uint32 dpos_proposed_irreversible_blocknum = 8;
uint32 dpos_irreversible_blocknum = 9;
BlockRootMerkle blockroot_merkle = 11;
repeated ProducerToLastProduced producer_to_last_produced = 12;
repeated ProducerToLastImpliedIRB producer_to_last_implied_irb = 13;
repeated uint32 confirm_count = 15;
PendingProducerSchedule pending_schedule = 16;
ActivatedProtocolFeatures activated_protocol_features = 17;
bool validated = 18;
repeated RlimitOp rlimit_ops = 19;
// The unfiltered transactions in this block when NO filtering has been applied,
// (i.e. `filtering_applied = false`). When filtering has been applied on this block,
// (i.e. `filtering_applied = true`), this field will be set to `nil` and instead, the
// `filtered_transactions` will be populated with only filtered transactions.
//
// Use the helper getter method `Transactions()` to automatically pick the correct
// field to use (`unfiltered_transactions` when `filtering_applied == false` and
// `filtered_transactions` when `filtering_applied == true`).
repeated TransactionReceipt unfiltered_transactions = 6;
// The filtered transactions in this block when filtering has been applied,
// (i.e. `filtering_applied = true`). This will be only the transactions
// that matched the include filter CEL expression and did NOT match the exclude
// filter CEL expression.
//
// Use the helper getter method `Transactions()` to automatically the correct
// field (`unfiltered_transaction` when `filtering_applied == false` and
// `filtered_transactions` when `filtering_applied == true`).
repeated TransactionReceipt filtered_transactions = 47;
// Number of transaction executed within this block when no filtering
// is applied (`filtering_applied == false`).
uint32 unfiltered_transaction_count = 22;
// Number of transaction that were successfully executed within this block that are found in
// the `filtered_transactions` array. This field is populated only when the flag
// `filtering_applied` is `true`.
uint32 filtered_transaction_count = 48;
// The unfiltered implicit transaction ops in this block when NO filtering has been applied,
// (i.e. `filtering_applied = false`). When filtering has been applied on this block,
// (i.e. `filtering_applied = true`), this field will be set to `nil` and instead, the
// `filtered_implicit_transaction_ops` will be populated with only filtered implicit
// transaction ops.
//
// Use the helper getter method `ImplicitTransactionOps()` to automatically pick the correct
// field to use (`unfiltered_implicit_transaction_ops` when `filtering_applied == false` and
// `filtered_implicit_transaction_ops` when `filtering_applied == true`).
repeated TrxOp unfiltered_implicit_transaction_ops = 20;
// The filtered implicit transaction ops in this block when filtering has been applied,
// (i.e. `filtering_applied = true`). This will be only the implicit transaction ops
// that matched the include filter CEL expression and did NOT match the exclude
// filter CEL expression.
//
// Use the helper getter method `ImplicitTransactionOps()` to automatically the correct
// field (`unfiltered_implicit_transaction_ops` when `filtering_applied == false` and
// `filtered_implicit_transaction_ops` when `filtering_applied == true`).
repeated TrxOp filtered_implicit_transaction_ops = 49;
// The unfiltered transaction traces in this block when NO filtering has been applied,
// (i.e. `filtering_applied = false`). When filtering has been applied on this block,
// (i.e. `filtering_applied = true`), this field will be set to `nil` and instead, the
// `filtered_transaction_traces` will be populated with only filtered transactions.
//
// Use the helper getter method `TransactionTraces()` to automatically pick the correct
// field to use (`unfiltered_transaction_traces` when `filtering_applied == false` and
// `filtered_transaction_traces` when `filtering_applied == true`).
repeated TransactionTrace unfiltered_transaction_traces = 21;
// The filtered transaction traces in this block when filtering has been applied,
// (i.e. `filtering_applied = true`). This will be only the transaction trace
// that matched the include filter CEL expression and did NOT match the exclude
// filter CEL expression.
//
// Use the helper getter method `TransactionTraces()` to automatically pick the correct
// field to use (`unfiltered_transaction_traces` when `filtering_applied == false` and
// `filtered_transaction_traces` when `filtering_applied == true`).
repeated TransactionTrace filtered_transaction_traces = 46;
// Number of transaction trace executed within this block when no filtering
// is applied (`filtering_applied == false`).
uint32 unfiltered_transaction_trace_count = 23;
// Number of transaction trace that were successfully executed within this block that are found in
// the `filtered_transaction_traces` array. This field is populated only when the flag
// `filtering_applied` is `true`.
uint32 filtered_transaction_trace_count = 43;
// Number of top-level actions that were successfully executed within this block when no filtering
// is applied (`filtering_applied == false`).
uint32 unfiltered_executed_input_action_count = 24;
// Number of top-level actions that were successfully executed within this block that are found in
// the `filtered_transaction_traces` array. This field is populated only when the flag
// `filtering_applied` is `true`.
uint32 filtered_executed_input_action_count = 44;
// Number of actions that were successfully executed within this block when no filtering
// is applied (`filtering_applied == false`).
uint32 unfiltered_executed_total_action_count = 25;
// Number of actions that were successfully executed within this block that are found in
// the `filtered_transaction_traces` array. This field is populated only when the flag
// `filtering_applied` is `true`.
uint32 filtered_executed_total_action_count = 45;
// Reserved 26 to 29
/// EOSIO 1.x only
// This was a single string element representing a public key (eos-go#ecc.PublicKey).
// It has been replaced by `valid_block_signing_authority_v2`.
string block_signing_key = 14;
// This was a list of `{name, publicKey}` elements, each block being signed by a single key,
// the schedule was simply a list of pair, each pair being the producer name and it's public key
// used to sign the block.
ProducerSchedule active_schedule_v1 = 10;
/// EOSIO 2.0.x only
// This replaces `block_signing_key` with a richer structure
// able to handle the weighted threshold multisig for block producers.
//
// This can be downgraded to the old `block_signing_key` simply by taking
// the first key present in the list. This is of course simple and not
// accurate anymore in EOSIO 2.0 system where `WTMSIG_BLOCK_SIGNATURES`
// has been activated AND block producers starts signing blocks with
// more than one key.
//
// See BlockSigningAuthority for further details
BlockSigningAuthority valid_block_signing_authority_v2 = 30;
// This repleaces the old type `ProducerSchedule` for the `active_schedule`
// field. This was only a type change in EOSIO 2.0, the field's name remained
// the same.
//
// This is the new schedule data layout which is richer than it's oldest
// counterpart. The inner element for a producer can then be composed with
// multiple keys, each with their own weight and the threshold required to
// accept the block signature.
ProducerAuthoritySchedule active_schedule_v2 = 31;
// Wheter or not a filtering process was run on this block. The filtering process sets to nil
// the `unfiltered_transaction_traces` to `nil` and populate the `filtered_transaction_traces`
// according to the `filtering_include_filter_expr` and `filtering_exclude_filter_expr` CEL
// expressions. A transaction will be present in the `filtered_transaction_traces` array if
// it matched the `filtering_include_filter_expr` and did *NOT* match the `filtering_exclude_filter_expr`.
//
// Moreover, each matching action that brought the transaction to be in `filtered_transaction_traces`
// array will have a `filtering_matched` flag set on it to broadcast the fact that this action
// match the inclusion/exclusion list.
//
// This flag controls all `filtered_*` and `unfiltered_*` elements on the Block structure and on
// substructures if present.
bool filtering_applied = 40;
// The CEL filter expression used to include transaction in `filtered_transaction_traces` array, works
// in combination with `filtering_exclude_filter_expr` value.
string filtering_include_filter_expr = 41;
// The CEL filter expression used to exclude transaction in `filtered_transaction_traces` array, works
// in combination with `filtering_include_filter_expr` value.
string filtering_exclude_filter_expr = 42;
// The CEL filter expression used to include system actions, required by some systems, works
// in combination with the two other filters above.
string filtering_system_actions_include_filter_expr = 50;
}
// BlockWithRefs is a lightweight block, with traces and transactions
// purged from the `block` within, and only. It is used in transports
// to pass block data around.
message BlockWithRefs {
string id = 1;
Block block = 2;
TransactionRefs implicit_transaction_refs = 3; // TODO: Triple check that that's the right thing
TransactionRefs transaction_refs = 4;
TransactionRefs transaction_trace_refs = 5;
bool irreversible = 6;
}
message TransactionRefs { repeated bytes hashes = 1; }
message ActivatedProtocolFeatures { repeated bytes protocol_features = 1; }
message PendingProducerSchedule {
uint32 schedule_lib_num = 1;
bytes schedule_hash = 2;
/// EOSIO 1.x only
// See Block#active_schedule_v1 for further details, this is the same change
// as the active schedule, but applied to the pending field.
ProducerSchedule schedule_v1 = 3;
/// EOSIO 2.0.x only
// See Block#active_schedule_v2 for further details, this is the same change
// as the active schedule, but applied to the pending field.
ProducerAuthoritySchedule schedule_v2 = 4;
}
// Present in EOSIO 1.x only
message ProducerSchedule {
uint32 version = 1;
repeated ProducerKey producers = 2;
}
// Present in EOSIO 1.x only
message ProducerKey {
string account_name = 1;
string block_signing_key = 2;
}
// Present in EOSIO 2.x only
//
// This is the new schedule data layout which is richer than it's oldest
// counterpart. The inner element for a producer can then be composed with
// multiple keys, each with their own weight and the threshold required to
// accept the block signature.
message ProducerAuthoritySchedule {
uint32 version = 1;
repeated ProducerAuthority producers = 2;
}
// Present in EOSIO 2.x only
message ProducerAuthority {
string account_name = 1;
BlockSigningAuthority block_signing_authority = 2;
}
// Present in EOSIO 2.x only
//
// This represents the signatures that were used to signed the block. Previously,
// in EOSIO 1.x, this was a simple public key since only one key could sign a block.
// In EOSIO 2.x, when `WTMSIG_BLOCK_SIGNATURES` feature is active, the block can be
// signed with a set of different public keys, each with its own weight as well as
// the threshold at which point the signatures are accepted.
//
// This is actually implemented as a `fc::variant` type in the C++ code, this tainted
// our own implementation where multiple types can be represented using a `oneof`.
//
// Know current types (and version they were introduced):
// - `BlockSigningAuthorityV0` [Type 0] (EOSIO 2.0)
//
message BlockSigningAuthority {
oneof variant { BlockSigningAuthorityV0 v0 = 1; }
}
// Present in EOSIO 2.x only
message BlockSigningAuthorityV0 {
uint32 threshold = 1;
repeated KeyWeight keys = 2;
}
message BlockRootMerkle {
uint32 node_count = 1;
repeated bytes active_nodes = 2;
}
message ProducerToLastProduced {
string name = 1;
uint32 last_block_num_produced = 2;
}
message ProducerToLastImpliedIRB {
string name = 1;
uint32 last_block_num_produced = 2;
}
message TransactionReceipt {
string id = 4;
uint64 index = 6; // within the SignedBlock
TransactionStatus status = 1;
uint32 cpu_usage_micro_seconds = 2;
uint32 net_usage_words = 3;
PackedTransaction packed_transaction = 5; // present if not deferred
}
message PackedTransaction {
repeated string signatures = 1;
uint32 compression = 2;
bytes packed_context_free_data = 3;
bytes packed_transaction = 4;
}
message BlockHeader {
google.protobuf.Timestamp timestamp = 3;
string producer = 4;
uint32 confirmed = 5; // uint16
string previous = 6;
bytes transaction_mroot = 7;
bytes action_mroot = 8;
uint32 schedule_version = 9;
repeated Extension header_extensions = 11;
// EOSIO 1.x only
//
// A change to producer schedule was reported as a `NewProducers` field on the
// `BlockHeader` in EOSIO 1.x. In EOSIO 2.x, when feature `WTMSIG_BLOCK_SIGNATURES`
// is activated, the `NewProducers` field is not present anymore and the schedule change
// is reported through a `BlockHeaderExtension` on the the `BlockHeader` struct.
//
// If you need to access the old value, you can
ProducerSchedule new_producers_v1 = 10;
}
enum BlockReversibility {
BLOCKREVERSIBILITY_NONE = 0; // there is no block
BLOCKREVERSIBILITY_REVERSIBLE = 1;
BLOCKREVERSIBILITY_IRREVERSIBLE = 2;
BLOCKREVERSIBILITY_STALE = 3;
BLOCKREVERSIBILITY_MAYBESTALE = 4; // behind lib, but we have not confirmed irreversibility
}
// TransactionEvent are elements that contribute to a view of the
// whole transaction lifecycle. They can be extracted from block logs,
// or from storage, and merged together to form an up-to-date
// TransactionLifecycle.
message TransactionEvent {
string id = 1;
string block_id = 2;
uint32 block_num = 3;
bool irreversible = 4;
oneof event {
AddedInternally internal_addition = 5;
Added addition = 6;
Executed execution = 7;
DtrxScheduled dtrx_scheduling = 8;
DtrxCanceled dtrx_cancellation = 9;
}
// This is an implicit transaction, like `onblock` and `onerror` that is extracted
// separately from the block itself.
// TODO: does it have a receipt? It probably has
message AddedInternally {
SignedTransaction transaction = 1;
}
// This is the transaction that is added into a block, in the list of transactions there.
message Added {
TransactionReceipt receipt = 1;
SignedTransaction transaction = 2;
PublicKeys public_keys = 3;
}
// Executed contributes the traces of executions
message Executed {
TransactionTrace trace = 1;
BlockHeader blockHeader = 2;
}
message DtrxScheduled {
ExtDTrxOp created_by = 1;
SignedTransaction transaction = 2;
}
message DtrxCanceled {
ExtDTrxOp canceled_by = 1;
}
}
message PublicKeys {
repeated string public_keys = 1;
}
message TransactionLifecycle {
string id = 1;
TransactionStatus transaction_status = 2;
TransactionReceipt transaction_receipt = 36; // FIXME: this is currently missing from our data
SignedTransaction transaction = 10;
repeated string public_keys = 19;
TransactionTrace execution_trace = 11;
BlockHeader execution_block_header = 12;
// We have TransactionReceipt` missing here
reserved 13 to 18; // previously dtrx_ops, creation_tree, db_ops, ram_ops, table_ops, feature_ops but were all duplicates of what's already in the TransactionTrace of `execution_trace`
ExtDTrxOp created_by = 20;
ExtDTrxOp canceled_by = 21;
reserved 22 to 32;
// BlockState creation_block_state = 30;
// BlockState execution_block_state = 31;
// BlockState cancelation_block_state = 32;
bool creation_irreversible = 33;
bool execution_irreversible = 34;
bool cancelation_irreversible = 35;
}
enum TransactionStatus {
TRANSACTIONSTATUS_NONE = 0;
TRANSACTIONSTATUS_EXECUTED = 1;
TRANSACTIONSTATUS_SOFTFAIL = 2;
TRANSACTIONSTATUS_HARDFAIL = 3;
TRANSACTIONSTATUS_DELAYED = 4;
TRANSACTIONSTATUS_EXPIRED = 5;
TRANSACTIONSTATUS_UNKNOWN = 6;
TRANSACTIONSTATUS_CANCELED = 7;
}
message SignedTransaction {
Transaction transaction = 1;
repeated string signatures = 2;
repeated bytes context_free_data = 3;
}
message Transaction {
TransactionHeader header = 1;
repeated Action context_free_actions = 2;
repeated Action actions = 3;
repeated Extension extensions = 4;
}
message TransactionHeader {
google.protobuf.Timestamp expiration = 1;
uint32 ref_block_num = 2;
uint32 ref_block_prefix = 3;
uint32 max_net_usage_words = 4;
uint32 max_cpu_usage_ms = 5;
uint32 delay_sec = 6;
}
message TransactionTrace {
// SHA-256 (FIPS 180-4) of the FCBUFFER-encoded packed transaction
string id = 1;
// Reference to the block number in which this transaction was executed.
uint64 block_num = 2;
// Index within block's unfiltered execution traces
uint64 index = 26;
// Reference to the block time this transaction was executed in
google.protobuf.Timestamp block_time = 3;
// Reference to the block ID this transaction was executed in
string producer_block_id = 4;
// Receipt of execution of this transaction
TransactionReceiptHeader receipt = 5;
int64 elapsed = 6;
uint64 net_usage = 7;
// Whether this transaction was taken from a scheduled transactions pool for
// execution (delayed)
bool scheduled = 8;
// Traces of each action within the transaction, including all notified and
// nested actions.
repeated ActionTrace action_traces = 9;
// Trace of a failed deferred transaction, if any.
TransactionTrace failed_dtrx_trace = 10;
// Exception leading to the failed dtrx trace.
Exception exception = 15;
uint64 error_code = 16;
// List of database operations this transaction entailed
repeated DBOp db_ops = 17;
// List of KV operations this transaction entailed
//
// This was added in EOSIO 2.1.x and will *not* be populated on older versions.
//
// See https://github.com/EOSIO/eos/pull/8223
repeated KVOp kv_ops = 30;
// List of deferred transactions operations this transaction entailed
repeated DTrxOp dtrx_ops = 18;
// List of feature switching operations (changes to feature switches in
// nodeos) this transaction entailed
repeated FeatureOp feature_ops = 19;
// List of permission changes operations
repeated PermOp perm_ops = 20;
// List of RAM consumption/redemption
repeated RAMOp ram_ops = 21;
// List of RAM correction operations (happens only once upon feature
// activation)
repeated RAMCorrectionOp ram_correction_ops = 22;
// List of changes to rate limiting values
repeated RlimitOp rlimit_ops = 23;
// List of table creations/deletions
repeated TableOp table_ops = 24;
// Tree of creation, rather than execution
repeated CreationFlatNode creation_tree = 25;
}
message TransactionReceiptHeader {
TransactionStatus status = 1;
uint32 cpu_usage_micro_seconds = 2;
uint32 net_usage_words = 3;
}
message Action {
string account = 1;
string name = 2;
repeated PermissionLevel authorization = 3;
string json_data = 4;
bytes raw_data = 5;
}
message ActionTrace {
string receiver = 11;
ActionReceipt receipt = 1;
Action action = 2;
bool context_free = 3;
int64 elapsed = 4;
string console = 5;
string transaction_id = 6;
uint64 block_num = 7;
string producer_block_id = 8;
google.protobuf.Timestamp block_time = 9;
// AccountDiskDeltas has been added in EOSIO 2.1.x for DISK resource (which is not part of the release oddly)
repeated AccountDelta account_disk_deltas = 40;
repeated AccountRAMDelta account_ram_deltas = 10;
// ReturnValue has been added in EOSIO 2.1.x as something that can be returned from the execution
// of an action.
//
// See https://github.com/EOSIO/eos/pull/8327
bytes return_value = 41;
Exception exception = 15;
uint64 error_code = 20; // https://github.com/EOSIO/eos/pull/7108
uint32 action_ordinal = 16;
uint32 creator_action_ordinal = 17;
uint32 closest_unnotified_ancestor_action_ordinal = 18;
uint32 execution_index = 19;
// Whether this action trace was a successful match, present only when filtering was applied on block. This
// will be `true` if the Block `filtering_applied` is `true`, if the include CEL filter matched and
// if the exclude CEL filter did NOT match.
bool filtering_matched = 30;
// Whether this action trace was a successful system match, present only when filtering was applied on block.
// This will be `true` if the Block `filtering_applied` is `true`, if the system actions include CEL filter
// matched, supersedes any exclude CEL filter.
bool filtering_matched_system_action_filter = 31;
}
message ActionReceipt {
string receiver = 1;
string digest = 2;
uint64 global_sequence = 3;
repeated AuthSequence auth_sequence = 4;
uint64 recv_sequence = 5;
uint64 code_sequence = 6;
uint64 abi_sequence = 7;
}
message AuthSequence {
string account_name = 1;
uint64 sequence = 2;
}
message AccountRAMDelta {
string account = 1;
int64 delta = 2;
}
message AccountDelta {
string account = 1;
int64 delta = 2;
}
message Extension {
uint32 type = 1;
bytes data = 2;
}
// FIXME: this is really just an output of the implicit transactions, isn't it? We don't have
// other operations here.. do we? What's the `name` anyway?
message TrxOp {
Operation operation = 1;
string name = 2;
string transaction_id = 3;
SignedTransaction transaction = 4;
enum Operation {
OPERATION_UNKNOWN = 0;
OPERATION_CREATE = 1;
}
}
message DBOp {
Operation operation = 1;
uint32 action_index = 2;
string code = 3;
string scope = 4;
string table_name = 5;
string primary_key = 6;
string old_payer = 7;
string new_payer = 8;
bytes old_data = 9;
bytes new_data = 10;
enum Operation {
OPERATION_UNKNOWN = 0;
OPERATION_INSERT = 1;
OPERATION_UPDATE = 2;
OPERATION_REMOVE = 3;
}
}
message KVOp {
// Operation represents the operation that was performed for this Key/Value pair, either
// an insertion, an update or a removal.
Operation operation = 1;
// ActionIndex is the index of the action in which this operation was performed.
uint32 action_index = 2;
// Code is the EOSIO contract's name that saved perform this Key/Value pair operation.
string code = 3;
// Key is the key part of this Key/Value pair. Unless the contract's used low-level EOSIO
// intrinsics, the key will be prefixed with the table name as defined in the contract.
bytes key = 4;
// OldPayer is the previous payer of the Key/Value pair.
//
// - On an `insert` operation, `OldPayer` is unset (emtpy string).
// - On an `update` operation, in stock 2.1.0 version is unset sadly (fix sent)
// - On a `remove` operation, `OldPayer` is set to the last payer of the Key/Value pair.
string old_payer = 5;
// NewPayer is the current payer of the Key/Value pair.
//
// - On an `insert` operation, `NewPayer` is set to the initial payer of the Key/Value pair.
// - On an `update` operation, `NewPayer` is set to the new payer (could be the same as before) of the Key/Value pair.
// - On a `remove` operation, `NewPayer` is unset (emtpy string).
string new_payer = 6;
// OldData is the previous value of the Key/Value pair.
//
// - On an `insert` operation, `OldData` is unset (emtpy bytes).
// - On an `update` operation, `OldData` is set to the old value of the Key/Value pair (prior the update).
// - On a `remove` operation, `OldData` is set to the last value of the Key/Value pair.
bytes old_data = 7;
// NewData is the current value of the Key/Value pair.
//
// - On an `insert` operation, `NewData` is set to the initial value of the Key/Value pair.
// - On an `update` operation, `NewData` is set to the new value of the Key/Value pair.
// - On a `remove` operation, `NewData` is unset (emtpy bytes).
bytes new_data = 8;
enum Operation {
OPERATION_UNKNOWN = 0;
OPERATION_INSERT = 1;
OPERATION_UPDATE = 2;
OPERATION_REMOVE = 3;
}
}
message RAMOp {
// Operation is the legacy operation tag that we used initially. This is replaced
// by a combination of `Namespce` and `Action`.
//
// Deprecated: Use `Namespace` and `Action` instead to determine what the RAM operation represents
Operation operation = 1;
uint32 action_index = 2;
string payer = 3;
int64 delta = 4;
uint64 usage = 5;
// Namespace representing the category the RAM operation belong to, like
// account, table_row, table, etc.
//
// This coupled with `action` replaces the `operation` field.
Namespace namespace = 6;
// Namespace representing the action the RAM operation did, like
// add, delete or remove an object.
//
// This coupled with `action` replaces the `operation` field.
Action action = 7;
// UniqueKey gives a unique key to the operation, this unique key is opaque,
// does not necessarly represents anything and should uniquely represents the
// RAM Operation within a given timeframe of block (a key should never overlap
// any other keys (per namespace), on any blocks span).
string unique_key = 8;
enum Operation {
OPERATION_UNKNOWN = 0;
OPERATION_CREATE_TABLE = 1;
OPERATION_DEFERRED_TRX_ADD = 2;
OPERATION_DEFERRED_TRX_CANCEL = 3;
OPERATION_DEFERRED_TRX_PUSHED = 4;
OPERATION_DEFERRED_TRX_RAM_CORRECTION = 5;
OPERATION_DEFERRED_TRX_REMOVED = 6;
OPERATION_DELETEAUTH = 7;
OPERATION_LINKAUTH = 8;
OPERATION_NEWACCOUNT = 9;
OPERATION_PRIMARY_INDEX_ADD = 10;
OPERATION_PRIMARY_INDEX_REMOVE = 11;
OPERATION_PRIMARY_INDEX_UPDATE = 12;
OPERATION_PRIMARY_INDEX_UPDATE_ADD_NEW_PAYER = 13;
OPERATION_PRIMARY_INDEX_UPDATE_REMOVE_OLD_PAYER = 14;
OPERATION_REMOVE_TABLE = 15;
OPERATION_SECONDARY_INDEX_ADD = 16;
OPERATION_SECONDARY_INDEX_REMOVE = 17;
OPERATION_SECONDARY_INDEX_UPDATE_ADD_NEW_PAYER = 18;
OPERATION_SECONDARY_INDEX_UPDATE_REMOVE_OLD_PAYER = 19;
OPERATION_SETABI = 20;
OPERATION_SETCODE = 21;
OPERATION_UNLINKAUTH = 22;
OPERATION_UPDATEAUTH_CREATE = 23;
OPERATION_UPDATEAUTH_UPDATE = 24;
// For newer RAM Ops that are registered by Deep Mind, their `Operation` value will be
// Deprecated until we remove the operation completely. Use instead the `Namespace`
// and `Action` fields to take a decision about what the RAM operation is doing.
OPERATION_DEPRECATED = 25;
}
enum Namespace {
NAMESPACE_UNKNOWN = 0;
NAMESPACE_ABI = 1;
NAMESPACE_ACCOUNT = 2;
NAMESPACE_AUTH = 3;
NAMESPACE_AUTH_LINK = 4;
NAMESPACE_CODE = 5;
NAMESPACE_DEFERRED_TRX = 6;
NAMESPACE_SECONDARY_INDEX = 7;
NAMESPACE_TABLE = 8;
NAMESPACE_TABLE_ROW = 9;
// Added in EOSIO 2.1.x
NAMESPACE_KV = 10;
}
enum Action {
ACTION_UNKNOWN = 0;
ACTION_ADD = 1;
ACTION_CANCEL = 2;
ACTION_CORRECTION = 3;
ACTION_PUSH = 4;
ACTION_REMOVE = 5;
ACTION_UPDATE = 6;
}
}
message RAMCorrectionOp {
string correction_id = 1;
string unique_key = 2;
string payer = 3;
int64 delta = 4;
}
message TableOp {
Operation operation = 1;
uint32 action_index = 2;
string payer = 3;
string code = 4;
string scope = 5;
string table_name = 6;
enum Operation {
OPERATION_UNKNOWN = 0;
OPERATION_INSERT = 1;
OPERATION_REMOVE = 2;
}
}
message DTrxOp {
Operation operation = 1;
uint32 action_index = 2;
string sender = 3;
string sender_id = 4;
string payer = 5;
string published_at = 6;
string delay_until = 7;
string expiration_at = 8;
string transaction_id = 9;
SignedTransaction transaction = 10;
enum Operation {
OPERATION_UNKNOWN = 0;
OPERATION_CREATE = 1;
OPERATION_PUSH_CREATE = 2;
OPERATION_FAILED = 3;
OPERATION_CANCEL = 4;
OPERATION_MODIFY_CANCEL = 5;
OPERATION_MODIFY_CREATE = 6;
}
}
message ExtDTrxOp {
string source_transaction_id = 1;
uint64 block_num = 2;
string block_id = 3;
google.protobuf.Timestamp block_time = 4;
DTrxOp dtrx_op = 5;
}
message FeatureOp {
string kind = 1;
uint32 action_index = 2;
string feature_digest = 3;
Feature feature = 4;
enum Kind {
KIND_UNKNOWN = 0;
KIND_PRE_ACTIVATE = 1;
KIND_ACTIVATE = 2;
}
}
message CreationFlatNode {
int32 creator_action_index = 1;
uint32 execution_action_index = 2;
}
message PermOp {
Operation operation = 1;
uint32 action_index = 2;
PermissionObject old_perm = 8;
PermissionObject new_perm = 9;
enum Operation {
OPERATION_UNKNOWN = 0;
OPERATION_INSERT = 1;
OPERATION_UPDATE = 2;
OPERATION_REMOVE = 3;
}
}
message PermissionObject {
// Id represents the EOSIO internal id of this permission object.
uint64 id = 10;
// ParentId represents the EOSIO internal id of the parent's of this permission object.
uint64 parent_id = 11;
// Owner is the account for which this permission was set
string owner = 1;
// Name is the permission's name this permission object is known as.
string name = 2;
google.protobuf.Timestamp last_updated = 3;
Authority authority = 4;
}
message Permission {
string name = 1;
string parent = 2;
Authority required_auth = 3;
}
message Authority {
uint32 threshold = 1;
repeated KeyWeight keys = 2;
repeated PermissionLevelWeight accounts = 3;
repeated WaitWeight waits = 4;
}
message KeyWeight {
string public_key = 1;
uint32 weight = 2;
}
message PermissionLevel {
string actor = 1;
string permission = 2;
}
message PermissionLevelWeight {
PermissionLevel permission = 1;
uint32 weight = 2;
}
message WaitWeight {
uint32 wait_sec = 1;
uint32 weight = 2;
}
message RlimitOp {
Operation operation = 1;
oneof kind {
RlimitState state = 2;
RlimitConfig config = 3;
RlimitAccountLimits account_limits = 4;
RlimitAccountUsage account_usage = 5;
}
enum Operation {
OPERATION_UNKNOWN = 0;
OPERATION_INSERT = 1;
OPERATION_UPDATE = 2;
}
}
message RlimitState {
UsageAccumulator average_block_net_usage = 1;
UsageAccumulator average_block_cpu_usage = 2;
uint64 pending_net_usage = 3;
uint64 pending_cpu_usage = 4;
uint64 total_net_weight = 5;
uint64 total_cpu_weight = 6;
uint64 total_ram_bytes = 7;
uint64 virtual_net_limit = 8;
uint64 virtual_cpu_limit = 9;
}
message RlimitConfig {
ElasticLimitParameters cpu_limit_parameters = 1;
ElasticLimitParameters net_limit_parameters = 2;
uint32 account_cpu_usage_average_window = 3;
uint32 account_net_usage_average_window = 4;
}
message RlimitAccountLimits {
string owner = 1;
bool pending = 2;
int64 net_weight = 3;
int64 cpu_weight = 4;
int64 ram_bytes = 5;
}
message RlimitAccountUsage {
string owner = 1;
UsageAccumulator net_usage = 2;
UsageAccumulator cpu_usage = 3;
uint64 ram_usage = 4;
}
message UsageAccumulator {
uint32 last_ordinal = 1;
uint64 value_ex = 2;
uint64 consumed = 3;
}
message ElasticLimitParameters {
uint64 target = 1;
uint64 max = 2;
uint32 periods = 3;
uint32 max_multiplier = 4;
Ratio contract_rate = 5;
Ratio expand_rate = 6;
}
message Ratio {
uint64 numerator = 1;
uint64 denominator = 2;
}
message Exception {
int32 code = 1;
string name = 2;
string message = 3;
repeated LogMessage stack = 4;
message LogMessage {
LogContext context = 1;
string format = 2;
// This is actually a Pair<string, any> in C++ which get serialized usually
// as a JSON object. However, it seems some string sequences could be
// invalid UTF-8 characters. As such, we decided to use a bytes array. Can
// be interpreted as a UTF-8 string containing JSON, just be ready to