envio 3.3.0-alpha.4 → 3.3.0-alpha.6
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 +10 -0
- package/package.json +7 -7
- package/src/Batch.res.mjs +1 -1
- package/src/BatchProcessing.res +5 -0
- package/src/BatchProcessing.res.mjs +6 -0
- package/src/ChainState.res +41 -7
- package/src/ChainState.res.mjs +22 -18
- package/src/ChainState.resi +3 -1
- package/src/Config.res +3 -0
- package/src/Config.res.mjs +3 -1
- package/src/Core.res +0 -3
- package/src/ExitOnCaughtUp.res +10 -2
- package/src/ExitOnCaughtUp.res.mjs +10 -1
- package/src/FetchState.res +63 -133
- package/src/FetchState.res.mjs +107 -166
- package/src/IndexerState.res +4 -0
- package/src/IndexerState.res.mjs +8 -1
- package/src/IndexerState.resi +1 -0
- package/src/IndexingAddresses.res +105 -0
- package/src/IndexingAddresses.res.mjs +100 -0
- package/src/IndexingAddresses.resi +32 -0
- package/src/Main.res +4 -15
- package/src/Main.res.mjs +6 -14
- package/src/Metrics.res +33 -0
- package/src/Metrics.res.mjs +39 -0
- package/src/Prometheus.res +2 -20
- package/src/Prometheus.res.mjs +83 -95
- package/src/SimulateDeadInputTracker.res +85 -0
- package/src/SimulateDeadInputTracker.res.mjs +73 -0
- package/src/SimulateDeadInputTracker.resi +12 -0
- package/src/SimulateItems.res +23 -42
- package/src/SimulateItems.res.mjs +12 -30
- package/src/TestIndexer.res +3 -27
- package/src/TestIndexer.res.mjs +2 -9
- package/src/bindings/Viem.res +0 -41
- package/src/bindings/Viem.res.mjs +1 -43
- package/src/sources/Evm.res +7 -36
- package/src/sources/Evm.res.mjs +4 -36
- package/src/sources/EvmChain.res +4 -2
- package/src/sources/EvmChain.res.mjs +3 -2
- package/src/sources/EvmRpcClient.res +36 -5
- package/src/sources/EvmRpcClient.res.mjs +7 -4
- package/src/sources/HyperSyncClient.res +0 -35
- package/src/sources/HyperSyncClient.res.mjs +1 -8
- package/src/sources/Rpc.res +15 -47
- package/src/sources/Rpc.res.mjs +25 -56
- package/src/sources/RpcSource.res +289 -204
- package/src/sources/RpcSource.res.mjs +293 -303
- package/src/sources/SimulateSource.res +1 -0
- package/src/sources/SimulateSource.res.mjs +2 -1
- package/src/sources/Source.res +4 -0
- package/src/sources/Svm.res +7 -15
- package/src/sources/Svm.res.mjs +4 -15
- package/src/sources/TransactionStore.res +14 -2
- package/src/sources/TransactionStore.res.mjs +10 -2
package/src/sources/Source.res
CHANGED
|
@@ -71,4 +71,8 @@ type t = {
|
|
|
71
71
|
// Invoked by SourceManager once a rollback target is known so the source can
|
|
72
72
|
// drop any state that may now point at an orphaned chain (e.g. RPC block cache).
|
|
73
73
|
onReorg?: (~rollbackTargetBlock: int) => unit,
|
|
74
|
+
// Present only on the simulate source: the items a test fed in. The chain
|
|
75
|
+
// tracks which of these never reach a handler so the run can report dead
|
|
76
|
+
// simulate inputs on completion.
|
|
77
|
+
simulateItems?: array<Internal.item>,
|
|
74
78
|
}
|
package/src/sources/Svm.res
CHANGED
|
@@ -4,21 +4,13 @@ let cleanUpRawEventFieldsInPlace: JSON.t => unit = %raw(`fields => {
|
|
|
4
4
|
delete fields.time
|
|
5
5
|
}`)
|
|
6
6
|
|
|
7
|
-
// Ordered transaction field names
|
|
8
|
-
//
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"err",
|
|
15
|
-
"fee",
|
|
16
|
-
"computeUnitsConsumed",
|
|
17
|
-
"accountKeys",
|
|
18
|
-
"recentBlockhash",
|
|
19
|
-
"version",
|
|
20
|
-
"tokenBalances",
|
|
21
|
-
]
|
|
7
|
+
// Ordered transaction field names, the field codes shared with the Rust store
|
|
8
|
+
// (`SvmTxField`). Derived from the typed field list so the two can't drift;
|
|
9
|
+
// `Internal.allSvmTransactionFields` is pinned to the Rust ordinal order by a test.
|
|
10
|
+
let transactionFields =
|
|
11
|
+
Internal.allSvmTransactionFields->(
|
|
12
|
+
Utils.magic: array<Internal.svmTransactionField> => array<string>
|
|
13
|
+
)
|
|
22
14
|
|
|
23
15
|
// One instruction's selected transaction fields → store selection bitmask.
|
|
24
16
|
// Computed per event at config build and cached on the event config.
|
package/src/sources/Svm.res.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import * as Rpc from "./Rpc.res.mjs";
|
|
|
4
4
|
import * as Rest from "../vendored/Rest.res.mjs";
|
|
5
5
|
import * as Utils from "../Utils.res.mjs";
|
|
6
6
|
import * as Logging from "../Logging.res.mjs";
|
|
7
|
+
import * as Internal from "../Internal.res.mjs";
|
|
7
8
|
import * as Prometheus from "../Prometheus.res.mjs";
|
|
8
9
|
import * as Performance from "../bindings/Performance.res.mjs";
|
|
9
10
|
import * as Stdlib_JsError from "@rescript/runtime/lib/es6/Stdlib_JsError.js";
|
|
@@ -16,21 +17,7 @@ let cleanUpRawEventFieldsInPlace = (fields => {
|
|
|
16
17
|
delete fields.time
|
|
17
18
|
});
|
|
18
19
|
|
|
19
|
-
let
|
|
20
|
-
"transactionIndex",
|
|
21
|
-
"signatures",
|
|
22
|
-
"feePayer",
|
|
23
|
-
"success",
|
|
24
|
-
"err",
|
|
25
|
-
"fee",
|
|
26
|
-
"computeUnitsConsumed",
|
|
27
|
-
"accountKeys",
|
|
28
|
-
"recentBlockhash",
|
|
29
|
-
"version",
|
|
30
|
-
"tokenBalances"
|
|
31
|
-
];
|
|
32
|
-
|
|
33
|
-
let eventTransactionFieldMask = TransactionStore.makeMaskFn(transactionFields);
|
|
20
|
+
let eventTransactionFieldMask = TransactionStore.makeMaskFn(Internal.allSvmTransactionFields);
|
|
34
21
|
|
|
35
22
|
function make(logger) {
|
|
36
23
|
return {
|
|
@@ -93,6 +80,8 @@ function makeRPCSource(chain, rpc, sourceForOpt) {
|
|
|
93
80
|
};
|
|
94
81
|
}
|
|
95
82
|
|
|
83
|
+
let transactionFields = Internal.allSvmTransactionFields;
|
|
84
|
+
|
|
96
85
|
export {
|
|
97
86
|
cleanUpRawEventFieldsInPlace,
|
|
98
87
|
transactionFields,
|
|
@@ -6,8 +6,20 @@
|
|
|
6
6
|
// in columnar form and zipped into plain JS objects on the main thread.
|
|
7
7
|
type t
|
|
8
8
|
|
|
9
|
-
@send external
|
|
10
|
-
|
|
9
|
+
@send external newEvm: (Core.transactionStoreCtor, ~shouldChecksum: bool) => t = "newEvm"
|
|
10
|
+
@send external newSvm: Core.transactionStoreCtor => t = "newSvm"
|
|
11
|
+
@send external newFuel: Core.transactionStoreCtor => t = "newFuel"
|
|
12
|
+
|
|
13
|
+
// The store's ecosystem is fixed here, from the chain's config. EVM carries the
|
|
14
|
+
// chain's address-checksumming setting; SVM/Fuel need no extra data.
|
|
15
|
+
let make = (~ecosystem: Ecosystem.name, ~shouldChecksum: bool): t => {
|
|
16
|
+
let ctor = Core.getAddon().transactionStore
|
|
17
|
+
switch ecosystem {
|
|
18
|
+
| Evm => ctor->newEvm(~shouldChecksum)
|
|
19
|
+
| Svm => ctor->newSvm
|
|
20
|
+
| Fuel => ctor->newFuel
|
|
21
|
+
}
|
|
22
|
+
}
|
|
11
23
|
|
|
12
24
|
// Field-name → bit-index map from an ordered field-name array. The index is the
|
|
13
25
|
// field code shared with the Rust store (`EvmTxField`/`SvmTxField`).
|
|
@@ -3,8 +3,16 @@
|
|
|
3
3
|
import * as Core from "../Core.res.mjs";
|
|
4
4
|
import * as Utils from "../Utils.res.mjs";
|
|
5
5
|
|
|
6
|
-
function make() {
|
|
7
|
-
|
|
6
|
+
function make(ecosystem, shouldChecksum) {
|
|
7
|
+
let ctor = Core.getAddon().TransactionStore;
|
|
8
|
+
switch (ecosystem) {
|
|
9
|
+
case "evm" :
|
|
10
|
+
return ctor.newEvm(shouldChecksum);
|
|
11
|
+
case "fuel" :
|
|
12
|
+
return ctor.newFuel();
|
|
13
|
+
case "svm" :
|
|
14
|
+
return ctor.newSvm();
|
|
15
|
+
}
|
|
8
16
|
}
|
|
9
17
|
|
|
10
18
|
function fieldCodes(fields) {
|