envio 3.1.2 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/evm.schema.json +83 -11
- package/fuel.schema.json +83 -11
- package/index.d.ts +184 -3
- package/package.json +6 -6
- package/src/Batch.res +2 -2
- package/src/ChainFetcher.res +27 -3
- package/src/ChainFetcher.res.mjs +17 -3
- package/src/ChainManager.res +163 -0
- package/src/ChainManager.res.mjs +136 -0
- package/src/Config.res +213 -30
- package/src/Config.res.mjs +102 -41
- package/src/Core.res +16 -10
- package/src/Ecosystem.res +0 -3
- package/src/Env.res +2 -2
- package/src/Env.res.mjs +2 -2
- package/src/Envio.res +101 -2
- package/src/Envio.res.mjs +2 -3
- package/src/EventConfigBuilder.res +52 -0
- package/src/EventConfigBuilder.res.mjs +32 -0
- package/src/EventUtils.res +2 -2
- package/src/FetchState.res +23 -14
- package/src/FetchState.res.mjs +21 -15
- package/src/GlobalState.res +219 -363
- package/src/GlobalState.res.mjs +314 -491
- package/src/GlobalStateManager.res +49 -59
- package/src/GlobalStateManager.res.mjs +5 -4
- package/src/GlobalStateManager.resi +1 -1
- package/src/HandlerLoader.res +12 -1
- package/src/HandlerLoader.res.mjs +6 -1
- package/src/HandlerRegister.res +9 -9
- package/src/HandlerRegister.res.mjs +9 -9
- package/src/Hasura.res +102 -32
- package/src/Hasura.res.mjs +88 -34
- package/src/InMemoryStore.res +10 -1
- package/src/InMemoryStore.res.mjs +4 -1
- package/src/InMemoryTable.res +83 -136
- package/src/InMemoryTable.res.mjs +57 -86
- package/src/Internal.res +54 -5
- package/src/Internal.res.mjs +2 -8
- package/src/LazyLoader.res +2 -2
- package/src/LazyLoader.res.mjs +3 -3
- package/src/LoadLayer.res +47 -60
- package/src/LoadLayer.res.mjs +28 -50
- package/src/LoadLayer.resi +2 -5
- package/src/LogSelection.res +4 -4
- package/src/LogSelection.res.mjs +5 -7
- package/src/Logging.res +1 -1
- package/src/Main.res +61 -2
- package/src/Main.res.mjs +37 -1
- package/src/Persistence.res +3 -16
- package/src/PgStorage.res +125 -114
- package/src/PgStorage.res.mjs +112 -95
- package/src/Ports.res +5 -0
- package/src/Ports.res.mjs +9 -0
- package/src/Prometheus.res +3 -3
- package/src/Prometheus.res.mjs +4 -4
- package/src/ReorgDetection.res +4 -4
- package/src/ReorgDetection.res.mjs +4 -5
- package/src/SafeCheckpointTracking.res +16 -16
- package/src/SafeCheckpointTracking.res.mjs +2 -2
- package/src/SimulateItems.res +10 -14
- package/src/SimulateItems.res.mjs +5 -2
- package/src/Sink.res +1 -1
- package/src/Sink.res.mjs +1 -2
- package/src/SvmTypes.res +9 -0
- package/src/SvmTypes.res.mjs +14 -0
- package/src/TestIndexer.res +17 -57
- package/src/TestIndexer.res.mjs +14 -48
- package/src/TestIndexerProxyStorage.res +23 -23
- package/src/TestIndexerProxyStorage.res.mjs +12 -15
- package/src/Throttler.res +2 -2
- package/src/Time.res +2 -2
- package/src/Time.res.mjs +2 -2
- package/src/UserContext.res +19 -118
- package/src/UserContext.res.mjs +10 -66
- package/src/Utils.res +15 -15
- package/src/Utils.res.mjs +7 -8
- package/src/adapters/MarkBatchProcessedAdapter.res +5 -0
- package/src/adapters/MarkBatchProcessedAdapter.res.mjs +14 -0
- package/src/bindings/BigDecimal.res +1 -1
- package/src/bindings/BigDecimal.res.mjs +2 -2
- package/src/bindings/ClickHouse.res +8 -6
- package/src/bindings/ClickHouse.res.mjs +5 -5
- package/src/bindings/Hrtime.res +1 -1
- package/src/bindings/Pino.res +2 -2
- package/src/bindings/Pino.res.mjs +3 -4
- package/src/db/EntityFilter.res +410 -0
- package/src/db/EntityFilter.res.mjs +424 -0
- package/src/db/EntityHistory.res +1 -1
- package/src/db/EntityHistory.res.mjs +1 -1
- package/src/db/InternalTable.res +10 -10
- package/src/db/InternalTable.res.mjs +41 -45
- package/src/db/Schema.res +2 -2
- package/src/db/Schema.res.mjs +3 -3
- package/src/db/Table.res +106 -22
- package/src/db/Table.res.mjs +84 -35
- package/src/sources/EventRouter.res +67 -2
- package/src/sources/EventRouter.res.mjs +45 -3
- package/src/sources/Evm.res +0 -7
- package/src/sources/Evm.res.mjs +0 -15
- package/src/sources/EvmChain.res +1 -1
- package/src/sources/EvmChain.res.mjs +1 -2
- package/src/sources/EvmRpcClient.res +42 -0
- package/src/sources/EvmRpcClient.res.mjs +64 -0
- package/src/sources/Fuel.res +0 -7
- package/src/sources/Fuel.res.mjs +0 -15
- package/src/sources/HyperFuelSource.res +5 -4
- package/src/sources/HyperFuelSource.res.mjs +2 -2
- package/src/sources/HyperSyncClient.res +9 -5
- package/src/sources/HyperSyncClient.res.mjs +2 -2
- package/src/sources/HyperSyncHeightStream.res +2 -2
- package/src/sources/HyperSyncHeightStream.res.mjs +2 -2
- package/src/sources/HyperSyncSource.res +10 -9
- package/src/sources/HyperSyncSource.res.mjs +4 -4
- package/src/sources/Rpc.res +1 -5
- package/src/sources/Rpc.res.mjs +1 -9
- package/src/sources/RpcSource.res +57 -21
- package/src/sources/RpcSource.res.mjs +47 -20
- package/src/sources/RpcWebSocketHeightStream.res +1 -1
- package/src/sources/SourceManager.res +3 -2
- package/src/sources/SourceManager.res.mjs +1 -1
- package/src/sources/Svm.res +3 -10
- package/src/sources/Svm.res.mjs +4 -18
- package/src/sources/SvmHyperSyncClient.res +265 -0
- package/src/sources/SvmHyperSyncClient.res.mjs +28 -0
- package/src/sources/SvmHyperSyncSource.res +638 -0
- package/src/sources/SvmHyperSyncSource.res.mjs +557 -0
- package/src/tui/Tui.res +9 -2
- package/src/tui/Tui.res.mjs +18 -3
- package/src/tui/components/BufferedProgressBar.res +2 -2
- package/src/tui/components/TuiData.res +3 -0
- package/svm.schema.json +523 -14
- package/src/TableIndices.res +0 -115
- package/src/TableIndices.res.mjs +0 -144
package/src/ChainManager.res
CHANGED
|
@@ -193,3 +193,166 @@ let getSafeCheckpointId = (chainManager: t) => {
|
|
|
193
193
|
| _ => None // No safe checkpoint found
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
Takes in a chain manager and sets all chains timestamp caught up to head
|
|
199
|
+
when valid state lines up and returns an updated chain manager
|
|
200
|
+
*/
|
|
201
|
+
let updateProgressedChains = (chainManager: t, ~batch: Batch.t) => {
|
|
202
|
+
let nextQueueItemIsNone = chainManager->nextItemIsNone
|
|
203
|
+
|
|
204
|
+
let allChainsAtHead = chainManager->isProgressAtHead
|
|
205
|
+
//Update the timestampCaughtUpToHeadOrEndblock values
|
|
206
|
+
let allChainsReady = ref(true)
|
|
207
|
+
let chainFetchers = chainManager.chainFetchers->ChainMap.map(prev => {
|
|
208
|
+
let cf = prev
|
|
209
|
+
let chain = ChainMap.Chain.makeUnsafe(~chainId=cf.chainConfig.id)
|
|
210
|
+
|
|
211
|
+
let maybeChainAfterBatch =
|
|
212
|
+
batch.progressedChainsById->Utils.Dict.dangerouslyGetByIntNonOption(
|
|
213
|
+
chain->ChainMap.Chain.toChainId,
|
|
214
|
+
)
|
|
215
|
+
|
|
216
|
+
let cf = switch maybeChainAfterBatch {
|
|
217
|
+
| Some(chainAfterBatch) => {
|
|
218
|
+
if cf.committedProgressBlockNumber !== chainAfterBatch.progressBlockNumber {
|
|
219
|
+
Prometheus.ProgressBlockNumber.set(
|
|
220
|
+
~blockNumber=chainAfterBatch.progressBlockNumber,
|
|
221
|
+
~chainId=chain->ChainMap.Chain.toChainId,
|
|
222
|
+
)
|
|
223
|
+
}
|
|
224
|
+
if cf.numEventsProcessed !== chainAfterBatch.totalEventsProcessed {
|
|
225
|
+
Prometheus.ProgressEventsCount.set(
|
|
226
|
+
~processedCount=chainAfterBatch.totalEventsProcessed,
|
|
227
|
+
~chainId=chain->ChainMap.Chain.toChainId,
|
|
228
|
+
)
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// Calculate and set latency metrics
|
|
232
|
+
switch batch->Batch.findLastEventItem(~chainId=chain->ChainMap.Chain.toChainId) {
|
|
233
|
+
| Some(eventItem) => {
|
|
234
|
+
let blockTimestamp = eventItem.timestamp
|
|
235
|
+
let currentTimeMs = Date.now()->Float.toInt
|
|
236
|
+
let blockTimestampMs = blockTimestamp * 1000
|
|
237
|
+
let latencyMs = currentTimeMs - blockTimestampMs
|
|
238
|
+
|
|
239
|
+
Prometheus.ProgressLatency.set(~latencyMs, ~chainId=chain->ChainMap.Chain.toChainId)
|
|
240
|
+
}
|
|
241
|
+
| None => ()
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
{
|
|
245
|
+
...cf,
|
|
246
|
+
// Since we process per chain always in order,
|
|
247
|
+
// we need to calculate it once, by using the first item in a batch
|
|
248
|
+
fetchState: switch cf.fetchState.firstEventBlock {
|
|
249
|
+
| Some(_) => cf.fetchState
|
|
250
|
+
| None =>
|
|
251
|
+
switch batch->Batch.findFirstEventBlockNumber(
|
|
252
|
+
~chainId=chain->ChainMap.Chain.toChainId,
|
|
253
|
+
) {
|
|
254
|
+
| Some(_) as firstEventBlock => {...cf.fetchState, firstEventBlock}
|
|
255
|
+
| None => cf.fetchState
|
|
256
|
+
}
|
|
257
|
+
},
|
|
258
|
+
committedProgressBlockNumber: chainAfterBatch.progressBlockNumber,
|
|
259
|
+
numEventsProcessed: chainAfterBatch.totalEventsProcessed,
|
|
260
|
+
isProgressAtHead: cf.isProgressAtHead || chainAfterBatch.isProgressAtHeadWhenBatchCreated,
|
|
261
|
+
safeCheckpointTracking: switch cf.safeCheckpointTracking {
|
|
262
|
+
| Some(safeCheckpointTracking) =>
|
|
263
|
+
Some(
|
|
264
|
+
safeCheckpointTracking->SafeCheckpointTracking.updateOnNewBatch(
|
|
265
|
+
~sourceBlockNumber=cf.fetchState.knownHeight,
|
|
266
|
+
~chainId=chain->ChainMap.Chain.toChainId,
|
|
267
|
+
~batchCheckpointIds=batch.checkpointIds,
|
|
268
|
+
~batchCheckpointBlockNumbers=batch.checkpointBlockNumbers,
|
|
269
|
+
~batchCheckpointChainIds=batch.checkpointChainIds,
|
|
270
|
+
),
|
|
271
|
+
)
|
|
272
|
+
| None => None
|
|
273
|
+
},
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
| None => cf
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/* strategy for TUI synced status:
|
|
280
|
+
* Firstly -> only update synced status after batch is processed (not on batch creation). But also set when a batch tries to be created and there is no batch
|
|
281
|
+
*
|
|
282
|
+
* Secondly -> reset timestampCaughtUpToHead and isFetching at head when dynamic contracts get registered to a chain if they are not within 0.001 percent of the current block height
|
|
283
|
+
*
|
|
284
|
+
* New conditions for valid synced:
|
|
285
|
+
*
|
|
286
|
+
* CASE 1 (chains are being synchronised at the head)
|
|
287
|
+
*
|
|
288
|
+
* All chain fetchers are fetching at the head AND
|
|
289
|
+
* No events that can be processed on the queue (even if events still exist on the individual queues)
|
|
290
|
+
* CASE 2 (chain finishes earlier than any other chain)
|
|
291
|
+
*
|
|
292
|
+
* CASE 3 endblock has been reached and latest processed block is greater than or equal to endblock (both fields must be Some)
|
|
293
|
+
*
|
|
294
|
+
* The given chain fetcher is fetching at the head or latest processed block >= endblock
|
|
295
|
+
* The given chain has processed all events on the queue
|
|
296
|
+
* see https://github.com/Float-Capital/indexer/pull/1388 */
|
|
297
|
+
let cf = if cf->ChainFetcher.hasProcessedToEndblock {
|
|
298
|
+
// in the case this is already set, don't reset and instead propagate the existing value
|
|
299
|
+
let timestampCaughtUpToHeadOrEndblock =
|
|
300
|
+
cf->ChainFetcher.isReady ? cf.timestampCaughtUpToHeadOrEndblock : Date.make()->Some
|
|
301
|
+
{
|
|
302
|
+
...cf,
|
|
303
|
+
timestampCaughtUpToHeadOrEndblock,
|
|
304
|
+
}
|
|
305
|
+
} else if !(cf->ChainFetcher.isReady) && cf.isProgressAtHead {
|
|
306
|
+
//Only calculate and set timestampCaughtUpToHeadOrEndblock if chain fetcher is at the head and
|
|
307
|
+
//its not already set
|
|
308
|
+
//CASE1
|
|
309
|
+
//All chains are caught up to head chainManager queue returns None
|
|
310
|
+
//Meaning we are busy synchronizing chains at the head
|
|
311
|
+
if nextQueueItemIsNone && allChainsAtHead {
|
|
312
|
+
{
|
|
313
|
+
...cf,
|
|
314
|
+
timestampCaughtUpToHeadOrEndblock: Date.make()->Some,
|
|
315
|
+
}
|
|
316
|
+
} else {
|
|
317
|
+
//CASE2 -> Only calculate if case1 fails
|
|
318
|
+
//All events have been processed on the chain fetchers queue
|
|
319
|
+
//Other chains may be busy syncing
|
|
320
|
+
let hasNoMoreEventsToProcess = cf->ChainFetcher.hasNoMoreEventsToProcess
|
|
321
|
+
|
|
322
|
+
if hasNoMoreEventsToProcess {
|
|
323
|
+
{
|
|
324
|
+
...cf,
|
|
325
|
+
timestampCaughtUpToHeadOrEndblock: Date.make()->Some,
|
|
326
|
+
}
|
|
327
|
+
} else {
|
|
328
|
+
//Default to just returning cf
|
|
329
|
+
cf
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
} else {
|
|
333
|
+
//Default to just returning cf
|
|
334
|
+
cf
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// Set envio_progress_ready per-chain when it first becomes ready
|
|
338
|
+
if cf->ChainFetcher.isReady {
|
|
339
|
+
if !(prev->ChainFetcher.isReady) {
|
|
340
|
+
Prometheus.ProgressReady.set(~chainId=chain->ChainMap.Chain.toChainId)
|
|
341
|
+
}
|
|
342
|
+
} else {
|
|
343
|
+
allChainsReady := false
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
cf
|
|
347
|
+
})
|
|
348
|
+
|
|
349
|
+
if allChainsReady.contents {
|
|
350
|
+
Prometheus.ProgressReady.setAllReady()
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
{
|
|
354
|
+
...chainManager,
|
|
355
|
+
chainFetchers,
|
|
356
|
+
isRealtime: chainManager.isRealtime || allChainsReady.contents,
|
|
357
|
+
}
|
|
358
|
+
}
|
package/src/ChainManager.res.mjs
CHANGED
|
@@ -140,6 +140,141 @@ function getSafeCheckpointId(chainManager) {
|
|
|
140
140
|
}
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
function updateProgressedChains(chainManager, batch) {
|
|
144
|
+
let nextQueueItemIsNone = nextItemIsNone(chainManager);
|
|
145
|
+
let allChainsAtHead = isProgressAtHead(chainManager);
|
|
146
|
+
let allChainsReady = {
|
|
147
|
+
contents: true
|
|
148
|
+
};
|
|
149
|
+
let chainFetchers = ChainMap.map(chainManager.chainFetchers, prev => {
|
|
150
|
+
let chain = ChainMap.Chain.makeUnsafe(prev.chainConfig.id);
|
|
151
|
+
let maybeChainAfterBatch = batch.progressedChainsById[chain];
|
|
152
|
+
let cf;
|
|
153
|
+
if (maybeChainAfterBatch !== undefined) {
|
|
154
|
+
if (prev.committedProgressBlockNumber !== maybeChainAfterBatch.progressBlockNumber) {
|
|
155
|
+
Prometheus.ProgressBlockNumber.set(maybeChainAfterBatch.progressBlockNumber, chain);
|
|
156
|
+
}
|
|
157
|
+
if (prev.numEventsProcessed !== maybeChainAfterBatch.totalEventsProcessed) {
|
|
158
|
+
Prometheus.ProgressEventsCount.set(maybeChainAfterBatch.totalEventsProcessed, chain);
|
|
159
|
+
}
|
|
160
|
+
let eventItem = Batch.findLastEventItem(batch, chain);
|
|
161
|
+
if (eventItem !== undefined) {
|
|
162
|
+
let blockTimestamp = eventItem.timestamp;
|
|
163
|
+
let currentTimeMs = Date.now() | 0;
|
|
164
|
+
let blockTimestampMs = blockTimestamp * 1000 | 0;
|
|
165
|
+
let latencyMs = currentTimeMs - blockTimestampMs | 0;
|
|
166
|
+
Prometheus.ProgressLatency.set(latencyMs, chain);
|
|
167
|
+
}
|
|
168
|
+
let match = prev.fetchState.firstEventBlock;
|
|
169
|
+
let tmp;
|
|
170
|
+
if (match !== undefined) {
|
|
171
|
+
tmp = prev.fetchState;
|
|
172
|
+
} else {
|
|
173
|
+
let firstEventBlock = Batch.findFirstEventBlockNumber(batch, chain);
|
|
174
|
+
if (firstEventBlock !== undefined) {
|
|
175
|
+
let init = prev.fetchState;
|
|
176
|
+
tmp = {
|
|
177
|
+
optimizedPartitions: init.optimizedPartitions,
|
|
178
|
+
startBlock: init.startBlock,
|
|
179
|
+
endBlock: init.endBlock,
|
|
180
|
+
normalSelection: init.normalSelection,
|
|
181
|
+
indexingAddresses: init.indexingAddresses,
|
|
182
|
+
contractConfigs: init.contractConfigs,
|
|
183
|
+
chainId: init.chainId,
|
|
184
|
+
latestOnBlockBlockNumber: init.latestOnBlockBlockNumber,
|
|
185
|
+
blockLag: init.blockLag,
|
|
186
|
+
buffer: init.buffer,
|
|
187
|
+
targetBufferSize: init.targetBufferSize,
|
|
188
|
+
onBlockConfigs: init.onBlockConfigs,
|
|
189
|
+
knownHeight: init.knownHeight,
|
|
190
|
+
firstEventBlock: firstEventBlock
|
|
191
|
+
};
|
|
192
|
+
} else {
|
|
193
|
+
tmp = prev.fetchState;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
let safeCheckpointTracking = prev.safeCheckpointTracking;
|
|
197
|
+
cf = {
|
|
198
|
+
logger: prev.logger,
|
|
199
|
+
fetchState: tmp,
|
|
200
|
+
sourceManager: prev.sourceManager,
|
|
201
|
+
chainConfig: prev.chainConfig,
|
|
202
|
+
isProgressAtHead: prev.isProgressAtHead || maybeChainAfterBatch.isProgressAtHeadWhenBatchCreated,
|
|
203
|
+
timestampCaughtUpToHeadOrEndblock: prev.timestampCaughtUpToHeadOrEndblock,
|
|
204
|
+
committedProgressBlockNumber: maybeChainAfterBatch.progressBlockNumber,
|
|
205
|
+
numEventsProcessed: maybeChainAfterBatch.totalEventsProcessed,
|
|
206
|
+
reorgDetection: prev.reorgDetection,
|
|
207
|
+
safeCheckpointTracking: safeCheckpointTracking !== undefined ? SafeCheckpointTracking.updateOnNewBatch(safeCheckpointTracking, prev.fetchState.knownHeight, chain, batch.checkpointIds, batch.checkpointBlockNumbers, batch.checkpointChainIds) : undefined
|
|
208
|
+
};
|
|
209
|
+
} else {
|
|
210
|
+
cf = prev;
|
|
211
|
+
}
|
|
212
|
+
let cf$1;
|
|
213
|
+
if (ChainFetcher.hasProcessedToEndblock(cf)) {
|
|
214
|
+
let timestampCaughtUpToHeadOrEndblock = ChainFetcher.isReady(cf) ? cf.timestampCaughtUpToHeadOrEndblock : new Date();
|
|
215
|
+
cf$1 = {
|
|
216
|
+
logger: cf.logger,
|
|
217
|
+
fetchState: cf.fetchState,
|
|
218
|
+
sourceManager: cf.sourceManager,
|
|
219
|
+
chainConfig: cf.chainConfig,
|
|
220
|
+
isProgressAtHead: cf.isProgressAtHead,
|
|
221
|
+
timestampCaughtUpToHeadOrEndblock: timestampCaughtUpToHeadOrEndblock,
|
|
222
|
+
committedProgressBlockNumber: cf.committedProgressBlockNumber,
|
|
223
|
+
numEventsProcessed: cf.numEventsProcessed,
|
|
224
|
+
reorgDetection: cf.reorgDetection,
|
|
225
|
+
safeCheckpointTracking: cf.safeCheckpointTracking
|
|
226
|
+
};
|
|
227
|
+
} else if (!ChainFetcher.isReady(cf) && cf.isProgressAtHead) {
|
|
228
|
+
if (nextQueueItemIsNone && allChainsAtHead) {
|
|
229
|
+
cf$1 = {
|
|
230
|
+
logger: cf.logger,
|
|
231
|
+
fetchState: cf.fetchState,
|
|
232
|
+
sourceManager: cf.sourceManager,
|
|
233
|
+
chainConfig: cf.chainConfig,
|
|
234
|
+
isProgressAtHead: cf.isProgressAtHead,
|
|
235
|
+
timestampCaughtUpToHeadOrEndblock: new Date(),
|
|
236
|
+
committedProgressBlockNumber: cf.committedProgressBlockNumber,
|
|
237
|
+
numEventsProcessed: cf.numEventsProcessed,
|
|
238
|
+
reorgDetection: cf.reorgDetection,
|
|
239
|
+
safeCheckpointTracking: cf.safeCheckpointTracking
|
|
240
|
+
};
|
|
241
|
+
} else {
|
|
242
|
+
let hasNoMoreEventsToProcess = ChainFetcher.hasNoMoreEventsToProcess(cf);
|
|
243
|
+
cf$1 = hasNoMoreEventsToProcess ? ({
|
|
244
|
+
logger: cf.logger,
|
|
245
|
+
fetchState: cf.fetchState,
|
|
246
|
+
sourceManager: cf.sourceManager,
|
|
247
|
+
chainConfig: cf.chainConfig,
|
|
248
|
+
isProgressAtHead: cf.isProgressAtHead,
|
|
249
|
+
timestampCaughtUpToHeadOrEndblock: new Date(),
|
|
250
|
+
committedProgressBlockNumber: cf.committedProgressBlockNumber,
|
|
251
|
+
numEventsProcessed: cf.numEventsProcessed,
|
|
252
|
+
reorgDetection: cf.reorgDetection,
|
|
253
|
+
safeCheckpointTracking: cf.safeCheckpointTracking
|
|
254
|
+
}) : cf;
|
|
255
|
+
}
|
|
256
|
+
} else {
|
|
257
|
+
cf$1 = cf;
|
|
258
|
+
}
|
|
259
|
+
if (ChainFetcher.isReady(cf$1)) {
|
|
260
|
+
if (!ChainFetcher.isReady(prev)) {
|
|
261
|
+
Prometheus.ProgressReady.set(chain);
|
|
262
|
+
}
|
|
263
|
+
} else {
|
|
264
|
+
allChainsReady.contents = false;
|
|
265
|
+
}
|
|
266
|
+
return cf$1;
|
|
267
|
+
});
|
|
268
|
+
if (allChainsReady.contents) {
|
|
269
|
+
Prometheus.ProgressReady.setAllReady();
|
|
270
|
+
}
|
|
271
|
+
return {
|
|
272
|
+
chainFetchers: chainFetchers,
|
|
273
|
+
isInReorgThreshold: chainManager.isInReorgThreshold,
|
|
274
|
+
isRealtime: chainManager.isRealtime || allChainsReady.contents
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
|
|
143
278
|
export {
|
|
144
279
|
isProgressInReorgThreshold,
|
|
145
280
|
calculateTargetBufferSize,
|
|
@@ -151,5 +286,6 @@ export {
|
|
|
151
286
|
isProgressAtHead,
|
|
152
287
|
isActivelyIndexing,
|
|
153
288
|
getSafeCheckpointId,
|
|
289
|
+
updateProgressedChains,
|
|
154
290
|
}
|
|
155
291
|
/* Env Not a pure module */
|