envio 3.3.0-alpha.1 → 3.3.0-alpha.2
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/package.json +6 -6
- package/src/Batch.res +0 -6
- package/src/Batch.res.mjs +0 -11
- package/src/BatchProcessing.res +2 -12
- package/src/BatchProcessing.res.mjs +2 -7
- package/src/ChainFetching.res +17 -6
- package/src/ChainFetching.res.mjs +11 -11
- package/src/ChainMetadata.res +1 -11
- package/src/ChainMetadata.res.mjs +1 -10
- package/src/ChainState.res +150 -1
- package/src/ChainState.res.mjs +138 -9
- package/src/ChainState.resi +51 -1
- package/src/Config.res +3 -6
- package/src/Config.res.mjs +2 -3
- package/src/Core.res +7 -0
- package/src/CrossChainState.res +9 -26
- package/src/CrossChainState.res.mjs +7 -16
- package/src/Ecosystem.res +6 -1
- package/src/Envio.res +3 -2
- package/src/EventConfigBuilder.res +19 -5
- package/src/EventConfigBuilder.res.mjs +6 -4
- package/src/EventProcessing.res +26 -0
- package/src/EventProcessing.res.mjs +20 -0
- package/src/Internal.res +43 -4
- package/src/Internal.res.mjs +18 -0
- package/src/Main.res +3 -50
- package/src/Main.res.mjs +2 -23
- package/src/Rollback.res +1 -1
- package/src/Rollback.res.mjs +1 -1
- package/src/SimulateItems.res +3 -0
- package/src/SimulateItems.res.mjs +2 -1
- package/src/sources/Evm.res +52 -38
- package/src/sources/Evm.res.mjs +48 -36
- package/src/sources/Fuel.res +3 -1
- package/src/sources/Fuel.res.mjs +1 -0
- package/src/sources/HyperFuelSource.res +5 -0
- package/src/sources/HyperFuelSource.res.mjs +2 -0
- package/src/sources/HyperSync.res +4 -1
- package/src/sources/HyperSync.res.mjs +5 -3
- package/src/sources/HyperSync.resi +1 -0
- package/src/sources/HyperSyncClient.res +9 -78
- package/src/sources/HyperSyncClient.res.mjs +1 -22
- package/src/sources/HyperSyncSource.res +3 -4
- package/src/sources/HyperSyncSource.res.mjs +2 -1
- package/src/sources/RpcSource.res +7 -2
- package/src/sources/RpcSource.res.mjs +3 -1
- package/src/sources/SimulateSource.res +3 -1
- package/src/sources/SimulateSource.res.mjs +1 -0
- package/src/sources/Source.res +4 -0
- package/src/sources/Svm.res +25 -2
- package/src/sources/Svm.res.mjs +27 -2
- package/src/sources/SvmHyperSyncClient.res +3 -29
- package/src/sources/SvmHyperSyncSource.res +60 -84
- package/src/sources/SvmHyperSyncSource.res.mjs +59 -78
- package/src/sources/TransactionStore.res +111 -0
- package/src/sources/TransactionStore.res.mjs +77 -0
- package/src/tui/Tui.res +13 -16
- package/src/tui/Tui.res.mjs +12 -14
package/src/tui/Tui.res
CHANGED
|
@@ -157,18 +157,15 @@ module App = {
|
|
|
157
157
|
->IndexerState.chainStates
|
|
158
158
|
->Dict.valuesToArray
|
|
159
159
|
->Array.map(cs => {
|
|
160
|
-
let
|
|
161
|
-
let
|
|
160
|
+
let data = cs->ChainState.toChainData
|
|
161
|
+
let numEventsProcessed = data.numEventsProcessed
|
|
162
162
|
let committedProgressBlockNumber = cs->ChainState.committedProgressBlockNumber
|
|
163
|
-
let timestampCaughtUpToHeadOrEndblock =
|
|
163
|
+
let timestampCaughtUpToHeadOrEndblock = data.timestampCaughtUpToHeadOrEndblock
|
|
164
164
|
let sourceManager = cs->ChainState.sourceManager
|
|
165
|
-
let latestFetchedBlockNumber =
|
|
165
|
+
let latestFetchedBlockNumber = data.latestFetchedBlockNumber
|
|
166
166
|
let hasProcessedToEndblock = cs->ChainState.hasProcessedToEndblock
|
|
167
|
-
let knownHeight = hasProcessedToEndblock
|
|
168
|
-
? fetchState.endBlock->Option.getOr(fetchState.knownHeight)
|
|
169
|
-
: fetchState.knownHeight
|
|
170
167
|
|
|
171
|
-
let firstEventBlock =
|
|
168
|
+
let firstEventBlock = data.firstEventBlockNumber
|
|
172
169
|
let progress: TuiData.progress = if hasProcessedToEndblock {
|
|
173
170
|
// If the endblock has been reached then set the progress to synced.
|
|
174
171
|
// if there's chains that have no events in the block range start->end,
|
|
@@ -204,19 +201,19 @@ module App = {
|
|
|
204
201
|
(
|
|
205
202
|
{
|
|
206
203
|
progress,
|
|
207
|
-
knownHeight,
|
|
204
|
+
knownHeight: data.knownHeight,
|
|
208
205
|
latestFetchedBlockNumber,
|
|
209
206
|
eventsProcessed: numEventsProcessed,
|
|
210
207
|
chainId: (cs->ChainState.chainConfig).id->Int.toString,
|
|
211
|
-
progressBlock: committedProgressBlockNumber <
|
|
212
|
-
? Some(
|
|
208
|
+
progressBlock: committedProgressBlockNumber < data.startBlock
|
|
209
|
+
? Some(data.startBlock)
|
|
213
210
|
: Some(committedProgressBlockNumber),
|
|
214
211
|
bufferBlock: Some(latestFetchedBlockNumber),
|
|
215
|
-
sourceBlock: Some(
|
|
216
|
-
firstEventBlockNumber:
|
|
217
|
-
startBlock:
|
|
218
|
-
endBlock:
|
|
219
|
-
poweredByHyperSync:
|
|
212
|
+
sourceBlock: Some(cs->ChainState.knownHeight),
|
|
213
|
+
firstEventBlockNumber: firstEventBlock,
|
|
214
|
+
startBlock: data.startBlock,
|
|
215
|
+
endBlock: data.endBlock,
|
|
216
|
+
poweredByHyperSync: data.poweredByHyperSync,
|
|
220
217
|
blockUnit: switch (state->IndexerState.config).ecosystem.name {
|
|
221
218
|
| Svm => "Slot"
|
|
222
219
|
| Evm | Fuel => "Block"
|
package/src/tui/Tui.res.mjs
CHANGED
|
@@ -8,7 +8,6 @@ import * as SyncETA from "./components/SyncETA.res.mjs";
|
|
|
8
8
|
import * as TuiData from "./components/TuiData.res.mjs";
|
|
9
9
|
import * as Messages from "./components/Messages.res.mjs";
|
|
10
10
|
import * as ChainState from "../ChainState.res.mjs";
|
|
11
|
-
import * as FetchState from "../FetchState.res.mjs";
|
|
12
11
|
import * as IndexerState from "../IndexerState.res.mjs";
|
|
13
12
|
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
14
13
|
import InkBigText from "ink-big-text";
|
|
@@ -208,15 +207,14 @@ function Tui$App(props) {
|
|
|
208
207
|
};
|
|
209
208
|
}, [getState]);
|
|
210
209
|
let chains = Object.values(IndexerState.chainStates(state)).map(cs => {
|
|
211
|
-
let
|
|
212
|
-
let
|
|
210
|
+
let data = ChainState.toChainData(cs);
|
|
211
|
+
let numEventsProcessed = data.numEventsProcessed;
|
|
213
212
|
let committedProgressBlockNumber = ChainState.committedProgressBlockNumber(cs);
|
|
214
|
-
let timestampCaughtUpToHeadOrEndblock =
|
|
213
|
+
let timestampCaughtUpToHeadOrEndblock = data.timestampCaughtUpToHeadOrEndblock;
|
|
215
214
|
let sourceManager = ChainState.sourceManager(cs);
|
|
216
|
-
let latestFetchedBlockNumber =
|
|
215
|
+
let latestFetchedBlockNumber = data.latestFetchedBlockNumber;
|
|
217
216
|
let hasProcessedToEndblock = ChainState.hasProcessedToEndblock(cs);
|
|
218
|
-
let
|
|
219
|
-
let firstEventBlock = fetchState.firstEventBlock;
|
|
217
|
+
let firstEventBlock = data.firstEventBlockNumber;
|
|
220
218
|
let progress = hasProcessedToEndblock ? ({
|
|
221
219
|
TAG: "Synced",
|
|
222
220
|
_0: {
|
|
@@ -259,16 +257,16 @@ function Tui$App(props) {
|
|
|
259
257
|
return {
|
|
260
258
|
chainId: ChainState.chainConfig(cs).id.toString(),
|
|
261
259
|
eventsProcessed: numEventsProcessed,
|
|
262
|
-
progressBlock: committedProgressBlockNumber <
|
|
260
|
+
progressBlock: committedProgressBlockNumber < data.startBlock ? data.startBlock : committedProgressBlockNumber,
|
|
263
261
|
bufferBlock: latestFetchedBlockNumber,
|
|
264
|
-
sourceBlock:
|
|
265
|
-
startBlock:
|
|
266
|
-
endBlock:
|
|
267
|
-
firstEventBlockNumber:
|
|
268
|
-
poweredByHyperSync:
|
|
262
|
+
sourceBlock: ChainState.knownHeight(cs),
|
|
263
|
+
startBlock: data.startBlock,
|
|
264
|
+
endBlock: data.endBlock,
|
|
265
|
+
firstEventBlockNumber: firstEventBlock,
|
|
266
|
+
poweredByHyperSync: data.poweredByHyperSync,
|
|
269
267
|
progress: progress,
|
|
270
268
|
latestFetchedBlockNumber: latestFetchedBlockNumber,
|
|
271
|
-
knownHeight:
|
|
269
|
+
knownHeight: data.currentBlockHeight,
|
|
272
270
|
blockUnit: tmp,
|
|
273
271
|
rateLimitTimeMs: SourceManager.getRateLimitTimeMs(sourceManager),
|
|
274
272
|
isRateLimited: SourceManager.isRateLimited(sourceManager),
|