-
Notifications
You must be signed in to change notification settings - Fork 29
/
state.proto
36 lines (30 loc) · 1.27 KB
/
state.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
syntax = "proto3";
import "p2p/proto/common.proto";
// optimized for flat storage, not through a trie (not sharing key prefixes)
message ContractStoredValue {
Felt252 key = 1;
Felt252 value = 2;
}
message ContractDiff {
Address address = 1;
optional Felt252 nonce = 2; // Present only if the nonce was updated
optional Hash class_hash = 3; // Present only if the contract was deployed or replaced in this block.
repeated ContractStoredValue values = 4;
VolitionDomain domain = 5;
}
message DeclaredClass {
Hash class_hash = 1;
optional Hash compiled_class_hash = 2; // Present only if the class is Cairo1
}
message StateDiffsRequest {
Iteration iteration = 1;
}
// Responses are sent ordered by the order given in the request.
message StateDiffsResponse {
// All of the messages related to a block need to be sent before a message from the next block is sent.
oneof state_diff_message {
ContractDiff contract_diff = 1; // Multiple contract diffs for the same contract may appear continuously if the diff is too large or if it's more convenient.
DeclaredClass declared_class = 2;
Fin fin = 3; // Fin is sent after the peer sent all the data or when it encountered a block that it doesn't have its state diff.
}
}