envio 3.0.0-alpha.2 → 3.0.0-alpha.21
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/README.md +164 -30
- package/bin.mjs +49 -0
- package/evm.schema.json +79 -169
- package/fuel.schema.json +50 -21
- package/index.d.ts +578 -1
- package/index.js +4 -0
- package/package.json +47 -31
- package/rescript.json +4 -1
- package/src/Batch.res +11 -8
- package/src/Batch.res.mjs +11 -9
- package/src/ChainFetcher.res +531 -0
- package/src/ChainFetcher.res.mjs +339 -0
- package/src/ChainManager.res +190 -0
- package/src/ChainManager.res.mjs +166 -0
- package/src/Change.res +3 -3
- package/src/Config.gen.ts +19 -0
- package/src/Config.res +725 -25
- package/src/Config.res.mjs +692 -26
- package/src/{Indexer.res → Ctx.res} +1 -1
- package/src/Ecosystem.res +9 -124
- package/src/Ecosystem.res.mjs +19 -160
- package/src/Env.res +33 -73
- package/src/Env.res.mjs +29 -85
- package/src/Envio.gen.ts +3 -1
- package/src/Envio.res +77 -9
- package/src/Envio.res.mjs +39 -1
- package/src/EventConfigBuilder.res +408 -0
- package/src/EventConfigBuilder.res.mjs +376 -0
- package/src/EventProcessing.res +469 -0
- package/src/EventProcessing.res.mjs +337 -0
- package/src/EvmTypes.gen.ts +6 -0
- package/src/EvmTypes.res +1 -0
- package/src/FetchState.res +1256 -639
- package/src/FetchState.res.mjs +1135 -612
- package/src/GlobalState.res +1224 -0
- package/src/GlobalState.res.mjs +1291 -0
- package/src/GlobalStateManager.res +68 -0
- package/src/GlobalStateManager.res.mjs +75 -0
- package/src/GlobalStateManager.resi +7 -0
- package/src/HandlerLoader.res +89 -0
- package/src/HandlerLoader.res.mjs +79 -0
- package/src/HandlerRegister.res +357 -0
- package/src/HandlerRegister.res.mjs +299 -0
- package/src/HandlerRegister.resi +30 -0
- package/src/Hasura.res +111 -175
- package/src/Hasura.res.mjs +88 -150
- package/src/InMemoryStore.res +1 -1
- package/src/InMemoryStore.res.mjs +3 -3
- package/src/InMemoryTable.res +1 -1
- package/src/InMemoryTable.res.mjs +1 -1
- package/src/Internal.gen.ts +6 -0
- package/src/Internal.res +265 -12
- package/src/Internal.res.mjs +115 -1
- package/src/LoadLayer.res +444 -0
- package/src/LoadLayer.res.mjs +296 -0
- package/src/LoadLayer.resi +32 -0
- package/src/LogSelection.res +33 -27
- package/src/LogSelection.res.mjs +6 -0
- package/src/Logging.res +21 -7
- package/src/Logging.res.mjs +16 -8
- package/src/Main.res +390 -0
- package/src/Main.res.mjs +341 -0
- package/src/Persistence.res +7 -21
- package/src/Persistence.res.mjs +3 -3
- package/src/PgStorage.gen.ts +10 -0
- package/src/PgStorage.res +116 -69
- package/src/PgStorage.res.d.mts +5 -0
- package/src/PgStorage.res.mjs +93 -50
- package/src/Prometheus.res +294 -224
- package/src/Prometheus.res.mjs +353 -340
- package/src/ReorgDetection.res +6 -10
- package/src/ReorgDetection.res.mjs +6 -6
- package/src/SafeCheckpointTracking.res +4 -4
- package/src/SafeCheckpointTracking.res.mjs +2 -2
- package/src/SimulateItems.res +353 -0
- package/src/SimulateItems.res.mjs +335 -0
- package/src/Sink.res +4 -2
- package/src/Sink.res.mjs +2 -1
- package/src/TableIndices.res +0 -1
- package/src/TestIndexer.res +913 -0
- package/src/TestIndexer.res.mjs +698 -0
- package/src/TestIndexerProxyStorage.res +205 -0
- package/src/TestIndexerProxyStorage.res.mjs +151 -0
- package/src/TopicFilter.res +1 -1
- package/src/Types.ts +1 -1
- package/src/UserContext.res +424 -0
- package/src/UserContext.res.mjs +279 -0
- package/src/Utils.res +97 -26
- package/src/Utils.res.mjs +91 -44
- package/src/bindings/BigInt.res +10 -0
- package/src/bindings/BigInt.res.mjs +15 -0
- package/src/bindings/ClickHouse.res +120 -23
- package/src/bindings/ClickHouse.res.mjs +118 -28
- package/src/bindings/DateFns.res +74 -0
- package/src/bindings/DateFns.res.mjs +22 -0
- package/src/bindings/EventSource.res +11 -2
- package/src/bindings/EventSource.res.mjs +8 -1
- package/src/bindings/Express.res +1 -0
- package/src/bindings/Hrtime.res +14 -1
- package/src/bindings/Hrtime.res.mjs +22 -2
- package/src/bindings/Hrtime.resi +4 -0
- package/src/bindings/Lodash.res +0 -1
- package/src/bindings/NodeJs.res +49 -3
- package/src/bindings/NodeJs.res.mjs +11 -3
- package/src/bindings/Pino.res +24 -10
- package/src/bindings/Pino.res.mjs +14 -8
- package/src/bindings/Postgres.gen.ts +8 -0
- package/src/bindings/Postgres.res +5 -1
- package/src/bindings/Postgres.res.d.mts +5 -0
- package/src/bindings/PromClient.res +0 -10
- package/src/bindings/PromClient.res.mjs +0 -3
- package/src/bindings/Vitest.res +144 -0
- package/src/bindings/Vitest.res.mjs +9 -0
- package/src/bindings/WebSocket.res +27 -0
- package/src/bindings/WebSocket.res.mjs +2 -0
- package/src/bindings/Yargs.res +8 -0
- package/src/bindings/Yargs.res.mjs +2 -0
- package/src/db/EntityHistory.res +7 -7
- package/src/db/EntityHistory.res.mjs +9 -9
- package/src/db/InternalTable.res +59 -111
- package/src/db/InternalTable.res.mjs +73 -104
- package/src/db/Table.res +27 -8
- package/src/db/Table.res.mjs +25 -14
- package/src/sources/Evm.res +84 -0
- package/src/sources/Evm.res.mjs +105 -0
- package/src/sources/EvmChain.res +94 -0
- package/src/sources/EvmChain.res.mjs +60 -0
- package/src/sources/Fuel.res +19 -34
- package/src/sources/Fuel.res.mjs +34 -16
- package/src/sources/FuelSDK.res +38 -0
- package/src/sources/FuelSDK.res.mjs +29 -0
- package/src/sources/HyperFuel.res +2 -2
- package/src/sources/HyperFuel.resi +1 -1
- package/src/sources/HyperFuelClient.res +2 -2
- package/src/sources/HyperFuelSource.res +35 -13
- package/src/sources/HyperFuelSource.res.mjs +26 -16
- package/src/sources/HyperSync.res +61 -60
- package/src/sources/HyperSync.res.mjs +53 -67
- package/src/sources/HyperSync.resi +6 -4
- package/src/sources/HyperSyncClient.res +29 -2
- package/src/sources/HyperSyncClient.res.mjs +9 -0
- package/src/sources/HyperSyncHeightStream.res +76 -118
- package/src/sources/HyperSyncHeightStream.res.mjs +68 -75
- package/src/sources/HyperSyncSource.res +122 -143
- package/src/sources/HyperSyncSource.res.mjs +106 -121
- package/src/sources/Rpc.res +86 -14
- package/src/sources/Rpc.res.mjs +101 -9
- package/src/sources/RpcSource.res +731 -364
- package/src/sources/RpcSource.res.mjs +845 -410
- package/src/sources/RpcWebSocketHeightStream.res +181 -0
- package/src/sources/RpcWebSocketHeightStream.res.mjs +196 -0
- package/src/sources/SimulateSource.res +59 -0
- package/src/sources/SimulateSource.res.mjs +50 -0
- package/src/sources/Source.res +7 -5
- package/src/sources/SourceManager.res +358 -221
- package/src/sources/SourceManager.res.mjs +346 -171
- package/src/sources/SourceManager.resi +17 -6
- package/src/sources/Svm.res +81 -0
- package/src/sources/Svm.res.mjs +90 -0
- package/src/tui/Tui.res +247 -0
- package/src/tui/Tui.res.mjs +337 -0
- package/src/tui/bindings/Ink.res +371 -0
- package/src/tui/bindings/Ink.res.mjs +72 -0
- package/src/tui/bindings/Style.res +123 -0
- package/src/tui/bindings/Style.res.mjs +2 -0
- package/src/tui/components/BufferedProgressBar.res +40 -0
- package/src/tui/components/BufferedProgressBar.res.mjs +57 -0
- package/src/tui/components/CustomHooks.res +122 -0
- package/src/tui/components/CustomHooks.res.mjs +179 -0
- package/src/tui/components/Messages.res +41 -0
- package/src/tui/components/Messages.res.mjs +75 -0
- package/src/tui/components/SyncETA.res +174 -0
- package/src/tui/components/SyncETA.res.mjs +263 -0
- package/src/tui/components/TuiData.res +47 -0
- package/src/tui/components/TuiData.res.mjs +34 -0
- package/svm.schema.json +112 -0
- package/bin.js +0 -48
- package/src/EventRegister.res +0 -241
- package/src/EventRegister.res.mjs +0 -240
- package/src/EventRegister.resi +0 -30
- package/src/bindings/Ethers.gen.ts +0 -14
- package/src/bindings/Ethers.res +0 -204
- package/src/bindings/Ethers.res.mjs +0 -130
- /package/src/{Indexer.res.mjs → Ctx.res.mjs} +0 -0
package/package.json
CHANGED
|
@@ -1,62 +1,78 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "envio",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A latency and sync speed optimized, developer friendly blockchain data indexer.",
|
|
6
|
-
"bin": "./bin.
|
|
6
|
+
"bin": "./bin.mjs",
|
|
7
7
|
"main": "./index.js",
|
|
8
8
|
"types": "./index.d.ts",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "git+https://github.com/enviodev/hyperindex.git"
|
|
12
12
|
},
|
|
13
|
+
"author": "envio contributors <about@envio.dev>",
|
|
14
|
+
"license": "GPL-3.0",
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/enviodev/hyperindex/issues"
|
|
17
|
+
},
|
|
18
|
+
"homepage": "https://envio.dev",
|
|
13
19
|
"keywords": [
|
|
14
20
|
"blockchain",
|
|
15
21
|
"indexer",
|
|
16
22
|
"ethereum",
|
|
17
23
|
"evm",
|
|
18
24
|
"fuel",
|
|
25
|
+
"solana",
|
|
19
26
|
"data",
|
|
20
27
|
"dapp"
|
|
21
28
|
],
|
|
22
|
-
"author": "envio contributors <about@envio.dev>",
|
|
23
|
-
"license": "GPL-3.0",
|
|
24
|
-
"bugs": {
|
|
25
|
-
"url": "https://github.com/enviodev/hyperindex/issues"
|
|
26
|
-
},
|
|
27
|
-
"homepage": "https://envio.dev",
|
|
28
29
|
"engines": {
|
|
29
30
|
"node": ">=22.0.0"
|
|
30
31
|
},
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
32
|
+
"files": [
|
|
33
|
+
"bin.mjs",
|
|
34
|
+
"evm.schema.json",
|
|
35
|
+
"fuel.schema.json",
|
|
36
|
+
"svm.schema.json",
|
|
37
|
+
"rescript.json",
|
|
38
|
+
"index.d.ts",
|
|
39
|
+
"index.js",
|
|
40
|
+
"src"
|
|
41
|
+
],
|
|
37
42
|
"dependencies": {
|
|
38
|
-
"@clickhouse/client": "1.
|
|
43
|
+
"@clickhouse/client": "1.17.0",
|
|
39
44
|
"@elastic/ecs-pino-format": "1.4.0",
|
|
40
45
|
"@envio-dev/hyperfuel-client": "1.2.2",
|
|
41
|
-
"@envio-dev/hypersync-client": "
|
|
42
|
-
"
|
|
46
|
+
"@envio-dev/hypersync-client": "1.3.0",
|
|
47
|
+
"@fuel-ts/crypto": "0.96.1",
|
|
48
|
+
"@fuel-ts/errors": "0.96.1",
|
|
49
|
+
"@fuel-ts/hasher": "0.96.1",
|
|
50
|
+
"@fuel-ts/math": "0.96.1",
|
|
51
|
+
"@fuel-ts/utils": "0.96.1",
|
|
52
|
+
"bignumber.js": "9.3.1",
|
|
43
53
|
"eventsource": "4.1.0",
|
|
44
|
-
"
|
|
45
|
-
"pino
|
|
46
|
-
"
|
|
54
|
+
"express": "4.19.2",
|
|
55
|
+
"pino": "10.3.1",
|
|
56
|
+
"pino-pretty": "13.1.3",
|
|
57
|
+
"prom-client": "15.1.3",
|
|
58
|
+
"yargs": "17.7.2",
|
|
47
59
|
"rescript": "11.1.3",
|
|
48
60
|
"rescript-schema": "9.3.4",
|
|
49
|
-
"viem": "2.
|
|
61
|
+
"viem": "2.46.2",
|
|
50
62
|
"rescript-envsafe": "5.0.0",
|
|
51
|
-
"dotenv": "16.4.5"
|
|
63
|
+
"dotenv": "16.4.5",
|
|
64
|
+
"date-fns": "3.3.1",
|
|
65
|
+
"@rescript/react": "0.14.1",
|
|
66
|
+
"ink": "6.8.0",
|
|
67
|
+
"ink-big-text": "2.0.0",
|
|
68
|
+
"ink-spinner": "5.0.0",
|
|
69
|
+
"postgres": "3.4.8",
|
|
70
|
+
"tsx": "4.21.0"
|
|
52
71
|
},
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
|
|
59
|
-
"index.js",
|
|
60
|
-
"src"
|
|
61
|
-
]
|
|
72
|
+
"optionalDependencies": {
|
|
73
|
+
"envio-linux-x64": "3.0.0-alpha.21",
|
|
74
|
+
"envio-linux-arm64": "3.0.0-alpha.21",
|
|
75
|
+
"envio-darwin-x64": "3.0.0-alpha.21",
|
|
76
|
+
"envio-darwin-arm64": "3.0.0-alpha.21"
|
|
77
|
+
}
|
|
62
78
|
}
|
package/rescript.json
CHANGED
|
@@ -19,6 +19,9 @@
|
|
|
19
19
|
"generatedFileExtension": ".gen.ts",
|
|
20
20
|
"moduleResolution": "node16"
|
|
21
21
|
},
|
|
22
|
-
"
|
|
22
|
+
"jsx": {
|
|
23
|
+
"version": 4
|
|
24
|
+
},
|
|
25
|
+
"bs-dependencies": ["rescript-schema", "@rescript/react", "rescript-envsafe"],
|
|
23
26
|
"bsc-flags": ["-open RescriptSchema"]
|
|
24
27
|
}
|
package/src/Batch.res
CHANGED
|
@@ -6,7 +6,8 @@ open Utils.UnsafeIntOperators
|
|
|
6
6
|
type chainAfterBatch = {
|
|
7
7
|
batchSize: int,
|
|
8
8
|
progressBlockNumber: int,
|
|
9
|
-
|
|
9
|
+
sourceBlockNumber: int,
|
|
10
|
+
totalEventsProcessed: float,
|
|
10
11
|
fetchState: FetchState.t,
|
|
11
12
|
isProgressAtHeadWhenBatchCreated: bool,
|
|
12
13
|
}
|
|
@@ -16,7 +17,8 @@ type chainBeforeBatch = {
|
|
|
16
17
|
reorgDetection: ReorgDetection.t,
|
|
17
18
|
progressBlockNumber: int,
|
|
18
19
|
sourceBlockNumber: int,
|
|
19
|
-
totalEventsProcessed:
|
|
20
|
+
totalEventsProcessed: float,
|
|
21
|
+
chainConfig: Config.chain,
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
type t = {
|
|
@@ -24,7 +26,7 @@ type t = {
|
|
|
24
26
|
items: array<Internal.item>,
|
|
25
27
|
progressedChainsById: dict<chainAfterBatch>,
|
|
26
28
|
// Unnest-like checkpoint fields:
|
|
27
|
-
checkpointIds: array<
|
|
29
|
+
checkpointIds: array<bigint>,
|
|
28
30
|
checkpointChainIds: array<int>,
|
|
29
31
|
checkpointBlockNumbers: array<int>,
|
|
30
32
|
checkpointBlockHashes: array<Js.Null.t<string>>,
|
|
@@ -108,10 +110,11 @@ let getProgressedChainsById = {
|
|
|
108
110
|
{
|
|
109
111
|
batchSize,
|
|
110
112
|
progressBlockNumber: progressBlockNumberAfterBatch,
|
|
111
|
-
|
|
113
|
+
sourceBlockNumber: chainBeforeBatch.sourceBlockNumber,
|
|
114
|
+
totalEventsProcessed: chainBeforeBatch.totalEventsProcessed +. batchSize->Int.toFloat,
|
|
112
115
|
fetchState: fetchStateAfterBatch,
|
|
113
116
|
isProgressAtHeadWhenBatchCreated: progressBlockNumberAfterBatch >=
|
|
114
|
-
chainBeforeBatch.sourceBlockNumber,
|
|
117
|
+
chainBeforeBatch.sourceBlockNumber - chainBeforeBatch.chainConfig.blockLag,
|
|
115
118
|
}: chainAfterBatch
|
|
116
119
|
),
|
|
117
120
|
)
|
|
@@ -196,7 +199,7 @@ let addReorgCheckpoints = (
|
|
|
196
199
|
for blockNumber in fromBlockExclusive + 1 to toBlockExclusive - 1 {
|
|
197
200
|
switch reorgDetection->ReorgDetection.getHashByBlockNumber(~blockNumber) {
|
|
198
201
|
| Js.Null.Value(hash) =>
|
|
199
|
-
let checkpointId = prevCheckpointId.contents
|
|
202
|
+
let checkpointId = prevCheckpointId.contents->BigInt.add(1n)
|
|
200
203
|
prevCheckpointId := checkpointId
|
|
201
204
|
|
|
202
205
|
mutCheckpointIds->Js.Array2.push(checkpointId)->ignore
|
|
@@ -277,7 +280,7 @@ let prepareOrderedBatch = (
|
|
|
277
280
|
~mutCheckpointEventsProcessed=checkpointEventsProcessed,
|
|
278
281
|
)
|
|
279
282
|
|
|
280
|
-
let checkpointId = prevCheckpointId.contents
|
|
283
|
+
let checkpointId = prevCheckpointId.contents->BigInt.add(1n)
|
|
281
284
|
|
|
282
285
|
items
|
|
283
286
|
->Js.Array2.push(item0)
|
|
@@ -421,7 +424,7 @@ let prepareUnorderedBatch = (
|
|
|
421
424
|
~mutCheckpointEventsProcessed=checkpointEventsProcessed,
|
|
422
425
|
)
|
|
423
426
|
|
|
424
|
-
let checkpointId = prevCheckpointId.contents
|
|
427
|
+
let checkpointId = prevCheckpointId.contents->BigInt.add(1n)
|
|
425
428
|
|
|
426
429
|
checkpointIds->Js.Array2.push(checkpointId)->ignore
|
|
427
430
|
checkpointChainIds->Js.Array2.push(fetchState.chainId)->ignore
|
package/src/Batch.res.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
3
|
import * as Utils from "./Utils.res.mjs";
|
|
4
|
+
import * as $$BigInt from "./bindings/BigInt.res.mjs";
|
|
4
5
|
import * as ChainMap from "./ChainMap.res.mjs";
|
|
5
6
|
import * as Belt_Array from "rescript/lib/es6/belt_Array.js";
|
|
6
7
|
import * as FetchState from "./FetchState.res.mjs";
|
|
@@ -62,9 +63,10 @@ function getChainAfterBatchIfProgressed(chainBeforeBatch, progressBlockNumberAft
|
|
|
62
63
|
return {
|
|
63
64
|
batchSize: batchSize,
|
|
64
65
|
progressBlockNumber: progressBlockNumberAfterBatch,
|
|
66
|
+
sourceBlockNumber: chainBeforeBatch.sourceBlockNumber,
|
|
65
67
|
totalEventsProcessed: chainBeforeBatch.totalEventsProcessed + batchSize,
|
|
66
68
|
fetchState: fetchStateAfterBatch,
|
|
67
|
-
isProgressAtHeadWhenBatchCreated: progressBlockNumberAfterBatch >= chainBeforeBatch.sourceBlockNumber
|
|
69
|
+
isProgressAtHeadWhenBatchCreated: progressBlockNumberAfterBatch >= chainBeforeBatch.sourceBlockNumber - chainBeforeBatch.chainConfig.blockLag
|
|
68
70
|
};
|
|
69
71
|
}
|
|
70
72
|
|
|
@@ -80,7 +82,7 @@ function getProgressedChainsById(chainsBeforeBatch, batchSizePerChain, progressB
|
|
|
80
82
|
var progressedChain;
|
|
81
83
|
if (batchSize !== undefined) {
|
|
82
84
|
var leftItems = fetchState.buffer.slice(batchSize);
|
|
83
|
-
progressedChain = getChainAfterBatchIfProgressed(chainBeforeBatch, progressBlockNumberAfterBatch, FetchState.updateInternal(fetchState, undefined, undefined,
|
|
85
|
+
progressedChain = getChainAfterBatchIfProgressed(chainBeforeBatch, progressBlockNumberAfterBatch, FetchState.updateInternal(fetchState, undefined, undefined, leftItems, undefined, undefined), batchSize);
|
|
84
86
|
} else {
|
|
85
87
|
progressedChain = getChainAfterBatchIfProgressed(chainBeforeBatch, progressBlockNumberAfterBatch, chainBeforeBatch.fetchState, 0);
|
|
86
88
|
}
|
|
@@ -101,7 +103,7 @@ function addReorgCheckpoints(prevCheckpointId, reorgDetection, fromBlockExclusiv
|
|
|
101
103
|
for(var blockNumber = fromBlockExclusive + 1 ,blockNumber_finish = toBlockExclusive - 1; blockNumber <= blockNumber_finish; ++blockNumber){
|
|
102
104
|
var hash = ReorgDetection.getHashByBlockNumber(reorgDetection, blockNumber);
|
|
103
105
|
if (hash !== null) {
|
|
104
|
-
var checkpointId = prevCheckpointId$1
|
|
106
|
+
var checkpointId = $$BigInt.add(prevCheckpointId$1, 1n);
|
|
105
107
|
prevCheckpointId$1 = checkpointId;
|
|
106
108
|
mutCheckpointIds.push(checkpointId);
|
|
107
109
|
mutCheckpointChainIds.push(chainId);
|
|
@@ -150,7 +152,7 @@ function prepareOrderedBatch(checkpointIdBeforeBatch, chainsBeforeBatch, batchSi
|
|
|
150
152
|
for(var blockNumber$1 = prevBlockNumber + 1 ,blockNumber_finish = blockNumber - 1; blockNumber$1 <= blockNumber_finish; ++blockNumber$1){
|
|
151
153
|
var hash = ReorgDetection.getHashByBlockNumber(reorgDetection, blockNumber$1);
|
|
152
154
|
if (hash !== null) {
|
|
153
|
-
var checkpointId = prevCheckpointId$2
|
|
155
|
+
var checkpointId = $$BigInt.add(prevCheckpointId$2, 1n);
|
|
154
156
|
prevCheckpointId$2 = checkpointId;
|
|
155
157
|
checkpointIds.push(checkpointId);
|
|
156
158
|
checkpointChainIds.push(chainId);
|
|
@@ -165,7 +167,7 @@ function prepareOrderedBatch(checkpointIdBeforeBatch, chainsBeforeBatch, batchSi
|
|
|
165
167
|
tmp = prevCheckpointId$1;
|
|
166
168
|
}
|
|
167
169
|
prevCheckpointId = tmp;
|
|
168
|
-
var checkpointId$1 = prevCheckpointId
|
|
170
|
+
var checkpointId$1 = $$BigInt.add(prevCheckpointId, 1n);
|
|
169
171
|
items.push(item0);
|
|
170
172
|
for(var idx = 1 ,idx_finish = newItemsCount - 1; idx <= idx_finish; ++idx){
|
|
171
173
|
items.push(fetchState.buffer[itemsCountBefore + idx]);
|
|
@@ -191,7 +193,7 @@ function prepareOrderedBatch(checkpointIdBeforeBatch, chainsBeforeBatch, batchSi
|
|
|
191
193
|
for(var blockNumber$2 = prevBlockNumber + 1 ,blockNumber_finish$1 = toBlockExclusive - 1; blockNumber$2 <= blockNumber_finish$1; ++blockNumber$2){
|
|
192
194
|
var hash$1 = ReorgDetection.getHashByBlockNumber(reorgDetection$1, blockNumber$2);
|
|
193
195
|
if (hash$1 !== null) {
|
|
194
|
-
var checkpointId$2 = prevCheckpointId$4
|
|
196
|
+
var checkpointId$2 = $$BigInt.add(prevCheckpointId$4, 1n);
|
|
195
197
|
prevCheckpointId$4 = checkpointId$2;
|
|
196
198
|
checkpointIds.push(checkpointId$2);
|
|
197
199
|
checkpointChainIds.push(chainId$1);
|
|
@@ -261,7 +263,7 @@ function prepareUnorderedBatch(checkpointIdBeforeBatch, chainsBeforeBatch, batch
|
|
|
261
263
|
for(var blockNumber$1 = fromBlockExclusive + 1 ,blockNumber_finish = blockNumber - 1; blockNumber$1 <= blockNumber_finish; ++blockNumber$1){
|
|
262
264
|
var hash = ReorgDetection.getHashByBlockNumber(reorgDetection, blockNumber$1);
|
|
263
265
|
if (hash !== null) {
|
|
264
|
-
var checkpointId = prevCheckpointId$2
|
|
266
|
+
var checkpointId = $$BigInt.add(prevCheckpointId$2, 1n);
|
|
265
267
|
prevCheckpointId$2 = checkpointId;
|
|
266
268
|
checkpointIds.push(checkpointId);
|
|
267
269
|
checkpointChainIds.push(chainId);
|
|
@@ -276,7 +278,7 @@ function prepareUnorderedBatch(checkpointIdBeforeBatch, chainsBeforeBatch, batch
|
|
|
276
278
|
tmp = prevCheckpointId$1;
|
|
277
279
|
}
|
|
278
280
|
prevCheckpointId = tmp;
|
|
279
|
-
var checkpointId$1 = prevCheckpointId
|
|
281
|
+
var checkpointId$1 = $$BigInt.add(prevCheckpointId, 1n);
|
|
280
282
|
checkpointIds.push(checkpointId$1);
|
|
281
283
|
checkpointChainIds.push(fetchState.chainId);
|
|
282
284
|
checkpointBlockNumbers.push(blockNumber);
|
|
@@ -305,7 +307,7 @@ function prepareUnorderedBatch(checkpointIdBeforeBatch, chainsBeforeBatch, batch
|
|
|
305
307
|
for(var blockNumber$2 = fromBlockExclusive$1 + 1 ,blockNumber_finish$1 = toBlockExclusive - 1; blockNumber$2 <= blockNumber_finish$1; ++blockNumber$2){
|
|
306
308
|
var hash$1 = ReorgDetection.getHashByBlockNumber(reorgDetection$1, blockNumber$2);
|
|
307
309
|
if (hash$1 !== null) {
|
|
308
|
-
var checkpointId$2 = prevCheckpointId$4
|
|
310
|
+
var checkpointId$2 = $$BigInt.add(prevCheckpointId$4, 1n);
|
|
309
311
|
prevCheckpointId$4 = checkpointId$2;
|
|
310
312
|
checkpointIds.push(checkpointId$2);
|
|
311
313
|
checkpointChainIds.push(chainId$1);
|