@@ -4,39 +4,46 @@ package sf.substreams.rpc.v2;
4
4
5
5
import "google/protobuf/any.proto" ;
6
6
import "substreams.proto" ;
7
+ import "firehose.proto" ;
7
8
8
- service Stream {
9
- rpc Blocks ( Request ) returns (stream Response );
9
+ service EndpointInfo {
10
+ rpc Info ( sf . firehose . v2 . InfoRequest ) returns (sf . firehose . v2 . InfoResponse );
10
11
}
11
12
13
+ service Stream { rpc Blocks (Request ) returns (stream Response ); }
14
+
12
15
message Request {
13
16
int64 start_block_num = 1 ;
14
17
string start_cursor = 2 ;
15
18
uint64 stop_block_num = 3 ;
16
19
17
20
// With final_block_only, you only receive blocks that are irreversible:
18
- // 'final_block_height' will be equal to current block and no 'undo_signal' will ever be sent
21
+ // 'final_block_height' will be equal to current block and no 'undo_signal'
22
+ // will ever be sent
19
23
bool final_blocks_only = 4 ;
20
24
21
- // Substreams has two mode when executing your module(s) either development mode or production
22
- // mode. Development and production modes impact the execution of Substreams, important aspects
23
- // of execution include:
25
+ // Substreams has two mode when executing your module(s) either development
26
+ // mode or production mode . Development and production modes impact the
27
+ // execution of Substreams, important aspects of execution include:
24
28
// * The time required to reach the first byte.
25
29
// * The speed that large ranges get executed.
26
30
// * The module logs and outputs sent back to the client.
27
31
//
28
- // By default, the engine runs in developer mode, with richer and deeper output. Differences
29
- // between production and development modes include:
30
- // * Forward parallel execution is enabled in production mode and disabled in development mode
31
- // * The time required to reach the first byte in development mode is faster than in production mode.
32
+ // By default, the engine runs in developer mode, with richer and deeper
33
+ // output. Differences between production and development modes include:
34
+ // * Forward parallel execution is enabled in production mode and disabled in
35
+ // development mode
36
+ // * The time required to reach the first byte in development mode is faster
37
+ // than in production mode.
32
38
//
33
39
// Specific attributes of development mode include:
34
40
// * The client will receive all of the executed module's logs.
35
- // * It's possible to request specific store snapshots in the execution tree (via `debug_initial_store_snapshot_for_modules`).
41
+ // * It's possible to request specific store snapshots in the execution tree
42
+ // (via `debug_initial_store_snapshot_for_modules`).
36
43
// * Multiple module's output is possible.
37
44
//
38
- // With production mode`, however, you trade off functionality for high speed enabling forward
39
- // parallel execution of module ahead of time.
45
+ // With production mode`, however, you trade off functionality for high speed
46
+ // enabling forward parallel execution of module ahead of time.
40
47
bool production_mode = 5 ;
41
48
42
49
string output_module = 6 ;
@@ -47,23 +54,24 @@ message Request {
47
54
repeated string debug_initial_store_snapshot_for_modules = 10 ;
48
55
}
49
56
50
-
51
57
message Response {
52
58
oneof message {
53
- SessionInit session = 1 ; // Always sent first
54
- ModulesProgress progress = 2 ; // Progress of data preparation, before sending in the stream of `data` events.
59
+ SessionInit session = 1 ; // Always sent first
60
+ ModulesProgress progress = 2 ; // Progress of data preparation, before
61
+ // sending in the stream of `data` events.
55
62
BlockScopedData block_scoped_data = 3 ;
56
63
BlockUndoSignal block_undo_signal = 4 ;
57
64
Error fatal_error = 5 ;
58
65
59
- // Available only in developer mode, and only if `debug_initial_store_snapshot_for_modules` is set.
66
+ // Available only in developer mode, and only if
67
+ // `debug_initial_store_snapshot_for_modules` is set.
60
68
InitialSnapshotData debug_snapshot_data = 10 ;
61
- // Available only in developer mode, and only if `debug_initial_store_snapshot_for_modules` is set.
69
+ // Available only in developer mode, and only if
70
+ // `debug_initial_store_snapshot_for_modules` is set.
62
71
InitialSnapshotComplete debug_snapshot_complete = 11 ;
63
72
}
64
73
}
65
74
66
-
67
75
// BlockUndoSignal informs you that every bit of data
68
76
// with a block number above 'last_valid_block' has been reverted
69
77
// on-chain. Delete that data and restart from 'last_valid_cursor'
@@ -84,16 +92,14 @@ message BlockScopedData {
84
92
repeated StoreModuleOutput debug_store_outputs = 11 ;
85
93
}
86
94
87
- message SessionInit {
95
+ message SessionInit {
88
96
string trace_id = 1 ;
89
97
uint64 resolved_start_block = 2 ;
90
98
uint64 linear_handoff_block = 3 ;
91
99
uint64 max_parallel_workers = 4 ;
92
100
}
93
101
94
- message InitialSnapshotComplete {
95
- string cursor = 1 ;
96
- }
102
+ message InitialSnapshotComplete { string cursor = 1 ; }
97
103
98
104
message InitialSnapshotData {
99
105
string module_name = 1 ;
@@ -110,9 +116,9 @@ message MapModuleOutput {
110
116
}
111
117
112
118
// StoreModuleOutput are produced for store modules in development mode.
113
- // It is not possible to retrieve store models in production, with parallelization
114
- // enabled. If you need the deltas directly, write a pass through mapper module
115
- // that will get them down to you.
119
+ // It is not possible to retrieve store models in production, with
120
+ // parallelization enabled. If you need the deltas directly, write a pass
121
+ // through mapper module that will get them down to you.
116
122
message StoreModuleOutput {
117
123
string name = 1 ;
118
124
repeated StoreDelta debug_store_deltas = 2 ;
@@ -121,16 +127,18 @@ message StoreModuleOutput {
121
127
122
128
message OutputDebugInfo {
123
129
repeated string logs = 1 ;
124
- // LogsTruncated is a flag that tells you if you received all the logs or if they
125
- // were truncated because you logged too much (fixed limit currently is set to 128 KiB).
130
+ // LogsTruncated is a flag that tells you if you received all the logs or if
131
+ // they were truncated because you logged too much (fixed limit currently is
132
+ // set to 128 KiB).
126
133
bool logs_truncated = 2 ;
127
134
bool cached = 3 ;
128
135
}
129
136
130
137
// ModulesProgress is a message that is sent every 500ms
131
138
message ModulesProgress {
132
139
// previously: repeated ModuleProgress modules = 1;
133
- // these previous `modules` messages were sent in bursts and are not sent anymore.
140
+ // these previous `modules` messages were sent in bursts and are not sent
141
+ // anymore.
134
142
reserved 1 ;
135
143
// List of jobs running on tier2 servers
136
144
repeated Job running_jobs = 2 ;
@@ -147,73 +155,82 @@ message ProcessedBytes {
147
155
uint64 total_bytes_written = 2 ;
148
156
}
149
157
150
-
151
158
message Error {
152
159
string module = 1 ;
153
160
string reason = 2 ;
154
161
repeated string logs = 3 ;
155
- // FailureLogsTruncated is a flag that tells you if you received all the logs or if they
156
- // were truncated because you logged too much (fixed limit currently is set to 128 KiB).
162
+ // FailureLogsTruncated is a flag that tells you if you received all the logs
163
+ // or if they were truncated because you logged too much (fixed limit
164
+ // currently is set to 128 KiB).
157
165
bool logs_truncated = 4 ;
158
166
}
159
167
160
-
161
168
message Job {
162
- uint32 stage = 1 ;
163
- uint64 start_block = 2 ;
164
- uint64 stop_block = 3 ;
165
- uint64 processed_blocks = 4 ;
166
- uint64 duration_ms = 5 ;
169
+ uint32 stage = 1 ;
170
+ uint64 start_block = 2 ;
171
+ uint64 stop_block = 3 ;
172
+ uint64 processed_blocks = 4 ;
173
+ uint64 duration_ms = 5 ;
167
174
}
168
175
169
176
message Stage {
170
- repeated string modules = 1 ;
171
- repeated BlockRange completed_ranges = 2 ;
177
+ repeated string modules = 1 ;
178
+ repeated BlockRange completed_ranges = 2 ;
172
179
}
173
180
174
- // ModuleStats gathers metrics and statistics from each module, running on tier1 or tier2
175
- // All the 'count' and 'time_ms' values may include duplicate for each stage going over that module
181
+ // ModuleStats gathers metrics and statistics from each module, running on tier1
182
+ // or tier2 All the 'count' and 'time_ms' values may include duplicate for each
183
+ // stage going over that module
176
184
message ModuleStats {
177
- // name of the module
178
- string name = 1 ;
185
+ // name of the module
186
+ string name = 1 ;
179
187
180
- // total_processed_blocks is the sum of blocks sent to that module code
181
- uint64 total_processed_block_count = 2 ;
182
- // total_processing_time_ms is the sum of all time spent running that module code
183
- uint64 total_processing_time_ms = 3 ;
188
+ // total_processed_blocks is the sum of blocks sent to that module code
189
+ uint64 total_processed_block_count = 2 ;
190
+ // total_processing_time_ms is the sum of all time spent running that module
191
+ // code
192
+ uint64 total_processing_time_ms = 3 ;
184
193
185
- //// external_calls are chain-specific intrinsics, like "Ethereum RPC calls".
186
- repeated ExternalCallMetric external_call_metrics = 4 ;
194
+ //// external_calls are chain-specific intrinsics, like "Ethereum RPC calls".
195
+ repeated ExternalCallMetric external_call_metrics = 4 ;
187
196
188
- // total_store_operation_time_ms is the sum of all time spent running that module code waiting for a store operation (ex: read, write, delete...)
189
- uint64 total_store_operation_time_ms = 5 ;
190
- // total_store_read_count is the sum of all the store Read operations called from that module code
191
- uint64 total_store_read_count = 6 ;
197
+ // total_store_operation_time_ms is the sum of all time spent running that
198
+ // module code waiting for a store operation (ex: read, write, delete...)
199
+ uint64 total_store_operation_time_ms = 5 ;
200
+ // total_store_read_count is the sum of all the store Read operations called
201
+ // from that module code
202
+ uint64 total_store_read_count = 6 ;
192
203
193
- // total_store_write_count is the sum of all store Write operations called from that module code (store-only)
194
- uint64 total_store_write_count = 10 ;
204
+ // total_store_write_count is the sum of all store Write operations called
205
+ // from that module code (store-only)
206
+ uint64 total_store_write_count = 10 ;
195
207
196
- // total_store_deleteprefix_count is the sum of all store DeletePrefix operations called from that module code (store-only)
197
- // note that DeletePrefix can be a costly operation on large stores
198
- uint64 total_store_deleteprefix_count = 11 ;
208
+ // total_store_deleteprefix_count is the sum of all store DeletePrefix
209
+ // operations called from that module code (store-only) note that DeletePrefix
210
+ // can be a costly operation on large stores
211
+ uint64 total_store_deleteprefix_count = 11 ;
199
212
200
- // store_size_bytes is the uncompressed size of the full KV store for that module, from the last 'merge' operation (store-only)
201
- uint64 store_size_bytes = 12 ;
213
+ // store_size_bytes is the uncompressed size of the full KV store for that
214
+ // module, from the last 'merge' operation (store-only)
215
+ uint64 store_size_bytes = 12 ;
202
216
203
- // total_store_merging_time_ms is the time spent merging partial stores into a full KV store for that module (store-only)
204
- uint64 total_store_merging_time_ms = 13 ;
217
+ // total_store_merging_time_ms is the time spent merging partial stores into a
218
+ // full KV store for that module (store-only)
219
+ uint64 total_store_merging_time_ms = 13 ;
205
220
206
- // store_currently_merging is true if there is a merging operation (partial store to full KV store) on the way.
207
- bool store_currently_merging = 14 ;
221
+ // store_currently_merging is true if there is a merging operation (partial
222
+ // store to full KV store) on the way.
223
+ bool store_currently_merging = 14 ;
208
224
209
- // highest_contiguous_block is the highest block in the highest merged full KV store of that module (store-only)
210
- uint64 highest_contiguous_block = 15 ;
225
+ // highest_contiguous_block is the highest block in the highest merged full KV
226
+ // store of that module (store-only)
227
+ uint64 highest_contiguous_block = 15 ;
211
228
}
212
229
213
230
message ExternalCallMetric {
214
- string name = 1 ;
215
- uint64 count = 2 ;
216
- uint64 time_ms = 3 ;
231
+ string name = 1 ;
232
+ uint64 count = 2 ;
233
+ uint64 time_ms = 3 ;
217
234
}
218
235
219
236
message StoreDelta {
0 commit comments