forked from starknet-io/starknet-p2p-specs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
common.proto
88 lines (72 loc) · 1.71 KB
/
common.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
syntax = "proto3";
message FieldElement
{
bytes elements = 1;
}
message PeerID
{
bytes id = 1;
}
message BlockHeader
{
FieldElement parent_block_hash = 1;
uint64 block_number = 2;
FieldElement global_state_root = 3;
FieldElement sequencer_address = 4;
uint64 block_timestamp = 5;
uint32 transaction_count = 6;
FieldElement transaction_commitment = 7;
uint32 event_count = 8;
FieldElement event_commitment = 9;
uint32 protocol_version = 10;
}
message InvokeTransaction
{
FieldElement contract_address = 1;
FieldElement entry_point_selector = 2;
repeated FieldElement calldata = 3;
repeated FieldElement signature = 4;
FieldElement max_fee = 5;
FieldElement nonce = 6;
FieldElement version = 7;
}
message DeclareTransaction
{
ContractClass contract_class = 1;
FieldElement sender_address = 2;
FieldElement max_fee = 3;
repeated FieldElement signature = 4;
FieldElement nonce = 5;
FieldElement version = 6;
}
message ContractClass
{
message EntryPoint {
FieldElement selector = 1;
FieldElement offset = 2;
}
repeated EntryPoint constructor_entry_points = 1;
repeated EntryPoint external_entry_points = 2;
repeated EntryPoint l1_handler_entry_points = 3;
repeated string used_builtins = 4;
FieldElement contract_program_hash = 5;
repeated FieldElement bytecode = 6;
string version = 7;
}
message Transaction
{
oneof txn
{
InvokeTransaction invoke = 1;
DeclareTransaction declare = 2;
}
}
message Event
{}
message BlockBody
{
uint32 transaction_count = 1;
repeated Transaction transactions = 2;
uint32 event_count = 3;
repeated Event events = 4;
}