-
Notifications
You must be signed in to change notification settings - Fork 4
/
eth1.proto
179 lines (156 loc) · 3.95 KB
/
eth1.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
syntax = "proto3";
package types;
import "google/protobuf/timestamp.proto";
option go_package = "./types";
// Eth1Block is stored in the blocks table under <chainID>:<reversePaddedNumber>
message Eth1Block {
bytes hash = 1;
bytes parent_hash = 2;
bytes uncle_hash = 3;
bytes coinbase = 4;
bytes root = 5;
bytes tx_hash = 6;
bytes receipt_hash = 7;
bytes difficulty = 8;
uint64 number = 9;
uint64 gas_limit = 10;
uint64 gas_used = 11;
google.protobuf.Timestamp time = 12;
bytes extra = 13;
bytes mix_digest = 14;
bytes bloom = 17;
bytes base_fee = 18;
repeated Eth1Block uncles = 20;
repeated Eth1Transaction transactions = 21;
}
message Eth1Transaction {
uint32 type = 1;
uint64 nonce = 2;
bytes gas_price = 3;
bytes max_priority_fee_per_gas = 4;
bytes max_fee_per_gas = 5;
uint64 gas = 6;
bytes value = 7;
bytes data = 8;
bytes to = 12;
bytes from = 13;
bytes chain_id = 14;
repeated AccessList access_list = 15;
bytes hash = 16;
// Receipt fields
bytes contract_address = 17;
uint64 commulative_gas_used = 18;
uint64 gas_used = 19;
bytes logs_bloom = 20;
uint64 status = 21;
string error_msg = 22;
repeated Eth1Log logs = 23;
// Internal transactions
repeated Eth1InternalTransaction itx = 24;
}
message AccessList {
bytes address = 1;
repeated bytes storage_keys = 2;
}
message Eth1Log {
bytes address = 1;
bytes data = 2;
bool removed = 3;
repeated bytes topics = 4;
}
message Eth1InternalTransaction {
string type = 1;
bytes from = 2;
bytes to = 3;
bytes value = 4;
string error_msg = 5;
string path = 6;
}
// Indexed structs stored in the data table
message Eth1BlockIndexed {
bytes hash = 1;
bytes parent_hash = 2;
bytes uncle_hash = 3;
bytes coinbase = 4;
bytes difficulty = 8;
uint64 number = 9;
uint64 gas_limit = 10;
uint64 gas_used = 11;
google.protobuf.Timestamp time = 12;
bytes base_fee = 18;
uint64 uncle_count = 19;
uint64 transaction_count = 20;
bytes mev = 21;
bytes lowest_gas_price = 22;
bytes highest_gas_price = 23;
// uint64 duration = 24;
bytes tx_reward = 25;
bytes uncle_reward = 26;
// bytes base_fee_change = 27;
// bytes block_utilization_change = 28;
uint64 internal_transaction_count = 29;
}
message Eth1UncleIndexed {
uint64 block_number =1;
uint64 number = 2;
uint64 gas_limit = 3;
uint64 gas_used = 4;
bytes base_fee = 5;
bytes difficulty = 6;
google.protobuf.Timestamp time = 7;
bytes reward = 8;
}
message Eth1TransactionIndexed {
bytes hash = 1;
uint64 block_number = 2;
google.protobuf.Timestamp time = 3;
bytes method_id = 4;
bytes from = 5;
bytes to = 6;
bytes value = 7;
bytes tx_fee = 8;
bytes gas_price = 9;
bool is_contract_creation = 10;
bool invokes_contract = 11;
string error_msg = 12;
}
message Eth1InternalTransactionIndexed {
bytes parent_hash = 1;
uint64 block_number = 2;
string type = 3;
google.protobuf.Timestamp time = 4;
bytes from = 5;
bytes to = 6;
bytes value = 7;
}
message Eth1ERC20Indexed {
bytes parent_hash = 1;
uint64 block_number = 2;
bytes token_address = 3;
google.protobuf.Timestamp time = 4;
bytes from = 5;
bytes to = 6;
bytes value = 7;
}
message Eth1ERC721Indexed {
bytes parent_hash = 1;
uint64 block_number = 2;
bytes token_address = 3;
google.protobuf.Timestamp time = 4;
bytes from = 5;
bytes to = 6;
bytes token_id = 7;
}
// https://eips.ethereum.org/EIPS/eip-1155
message ETh1ERC1155Indexed {
bytes parent_hash = 1;
uint64 block_number = 2;
bytes token_address = 3;
google.protobuf.Timestamp time = 4;
bytes from = 5;
bytes to = 6;
bytes token_id = 7;
bytes value = 8;
// the address approved to make the transfer
bytes operator = 9;
}