@@ -20,82 +20,23 @@ message UpdateMsg {
2020 bytes merkle_tree_nodes = 1 ;
2121 // RLP serialization of the new block
2222 bytes rlp_block = 2 ;
23- // A list of state update operations for the new block
23+ // A list of state update operations for the new block.
2424 repeated UpdateOp operations = 3 ;
2525}
2626
27- // UpdateOp to update the state in the storage nodes
27+ // Used for each update to the node's merkle tree.
2828message UpdateOp {
29- // A state update operation can be either an ValueChangeOp,
30- // DeletionOp, CreationOP or an ExecutionOp
31- oneof updates {
32- ValueChangeOp value = 1 ;
33- DeletionOp delete = 2 ;
34- CreationOp create = 3 ;
35- ExecutionOp execute = 4 ;
36- }
37- }
38-
39- // ValueChangeOp to modify the balance and nonce of an account in global state
40- message ValueChangeOp {
41- // Address of the account to be modified
42- bytes account = 1 ; // 20 byte big endian account number
43- // Modified account balance
44- bytes value = 2 ; // 32 byte big endian unsigned integer
45- // Number of times an account is modified;
46- // required to update the account nonce
47- uint32 changes = 3 ;
48- }
49-
50- // DeletionOp to delete an existing account in the global state
51- message DeletionOp {
52- // Address of the account to be deleted
53- bytes account = 1 ; // 20 byte big endian account number
54- }
55-
56- // CreationOp to create a new account in the global state
57- message CreationOp {
58- // Address of the an account to be created
59- bytes account = 1 ; // 20 byte big endian account number
60- // Balance of the new account
61- bytes value = 2 ; // 32 byte big endian unsigned integer
62- // Code to initialize the account with
63- bytes code = 3 ;
64- // A list of key, value pairs corresponding to the account storage
65- repeated StorageInsertion storage = 4 ;
66- }
67-
68- // ExecutionOp to modify an accounts balance and storage in the global state
69- // resulting from a contract execution
70- message ExecutionOp {
71- // Address of the account
72- bytes account = 1 ; // 20 byte big endian account number
73- // Account's updated balance
74- bytes value = 2 ; // 32 byte big endian unsigned integer
75- // Account's updated storage entries
76- repeated StorageUpdate storage = 3 ;
29+ bytes account = 1 ; // 20 bytes, BE account number
30+ bytes balance = 2 ; // 32 bytes, BE new balance. May not be present if the balance is unchanged.
31+ uint32 updates = 3 ; // Increment by one for each nonce update. May not be present if the nonce is unchanged.
32+ repeated StorageUpdate storage_update = 4 ; // Storage updates, if any.
33+ bytes code = 5 ; // Code bytes, only applicable for creation of a contract account.
34+ bool deleted = 6 ; // Set if the account was deleted. All other fields, if present, are ignored.
7735}
7836
7937// StorageUpdate op to update a global state account's internal storgage
8038message StorageUpdate {
81- // Storage entries (insert new/modified entries or
82- // delete existing entries)
83- oneof updates {
84- StorageInsertion inserts = 1 ;
85- StorageDeletion deletes = 2 ;
86- }
87- }
88-
89- // StorageInsertion op to insert a new storgae entry into a global state account
90- message StorageInsertion {
91- // Storage entry to be inserted or updated
9239 bytes key = 1 ; // 32 byte big endian unsigned integer
9340 // New or updated value of the storage entry
94- bytes value = 2 ; // 32 byte big endian unsigned integer
95- }
96-
97- // StorageDeletion op to delete an account's internal storage entry
98- message StorageDeletion {
99- // Storage entry to be deleted
100- bytes key = 1 ; // 32 byte big endian unsigned integer
41+ bytes value = 2 ; // 32 byte big endian unsigned integer, or 0 if the key was deleted.
10142}
0 commit comments