envio 3.3.0-alpha.0 → 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 +22 -13
- package/src/ChainFetching.res.mjs +13 -13
- package/src/ChainMetadata.res +1 -11
- package/src/ChainMetadata.res.mjs +1 -10
- package/src/ChainState.res +176 -2
- package/src/ChainState.res.mjs +153 -9
- package/src/ChainState.resi +53 -1
- package/src/Config.res +3 -6
- package/src/Config.res.mjs +2 -3
- package/src/Core.res +7 -0
- package/src/CrossChainState.res +99 -91
- package/src/CrossChainState.res.mjs +72 -57
- package/src/CrossChainState.resi +1 -9
- package/src/Ecosystem.res +6 -1
- package/src/Env.res +0 -7
- package/src/Env.res.mjs +0 -6
- 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/FetchState.res +92 -22
- package/src/FetchState.res.mjs +87 -14
- package/src/IndexerLoop.res +2 -3
- package/src/IndexerLoop.res.mjs +1 -1
- package/src/IndexerState.res +0 -8
- package/src/IndexerState.res.mjs +4 -8
- package/src/IndexerState.resi +0 -4
- package/src/Internal.res +43 -4
- package/src/Internal.res.mjs +18 -0
- package/src/Main.res +3 -50
- package/src/Main.res.mjs +3 -24
- package/src/Prometheus.res +0 -11
- package/src/Prometheus.res.mjs +83 -98
- 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/SourceManager.res +9 -8
- package/src/sources/SourceManager.res.mjs +21 -26
- package/src/sources/SourceManager.resi +2 -3
- 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/FetchState.res.mjs
CHANGED
|
@@ -14,6 +14,14 @@ function deriveEffectiveStartBlock(registrationBlock, contractStartBlock) {
|
|
|
14
14
|
return Primitive_int.max(Primitive_int.max(registrationBlock, 0), Stdlib_Option.getOr(contractStartBlock, 0));
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
function calculateEstResponseSize(p, fromBlock, toBlock, maxQueryBlockNumber) {
|
|
18
|
+
if (p.prevQueryRange <= 0) {
|
|
19
|
+
return 10000;
|
|
20
|
+
}
|
|
21
|
+
let density = p.prevRangeSize / p.prevQueryRange;
|
|
22
|
+
return ((Stdlib_Option.getOr(toBlock, maxQueryBlockNumber) - fromBlock | 0) + 1 | 0) * density;
|
|
23
|
+
}
|
|
24
|
+
|
|
17
25
|
function getMinHistoryRange(p) {
|
|
18
26
|
let match = p.prevQueryRange;
|
|
19
27
|
let match$1 = p.prevPrevQueryRange;
|
|
@@ -69,6 +77,7 @@ function mergePartitionsAtBlock(p1, p2, potentialMergeBlock, contractName, maxAd
|
|
|
69
77
|
mutPendingQueries: p1.mutPendingQueries,
|
|
70
78
|
prevQueryRange: p1.prevQueryRange,
|
|
71
79
|
prevPrevQueryRange: p1.prevPrevQueryRange,
|
|
80
|
+
prevRangeSize: p1.prevRangeSize,
|
|
72
81
|
latestBlockRangeUpdateBlock: p1.latestBlockRangeUpdateBlock
|
|
73
82
|
});
|
|
74
83
|
completed.push({
|
|
@@ -81,6 +90,7 @@ function mergePartitionsAtBlock(p1, p2, potentialMergeBlock, contractName, maxAd
|
|
|
81
90
|
mutPendingQueries: p2.mutPendingQueries,
|
|
82
91
|
prevQueryRange: p2.prevQueryRange,
|
|
83
92
|
prevPrevQueryRange: p2.prevPrevQueryRange,
|
|
93
|
+
prevRangeSize: p2.prevRangeSize,
|
|
84
94
|
latestBlockRangeUpdateBlock: p2.latestBlockRangeUpdateBlock
|
|
85
95
|
});
|
|
86
96
|
let newId = nextPartitionIndexRef.contents.toString();
|
|
@@ -102,6 +112,7 @@ function mergePartitionsAtBlock(p1, p2, potentialMergeBlock, contractName, maxAd
|
|
|
102
112
|
mutPendingQueries: [],
|
|
103
113
|
prevQueryRange: minRange,
|
|
104
114
|
prevPrevQueryRange: minRange,
|
|
115
|
+
prevRangeSize: 0,
|
|
105
116
|
latestBlockRangeUpdateBlock: 0
|
|
106
117
|
};
|
|
107
118
|
} else {
|
|
@@ -115,6 +126,7 @@ function mergePartitionsAtBlock(p1, p2, potentialMergeBlock, contractName, maxAd
|
|
|
115
126
|
mutPendingQueries: p1.mutPendingQueries,
|
|
116
127
|
prevQueryRange: p1.prevQueryRange,
|
|
117
128
|
prevPrevQueryRange: p1.prevPrevQueryRange,
|
|
129
|
+
prevRangeSize: p1.prevRangeSize,
|
|
118
130
|
latestBlockRangeUpdateBlock: p1.latestBlockRangeUpdateBlock
|
|
119
131
|
});
|
|
120
132
|
continuingBase = p2;
|
|
@@ -130,6 +142,7 @@ function mergePartitionsAtBlock(p1, p2, potentialMergeBlock, contractName, maxAd
|
|
|
130
142
|
mutPendingQueries: p2.mutPendingQueries,
|
|
131
143
|
prevQueryRange: p2.prevQueryRange,
|
|
132
144
|
prevPrevQueryRange: p2.prevPrevQueryRange,
|
|
145
|
+
prevRangeSize: p2.prevRangeSize,
|
|
133
146
|
latestBlockRangeUpdateBlock: p2.latestBlockRangeUpdateBlock
|
|
134
147
|
});
|
|
135
148
|
continuingBase = p1;
|
|
@@ -153,6 +166,7 @@ function mergePartitionsAtBlock(p1, p2, potentialMergeBlock, contractName, maxAd
|
|
|
153
166
|
mutPendingQueries: continuingBase.mutPendingQueries,
|
|
154
167
|
prevQueryRange: continuingBase.prevQueryRange,
|
|
155
168
|
prevPrevQueryRange: continuingBase.prevPrevQueryRange,
|
|
169
|
+
prevRangeSize: continuingBase.prevRangeSize,
|
|
156
170
|
latestBlockRangeUpdateBlock: continuingBase.latestBlockRangeUpdateBlock
|
|
157
171
|
});
|
|
158
172
|
let restId = nextPartitionIndexRef.contents.toString();
|
|
@@ -167,6 +181,7 @@ function mergePartitionsAtBlock(p1, p2, potentialMergeBlock, contractName, maxAd
|
|
|
167
181
|
mutPendingQueries: [],
|
|
168
182
|
prevQueryRange: continuingBase.prevQueryRange,
|
|
169
183
|
prevPrevQueryRange: continuingBase.prevPrevQueryRange,
|
|
184
|
+
prevRangeSize: continuingBase.prevRangeSize,
|
|
170
185
|
latestBlockRangeUpdateBlock: continuingBase.latestBlockRangeUpdateBlock
|
|
171
186
|
});
|
|
172
187
|
return completed;
|
|
@@ -183,6 +198,7 @@ function mergePartitionsAtBlock(p1, p2, potentialMergeBlock, contractName, maxAd
|
|
|
183
198
|
mutPendingQueries: continuingBase.mutPendingQueries,
|
|
184
199
|
prevQueryRange: continuingBase.prevQueryRange,
|
|
185
200
|
prevPrevQueryRange: continuingBase.prevPrevQueryRange,
|
|
201
|
+
prevRangeSize: continuingBase.prevRangeSize,
|
|
186
202
|
latestBlockRangeUpdateBlock: continuingBase.latestBlockRangeUpdateBlock
|
|
187
203
|
});
|
|
188
204
|
return completed;
|
|
@@ -320,7 +336,7 @@ function getPendingQueryOrThrow(p, fromBlock) {
|
|
|
320
336
|
}
|
|
321
337
|
}
|
|
322
338
|
|
|
323
|
-
function handleQueryResponse(optimizedPartitions, query, knownHeight, latestFetchedBlock) {
|
|
339
|
+
function handleQueryResponse(optimizedPartitions, query, knownHeight, itemsCount, latestFetchedBlock) {
|
|
324
340
|
let partitionId = query.partitionId;
|
|
325
341
|
let p = optimizedPartitions.entities[partitionId];
|
|
326
342
|
let p$1 = p !== undefined ? p : Stdlib_JsError.throwWithMessage(`Unexpected case: Couldn't find partition ` + partitionId);
|
|
@@ -346,6 +362,7 @@ function handleQueryResponse(optimizedPartitions, query, knownHeight, latestFetc
|
|
|
346
362
|
}
|
|
347
363
|
let updatedPrevQueryRange = shouldUpdateBlockRange ? blockRange : p$1.prevQueryRange;
|
|
348
364
|
let updatedPrevPrevQueryRange = shouldUpdateBlockRange ? p$1.prevQueryRange : p$1.prevPrevQueryRange;
|
|
365
|
+
let updatedPrevRangeSize = shouldUpdateBlockRange ? itemsCount : p$1.prevRangeSize;
|
|
349
366
|
let mutPendingQueries = p$1.mutPendingQueries;
|
|
350
367
|
let latestFetchedBlock$1 = p$1.latestFetchedBlock;
|
|
351
368
|
while ((() => {
|
|
@@ -382,6 +399,7 @@ function handleQueryResponse(optimizedPartitions, query, knownHeight, latestFetc
|
|
|
382
399
|
mutPendingQueries: updatedMainPartition_mutPendingQueries,
|
|
383
400
|
prevQueryRange: updatedPrevQueryRange,
|
|
384
401
|
prevPrevQueryRange: updatedPrevPrevQueryRange,
|
|
402
|
+
prevRangeSize: updatedPrevRangeSize,
|
|
385
403
|
latestBlockRangeUpdateBlock: updatedMainPartition_latestBlockRangeUpdateBlock
|
|
386
404
|
};
|
|
387
405
|
mutEntities[p$1.id] = updatedMainPartition;
|
|
@@ -628,6 +646,7 @@ function createPartitionsFromIndexingAddresses(registeringContractsByContract, d
|
|
|
628
646
|
mutPendingQueries: [],
|
|
629
647
|
prevQueryRange: 0,
|
|
630
648
|
prevPrevQueryRange: 0,
|
|
649
|
+
prevRangeSize: 0,
|
|
631
650
|
latestBlockRangeUpdateBlock: 0
|
|
632
651
|
});
|
|
633
652
|
nextPartitionIndexRef = nextPartitionIndexRef + 1 | 0;
|
|
@@ -678,6 +697,7 @@ function createPartitionsFromIndexingAddresses(registeringContractsByContract, d
|
|
|
678
697
|
mutPendingQueries: currentP.mutPendingQueries,
|
|
679
698
|
prevQueryRange: currentP.prevQueryRange,
|
|
680
699
|
prevPrevQueryRange: currentP.prevPrevQueryRange,
|
|
700
|
+
prevRangeSize: currentP.prevRangeSize,
|
|
681
701
|
latestBlockRangeUpdateBlock: currentP.latestBlockRangeUpdateBlock
|
|
682
702
|
});
|
|
683
703
|
currentPRef = {
|
|
@@ -690,6 +710,7 @@ function createPartitionsFromIndexingAddresses(registeringContractsByContract, d
|
|
|
690
710
|
mutPendingQueries: nextP.mutPendingQueries,
|
|
691
711
|
prevQueryRange: nextP.prevQueryRange,
|
|
692
712
|
prevPrevQueryRange: nextP.prevPrevQueryRange,
|
|
713
|
+
prevRangeSize: nextP.prevRangeSize,
|
|
693
714
|
latestBlockRangeUpdateBlock: nextP.latestBlockRangeUpdateBlock
|
|
694
715
|
};
|
|
695
716
|
} else {
|
|
@@ -703,6 +724,7 @@ function createPartitionsFromIndexingAddresses(registeringContractsByContract, d
|
|
|
703
724
|
mutPendingQueries: currentP.mutPendingQueries,
|
|
704
725
|
prevQueryRange: currentP.prevQueryRange,
|
|
705
726
|
prevPrevQueryRange: currentP.prevPrevQueryRange,
|
|
727
|
+
prevRangeSize: currentP.prevRangeSize,
|
|
706
728
|
latestBlockRangeUpdateBlock: currentP.latestBlockRangeUpdateBlock
|
|
707
729
|
};
|
|
708
730
|
}
|
|
@@ -847,6 +869,7 @@ function registerDynamicContracts(fetchState, items) {
|
|
|
847
869
|
mutPendingQueries: p.mutPendingQueries,
|
|
848
870
|
prevQueryRange: p.prevQueryRange,
|
|
849
871
|
prevPrevQueryRange: p.prevPrevQueryRange,
|
|
872
|
+
prevRangeSize: p.prevRangeSize,
|
|
850
873
|
latestBlockRangeUpdateBlock: p.latestBlockRangeUpdateBlock
|
|
851
874
|
};
|
|
852
875
|
let addressesByContractName = {};
|
|
@@ -861,6 +884,7 @@ function registerDynamicContracts(fetchState, items) {
|
|
|
861
884
|
mutPendingQueries: p.mutPendingQueries,
|
|
862
885
|
prevQueryRange: p.prevQueryRange,
|
|
863
886
|
prevPrevQueryRange: p.prevPrevQueryRange,
|
|
887
|
+
prevRangeSize: p.prevRangeSize,
|
|
864
888
|
latestBlockRangeUpdateBlock: p.latestBlockRangeUpdateBlock
|
|
865
889
|
});
|
|
866
890
|
}
|
|
@@ -875,6 +899,7 @@ function registerDynamicContracts(fetchState, items) {
|
|
|
875
899
|
mutPendingQueries: p.mutPendingQueries,
|
|
876
900
|
prevQueryRange: p.prevQueryRange,
|
|
877
901
|
prevPrevQueryRange: p.prevPrevQueryRange,
|
|
902
|
+
prevRangeSize: p.prevRangeSize,
|
|
878
903
|
latestBlockRangeUpdateBlock: p.latestBlockRangeUpdateBlock
|
|
879
904
|
};
|
|
880
905
|
}
|
|
@@ -908,7 +933,7 @@ function handleQueryResult(fetchState, query, latestFetchedBlock, newItems) {
|
|
|
908
933
|
return true;
|
|
909
934
|
}
|
|
910
935
|
});
|
|
911
|
-
return updateInternal(fetchState, handleQueryResponse(fetchState.optimizedPartitions, query, fetchState.knownHeight, latestFetchedBlock), undefined, newItems$1.length !== 0 ? fetchState.buffer.concat(newItems$1) : undefined, undefined, undefined);
|
|
936
|
+
return updateInternal(fetchState, handleQueryResponse(fetchState.optimizedPartitions, query, fetchState.knownHeight, newItems$1.length, latestFetchedBlock), undefined, newItems$1.length !== 0 ? fetchState.buffer.concat(newItems$1) : undefined, undefined, undefined);
|
|
912
937
|
}
|
|
913
938
|
|
|
914
939
|
function startFetchingQueries(param, queries) {
|
|
@@ -922,6 +947,7 @@ function startFetchingQueries(param, queries) {
|
|
|
922
947
|
fromBlock: q.fromBlock,
|
|
923
948
|
toBlock: q.toBlock,
|
|
924
949
|
isChunk: q.isChunk,
|
|
950
|
+
estResponseSize: q.estResponseSize,
|
|
925
951
|
fetchedBlock: undefined
|
|
926
952
|
};
|
|
927
953
|
let inserted = false;
|
|
@@ -939,7 +965,7 @@ function startFetchingQueries(param, queries) {
|
|
|
939
965
|
}
|
|
940
966
|
}
|
|
941
967
|
|
|
942
|
-
function pushQueriesForRange(queries, partitionId, rangeFromBlock, rangeEndBlock, maxQueryBlockNumber, maybeChunkRange, selection, addressesByContractName, indexingAddresses) {
|
|
968
|
+
function pushQueriesForRange(queries, partitionId, rangeFromBlock, rangeEndBlock, maxQueryBlockNumber, maybeChunkRange, partition, selection, addressesByContractName, indexingAddresses) {
|
|
943
969
|
if (rangeFromBlock > maxQueryBlockNumber) {
|
|
944
970
|
return;
|
|
945
971
|
}
|
|
@@ -967,6 +993,9 @@ function pushQueriesForRange(queries, partitionId, rangeFromBlock, rangeEndBlock
|
|
|
967
993
|
fromBlock: chunkFromBlock,
|
|
968
994
|
toBlock: chunkToBlock,
|
|
969
995
|
isChunk: true,
|
|
996
|
+
estResponseSize: calculateEstResponseSize(partition, chunkFromBlock, chunkToBlock, maxQueryBlockNumber),
|
|
997
|
+
chainId: 0,
|
|
998
|
+
progress: 0,
|
|
970
999
|
selection: selection,
|
|
971
1000
|
addressesByContractName: addressesByContractName,
|
|
972
1001
|
indexingAddresses: indexingAddresses
|
|
@@ -981,6 +1010,9 @@ function pushQueriesForRange(queries, partitionId, rangeFromBlock, rangeEndBlock
|
|
|
981
1010
|
fromBlock: rangeFromBlock,
|
|
982
1011
|
toBlock: rangeEndBlock,
|
|
983
1012
|
isChunk: rangeEndBlock !== undefined,
|
|
1013
|
+
estResponseSize: calculateEstResponseSize(partition, rangeFromBlock, rangeEndBlock, maxQueryBlockNumber),
|
|
1014
|
+
chainId: 0,
|
|
1015
|
+
progress: 0,
|
|
984
1016
|
selection: selection,
|
|
985
1017
|
addressesByContractName: addressesByContractName,
|
|
986
1018
|
indexingAddresses: indexingAddresses
|
|
@@ -992,13 +1024,16 @@ function pushQueriesForRange(queries, partitionId, rangeFromBlock, rangeEndBlock
|
|
|
992
1024
|
fromBlock: rangeFromBlock,
|
|
993
1025
|
toBlock: rangeEndBlock,
|
|
994
1026
|
isChunk: false,
|
|
1027
|
+
estResponseSize: calculateEstResponseSize(partition, rangeFromBlock, rangeEndBlock, maxQueryBlockNumber),
|
|
1028
|
+
chainId: 0,
|
|
1029
|
+
progress: 0,
|
|
995
1030
|
selection: selection,
|
|
996
1031
|
addressesByContractName: addressesByContractName,
|
|
997
1032
|
indexingAddresses: indexingAddresses
|
|
998
1033
|
});
|
|
999
1034
|
}
|
|
1000
1035
|
|
|
1001
|
-
function getNextQuery(fetchState,
|
|
1036
|
+
function getNextQuery(fetchState, budget, chainPendingBudget) {
|
|
1002
1037
|
let knownHeight = fetchState.knownHeight;
|
|
1003
1038
|
let blockLag = fetchState.blockLag;
|
|
1004
1039
|
let indexingAddresses = fetchState.indexingAddresses;
|
|
@@ -1007,10 +1042,7 @@ function getNextQuery(fetchState, concurrencyLimit, bufferLimit) {
|
|
|
1007
1042
|
if (headBlockNumber <= 0) {
|
|
1008
1043
|
return "WaitingForNewBlock";
|
|
1009
1044
|
}
|
|
1010
|
-
if (
|
|
1011
|
-
return "ReachedMaxConcurrency";
|
|
1012
|
-
}
|
|
1013
|
-
if (bufferLimit <= 0) {
|
|
1045
|
+
if (budget <= 0) {
|
|
1014
1046
|
return "NothingToQuery";
|
|
1015
1047
|
}
|
|
1016
1048
|
let isOnBlockBehindTheHead = fetchState.latestOnBlockBlockNumber < headBlockNumber;
|
|
@@ -1018,7 +1050,7 @@ function getNextQuery(fetchState, concurrencyLimit, bufferLimit) {
|
|
|
1018
1050
|
let shouldWaitForNewBlock = (
|
|
1019
1051
|
endBlock !== undefined ? headBlockNumber < endBlock : true
|
|
1020
1052
|
) && !isOnBlockBehindTheHead;
|
|
1021
|
-
let item = fetchState.buffer[
|
|
1053
|
+
let item = fetchState.buffer[(budget + (chainPendingBudget | 0) | 0) - 1 | 0];
|
|
1022
1054
|
let maxQueryBlockNumber = item !== undefined ? Primitive_int.min(item.blockNumber, knownHeight) : knownHeight;
|
|
1023
1055
|
let queries = [];
|
|
1024
1056
|
let partitionsCount = optimizedPartitions.idsInAscOrder.length;
|
|
@@ -1080,6 +1112,9 @@ function getNextQuery(fetchState, concurrencyLimit, bufferLimit) {
|
|
|
1080
1112
|
fromBlock: chunkFromBlock,
|
|
1081
1113
|
toBlock: chunkToBlock,
|
|
1082
1114
|
isChunk: true,
|
|
1115
|
+
estResponseSize: calculateEstResponseSize(p, chunkFromBlock, chunkToBlock, maxQueryBlockNumber),
|
|
1116
|
+
chainId: 0,
|
|
1117
|
+
progress: 0,
|
|
1083
1118
|
selection: selection,
|
|
1084
1119
|
addressesByContractName: addressesByContractName,
|
|
1085
1120
|
indexingAddresses: indexingAddresses
|
|
@@ -1093,6 +1128,9 @@ function getNextQuery(fetchState, concurrencyLimit, bufferLimit) {
|
|
|
1093
1128
|
fromBlock: rangeFromBlock,
|
|
1094
1129
|
toBlock: rangeEndBlock,
|
|
1095
1130
|
isChunk: rangeEndBlock !== undefined,
|
|
1131
|
+
estResponseSize: calculateEstResponseSize(p, rangeFromBlock, rangeEndBlock, maxQueryBlockNumber),
|
|
1132
|
+
chainId: 0,
|
|
1133
|
+
progress: 0,
|
|
1096
1134
|
selection: selection,
|
|
1097
1135
|
addressesByContractName: addressesByContractName,
|
|
1098
1136
|
indexingAddresses: indexingAddresses
|
|
@@ -1104,6 +1142,9 @@ function getNextQuery(fetchState, concurrencyLimit, bufferLimit) {
|
|
|
1104
1142
|
fromBlock: rangeFromBlock,
|
|
1105
1143
|
toBlock: rangeEndBlock,
|
|
1106
1144
|
isChunk: false,
|
|
1145
|
+
estResponseSize: calculateEstResponseSize(p, rangeFromBlock, rangeEndBlock, maxQueryBlockNumber),
|
|
1146
|
+
chainId: 0,
|
|
1147
|
+
progress: 0,
|
|
1107
1148
|
selection: selection,
|
|
1108
1149
|
addressesByContractName: addressesByContractName,
|
|
1109
1150
|
indexingAddresses: indexingAddresses
|
|
@@ -1157,6 +1198,9 @@ function getNextQuery(fetchState, concurrencyLimit, bufferLimit) {
|
|
|
1157
1198
|
fromBlock: chunkFromBlock$1,
|
|
1158
1199
|
toBlock: chunkToBlock$1,
|
|
1159
1200
|
isChunk: true,
|
|
1201
|
+
estResponseSize: calculateEstResponseSize(p, chunkFromBlock$1, chunkToBlock$1, maxQueryBlockNumber),
|
|
1202
|
+
chainId: 0,
|
|
1203
|
+
progress: 0,
|
|
1160
1204
|
selection: selection$1,
|
|
1161
1205
|
addressesByContractName: addressesByContractName$1,
|
|
1162
1206
|
indexingAddresses: indexingAddresses
|
|
@@ -1170,6 +1214,9 @@ function getNextQuery(fetchState, concurrencyLimit, bufferLimit) {
|
|
|
1170
1214
|
fromBlock: rangeFromBlock$1,
|
|
1171
1215
|
toBlock: queryEndBlock$2,
|
|
1172
1216
|
isChunk: queryEndBlock$2 !== undefined,
|
|
1217
|
+
estResponseSize: calculateEstResponseSize(p, rangeFromBlock$1, queryEndBlock$2, maxQueryBlockNumber),
|
|
1218
|
+
chainId: 0,
|
|
1219
|
+
progress: 0,
|
|
1173
1220
|
selection: selection$1,
|
|
1174
1221
|
addressesByContractName: addressesByContractName$1,
|
|
1175
1222
|
indexingAddresses: indexingAddresses
|
|
@@ -1181,6 +1228,9 @@ function getNextQuery(fetchState, concurrencyLimit, bufferLimit) {
|
|
|
1181
1228
|
fromBlock: rangeFromBlock$1,
|
|
1182
1229
|
toBlock: queryEndBlock$2,
|
|
1183
1230
|
isChunk: false,
|
|
1231
|
+
estResponseSize: calculateEstResponseSize(p, rangeFromBlock$1, queryEndBlock$2, maxQueryBlockNumber),
|
|
1232
|
+
chainId: 0,
|
|
1233
|
+
progress: 0,
|
|
1184
1234
|
selection: selection$1,
|
|
1185
1235
|
addressesByContractName: addressesByContractName$1,
|
|
1186
1236
|
indexingAddresses: indexingAddresses
|
|
@@ -1202,12 +1252,12 @@ function getNextQuery(fetchState, concurrencyLimit, bufferLimit) {
|
|
|
1202
1252
|
} else {
|
|
1203
1253
|
return "NothingToQuery";
|
|
1204
1254
|
}
|
|
1255
|
+
} else {
|
|
1256
|
+
return {
|
|
1257
|
+
TAG: "Ready",
|
|
1258
|
+
_0: queries
|
|
1259
|
+
};
|
|
1205
1260
|
}
|
|
1206
|
-
let queries$1 = queries.length > concurrencyLimit ? (queries.sort((a, b) => Primitive_int.compare(a.fromBlock, b.fromBlock)), queries.slice(0, concurrencyLimit)) : queries;
|
|
1207
|
-
return {
|
|
1208
|
-
TAG: "Ready",
|
|
1209
|
-
_0: queries$1
|
|
1210
|
-
};
|
|
1211
1261
|
}
|
|
1212
1262
|
|
|
1213
1263
|
function hasReadyItem(fetchState) {
|
|
@@ -1295,6 +1345,7 @@ function make$1(startBlock, endBlock, eventConfigs, addresses, maxAddrInPartitio
|
|
|
1295
1345
|
mutPendingQueries: [],
|
|
1296
1346
|
prevQueryRange: 0,
|
|
1297
1347
|
prevPrevQueryRange: 0,
|
|
1348
|
+
prevRangeSize: 0,
|
|
1298
1349
|
latestBlockRangeUpdateBlock: 0
|
|
1299
1350
|
});
|
|
1300
1351
|
}
|
|
@@ -1402,6 +1453,7 @@ function rollbackPendingQueries(mutPendingQueries, targetBlockNumber) {
|
|
|
1402
1453
|
fromBlock: pq.fromBlock,
|
|
1403
1454
|
toBlock: pq.toBlock,
|
|
1404
1455
|
isChunk: pq.isChunk,
|
|
1456
|
+
estResponseSize: pq.estResponseSize,
|
|
1405
1457
|
fetchedBlock: {
|
|
1406
1458
|
blockNumber: targetBlockNumber,
|
|
1407
1459
|
blockTimestamp: 0
|
|
@@ -1469,6 +1521,7 @@ function rollback(fetchState, targetBlockNumber) {
|
|
|
1469
1521
|
mutPendingQueries: rollbackPendingQueries(p.mutPendingQueries, targetBlockNumber),
|
|
1470
1522
|
prevQueryRange: p.prevQueryRange,
|
|
1471
1523
|
prevPrevQueryRange: p.prevPrevQueryRange,
|
|
1524
|
+
prevRangeSize: p.prevRangeSize,
|
|
1472
1525
|
latestBlockRangeUpdateBlock: p.latestBlockRangeUpdateBlock
|
|
1473
1526
|
});
|
|
1474
1527
|
}
|
|
@@ -1489,6 +1542,7 @@ function rollback(fetchState, targetBlockNumber) {
|
|
|
1489
1542
|
mutPendingQueries: rollbackPendingQueries(p.mutPendingQueries, targetBlockNumber),
|
|
1490
1543
|
prevQueryRange: p.prevQueryRange,
|
|
1491
1544
|
prevPrevQueryRange: p.prevPrevQueryRange,
|
|
1545
|
+
prevRangeSize: p.prevRangeSize,
|
|
1492
1546
|
latestBlockRangeUpdateBlock: p.latestBlockRangeUpdateBlock
|
|
1493
1547
|
});
|
|
1494
1548
|
}
|
|
@@ -1533,6 +1587,7 @@ function resetPendingQueries(fetchState) {
|
|
|
1533
1587
|
mutPendingQueries: kept,
|
|
1534
1588
|
prevQueryRange: partition.prevQueryRange,
|
|
1535
1589
|
prevPrevQueryRange: partition.prevPrevQueryRange,
|
|
1590
|
+
prevRangeSize: partition.prevRangeSize,
|
|
1536
1591
|
latestBlockRangeUpdateBlock: partition.latestBlockRangeUpdateBlock
|
|
1537
1592
|
};
|
|
1538
1593
|
}
|
|
@@ -1619,6 +1674,19 @@ function getProgressPercentage(fetchState) {
|
|
|
1619
1674
|
return progress / totalRange;
|
|
1620
1675
|
}
|
|
1621
1676
|
|
|
1677
|
+
function getProgressPercentageAt(fetchState, blockNumber) {
|
|
1678
|
+
let firstEventBlock = fetchState.firstEventBlock;
|
|
1679
|
+
if (firstEventBlock === undefined) {
|
|
1680
|
+
return 0;
|
|
1681
|
+
}
|
|
1682
|
+
let totalRange = fetchState.knownHeight - firstEventBlock | 0;
|
|
1683
|
+
if (totalRange <= 0) {
|
|
1684
|
+
return 0;
|
|
1685
|
+
} else {
|
|
1686
|
+
return (blockNumber - firstEventBlock | 0) / totalRange;
|
|
1687
|
+
}
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1622
1690
|
function hasFullBatch(fetchState, batchSizeTarget) {
|
|
1623
1691
|
let item = fetchState.buffer[batchSizeTarget - 1 | 0];
|
|
1624
1692
|
if (item !== undefined) {
|
|
@@ -1672,12 +1740,16 @@ function updateKnownHeight(fetchState, knownHeight) {
|
|
|
1672
1740
|
}
|
|
1673
1741
|
}
|
|
1674
1742
|
|
|
1743
|
+
let defaultEstResponseSize = 10000;
|
|
1744
|
+
|
|
1675
1745
|
let blockItemLogIndex = 16777216;
|
|
1676
1746
|
|
|
1677
1747
|
let maxPendingChunksPerPartition = 10;
|
|
1678
1748
|
|
|
1679
1749
|
export {
|
|
1680
1750
|
deriveEffectiveStartBlock,
|
|
1751
|
+
defaultEstResponseSize,
|
|
1752
|
+
calculateEstResponseSize,
|
|
1681
1753
|
getMinHistoryRange,
|
|
1682
1754
|
getMinQueryRange,
|
|
1683
1755
|
OptimizedPartitions,
|
|
@@ -1710,6 +1782,7 @@ export {
|
|
|
1710
1782
|
isFetchingAtHead,
|
|
1711
1783
|
isReadyToEnterReorgThreshold,
|
|
1712
1784
|
getProgressPercentage,
|
|
1785
|
+
getProgressPercentageAt,
|
|
1713
1786
|
sortForBatch,
|
|
1714
1787
|
getProgressBlockNumberAt,
|
|
1715
1788
|
updateKnownHeight,
|
package/src/IndexerLoop.res
CHANGED
|
@@ -19,12 +19,11 @@ let start = (state: IndexerState.t) => {
|
|
|
19
19
|
launch(state, () =>
|
|
20
20
|
state
|
|
21
21
|
->IndexerState.crossChainState
|
|
22
|
-
->CrossChainState.checkAndFetch(~
|
|
22
|
+
->CrossChainState.checkAndFetch(~dispatchChain=(~chain, ~action) =>
|
|
23
23
|
ChainFetching.fetchChain(
|
|
24
24
|
state,
|
|
25
25
|
chain,
|
|
26
|
-
~
|
|
27
|
-
~bufferLimit,
|
|
26
|
+
~action,
|
|
28
27
|
~stateId=state->IndexerState.epoch,
|
|
29
28
|
~scheduleFetch,
|
|
30
29
|
~scheduleProcessing,
|
package/src/IndexerLoop.res.mjs
CHANGED
|
@@ -15,7 +15,7 @@ function launch(state, work) {
|
|
|
15
15
|
|
|
16
16
|
function start(state) {
|
|
17
17
|
let scheduleFetch = () => {
|
|
18
|
-
let work = () => CrossChainState.checkAndFetch(IndexerState.crossChainState(state), (chain,
|
|
18
|
+
let work = () => CrossChainState.checkAndFetch(IndexerState.crossChainState(state), (chain, action) => ChainFetching.fetchChain(state, chain, action, IndexerState.epoch(state), scheduleFetch, scheduleProcessing, scheduleRollback));
|
|
19
19
|
if (!IndexerState.isStopped(state)) {
|
|
20
20
|
work();
|
|
21
21
|
return;
|
package/src/IndexerState.res
CHANGED
|
@@ -116,8 +116,6 @@ let make = (
|
|
|
116
116
|
~chainStates: dict<ChainState.t>,
|
|
117
117
|
~isInReorgThreshold: bool,
|
|
118
118
|
~isRealtime: bool,
|
|
119
|
-
~maxBackfillConcurrency=Env.maxBackfillConcurrency,
|
|
120
|
-
~maxRealtimeConcurrency=Env.maxRealtimeConcurrency,
|
|
121
119
|
~targetBufferSize=CrossChainState.calculateTargetBufferSize(),
|
|
122
120
|
~committedCheckpointId=Internal.initialCheckpointId,
|
|
123
121
|
~isDevelopmentMode=false,
|
|
@@ -160,8 +158,6 @@ let make = (
|
|
|
160
158
|
~chainStates,
|
|
161
159
|
~isInReorgThreshold,
|
|
162
160
|
~isRealtime,
|
|
163
|
-
~maxBackfillConcurrency,
|
|
164
|
-
~maxRealtimeConcurrency,
|
|
165
161
|
~targetBufferSize,
|
|
166
162
|
),
|
|
167
163
|
indexerStartTime: Date.make(),
|
|
@@ -194,8 +190,6 @@ let makeFromDbState = (
|
|
|
194
190
|
~shouldUseTui=false,
|
|
195
191
|
~exitAfterFirstEventBlock=false,
|
|
196
192
|
~reducedPollingInterval=?,
|
|
197
|
-
~maxBackfillConcurrency=Env.maxBackfillConcurrency,
|
|
198
|
-
~maxRealtimeConcurrency=Env.maxRealtimeConcurrency,
|
|
199
193
|
~targetBufferSize=CrossChainState.calculateTargetBufferSize(),
|
|
200
194
|
~onError,
|
|
201
195
|
) => {
|
|
@@ -269,8 +263,6 @@ let makeFromDbState = (
|
|
|
269
263
|
~chainStates,
|
|
270
264
|
~isInReorgThreshold,
|
|
271
265
|
~isRealtime,
|
|
272
|
-
~maxBackfillConcurrency,
|
|
273
|
-
~maxRealtimeConcurrency,
|
|
274
266
|
~targetBufferSize,
|
|
275
267
|
~committedCheckpointId=initialState.checkpointId,
|
|
276
268
|
~isDevelopmentMode,
|
package/src/IndexerState.res.mjs
CHANGED
|
@@ -53,9 +53,7 @@ function get(self, entityName) {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
function make$2(config, persistence, chainStates, isInReorgThreshold, isRealtime,
|
|
57
|
-
let maxBackfillConcurrency = maxBackfillConcurrencyOpt !== undefined ? maxBackfillConcurrencyOpt : Env.maxBackfillConcurrency;
|
|
58
|
-
let maxRealtimeConcurrency = maxRealtimeConcurrencyOpt !== undefined ? maxRealtimeConcurrencyOpt : Env.maxRealtimeConcurrency;
|
|
56
|
+
function make$2(config, persistence, chainStates, isInReorgThreshold, isRealtime, targetBufferSizeOpt, committedCheckpointIdOpt, isDevelopmentModeOpt, shouldUseTuiOpt, exitAfterFirstEventBlockOpt, onError) {
|
|
59
57
|
let targetBufferSize = targetBufferSizeOpt !== undefined ? targetBufferSizeOpt : CrossChainState.calculateTargetBufferSize();
|
|
60
58
|
let committedCheckpointId = committedCheckpointIdOpt !== undefined ? committedCheckpointIdOpt : Internal.initialCheckpointId;
|
|
61
59
|
let isDevelopmentMode = isDevelopmentModeOpt !== undefined ? isDevelopmentModeOpt : false;
|
|
@@ -84,7 +82,7 @@ function make$2(config, persistence, chainStates, isInReorgThreshold, isRealtime
|
|
|
84
82
|
chainMetaDirty: false,
|
|
85
83
|
chainMetaThrottler: chainMetaThrottler,
|
|
86
84
|
isProcessing: false,
|
|
87
|
-
crossChainState: CrossChainState.make(chainStates, isInReorgThreshold, isRealtime,
|
|
85
|
+
crossChainState: CrossChainState.make(chainStates, isInReorgThreshold, isRealtime, targetBufferSize),
|
|
88
86
|
rollbackState: "NoRollback",
|
|
89
87
|
indexerStartTime: new Date(),
|
|
90
88
|
writeThrottlers: make(),
|
|
@@ -97,12 +95,10 @@ function make$2(config, persistence, chainStates, isInReorgThreshold, isRealtime
|
|
|
97
95
|
};
|
|
98
96
|
}
|
|
99
97
|
|
|
100
|
-
function makeFromDbState(config, persistence, initialState, registrations, isDevelopmentModeOpt, shouldUseTuiOpt, exitAfterFirstEventBlockOpt, reducedPollingInterval,
|
|
98
|
+
function makeFromDbState(config, persistence, initialState, registrations, isDevelopmentModeOpt, shouldUseTuiOpt, exitAfterFirstEventBlockOpt, reducedPollingInterval, targetBufferSizeOpt, onError) {
|
|
101
99
|
let isDevelopmentMode = isDevelopmentModeOpt !== undefined ? isDevelopmentModeOpt : false;
|
|
102
100
|
let shouldUseTui = shouldUseTuiOpt !== undefined ? shouldUseTuiOpt : false;
|
|
103
101
|
let exitAfterFirstEventBlock = exitAfterFirstEventBlockOpt !== undefined ? exitAfterFirstEventBlockOpt : false;
|
|
104
|
-
let maxBackfillConcurrency = maxBackfillConcurrencyOpt !== undefined ? maxBackfillConcurrencyOpt : Env.maxBackfillConcurrency;
|
|
105
|
-
let maxRealtimeConcurrency = maxRealtimeConcurrencyOpt !== undefined ? maxRealtimeConcurrencyOpt : Env.maxRealtimeConcurrency;
|
|
106
102
|
let targetBufferSize = targetBufferSizeOpt !== undefined ? targetBufferSizeOpt : CrossChainState.calculateTargetBufferSize();
|
|
107
103
|
let isInReorgThreshold = initialState.cleanRun ? false : initialState.chains.some(chain => {
|
|
108
104
|
let progressBlockNumber = chain.progressBlockNumber;
|
|
@@ -144,7 +140,7 @@ function makeFromDbState(config, persistence, initialState, registrations, isDev
|
|
|
144
140
|
if (allChainsReady.contents) {
|
|
145
141
|
Prometheus.ProgressReady.setAllReady();
|
|
146
142
|
}
|
|
147
|
-
return make$2(config, persistence, chainStates, isInReorgThreshold, isRealtime,
|
|
143
|
+
return make$2(config, persistence, chainStates, isInReorgThreshold, isRealtime, targetBufferSize, initialState.checkpointId, isDevelopmentMode, shouldUseTui, exitAfterFirstEventBlock, onError);
|
|
148
144
|
}
|
|
149
145
|
|
|
150
146
|
function isStale(state, stateId) {
|
package/src/IndexerState.resi
CHANGED
|
@@ -32,8 +32,6 @@ let make: (
|
|
|
32
32
|
~chainStates: dict<ChainState.t>,
|
|
33
33
|
~isInReorgThreshold: bool,
|
|
34
34
|
~isRealtime: bool,
|
|
35
|
-
~maxBackfillConcurrency: int=?,
|
|
36
|
-
~maxRealtimeConcurrency: int=?,
|
|
37
35
|
~targetBufferSize: int=?,
|
|
38
36
|
~committedCheckpointId: Internal.checkpointId=?,
|
|
39
37
|
~isDevelopmentMode: bool=?,
|
|
@@ -51,8 +49,6 @@ let makeFromDbState: (
|
|
|
51
49
|
~shouldUseTui: bool=?,
|
|
52
50
|
~exitAfterFirstEventBlock: bool=?,
|
|
53
51
|
~reducedPollingInterval: int=?,
|
|
54
|
-
~maxBackfillConcurrency: int=?,
|
|
55
|
-
~maxRealtimeConcurrency: int=?,
|
|
56
52
|
~targetBufferSize: int=?,
|
|
57
53
|
~onError: ErrorHandling.t => unit,
|
|
58
54
|
) => t
|
package/src/Internal.res
CHANGED
|
@@ -136,6 +136,36 @@ let allEvmTransactionFields: array<evmTransactionField> = [
|
|
|
136
136
|
]
|
|
137
137
|
let evmTransactionFieldSchema = S.enum(allEvmTransactionFields)
|
|
138
138
|
|
|
139
|
+
// SVM transaction fields. Order mirrors the Rust `SvmTxField` ordinals (the bit
|
|
140
|
+
// position in the selection mask) and `Svm.res` `transactionFields`.
|
|
141
|
+
type svmTransactionField =
|
|
142
|
+
| @as("transactionIndex") TransactionIndex
|
|
143
|
+
| @as("signatures") Signatures
|
|
144
|
+
| @as("feePayer") FeePayer
|
|
145
|
+
| @as("success") Success
|
|
146
|
+
| @as("err") Err
|
|
147
|
+
| @as("fee") Fee
|
|
148
|
+
| @as("computeUnitsConsumed") ComputeUnitsConsumed
|
|
149
|
+
| @as("accountKeys") AccountKeys
|
|
150
|
+
| @as("recentBlockhash") RecentBlockhash
|
|
151
|
+
| @as("version") Version
|
|
152
|
+
| @as("tokenBalances") TokenBalances
|
|
153
|
+
|
|
154
|
+
let allSvmTransactionFields: array<svmTransactionField> = [
|
|
155
|
+
TransactionIndex,
|
|
156
|
+
Signatures,
|
|
157
|
+
FeePayer,
|
|
158
|
+
Success,
|
|
159
|
+
Err,
|
|
160
|
+
Fee,
|
|
161
|
+
ComputeUnitsConsumed,
|
|
162
|
+
AccountKeys,
|
|
163
|
+
RecentBlockhash,
|
|
164
|
+
Version,
|
|
165
|
+
TokenBalances,
|
|
166
|
+
]
|
|
167
|
+
let svmTransactionFieldSchema = S.enum(allSvmTransactionFields)
|
|
168
|
+
|
|
139
169
|
// Static sets of nullable field names — used by RpcSource and HyperSyncSource to wrap schemas with S.nullable
|
|
140
170
|
let evmNullableBlockFields = Utils.Set.fromArray(
|
|
141
171
|
(
|
|
@@ -277,7 +307,10 @@ type event
|
|
|
277
307
|
// modules, not here, and are distinct per ecosystem.
|
|
278
308
|
type eventPayload
|
|
279
309
|
|
|
280
|
-
|
|
310
|
+
// Generic access to the payload's `transaction`, written at batch prep for
|
|
311
|
+
// store-backed ecosystems (HyperSync) and present inline otherwise.
|
|
312
|
+
@get external getPayloadTransaction: eventPayload => Nullable.t<eventTransaction> = "transaction"
|
|
313
|
+
@set external setPayloadTransaction: (eventPayload, eventTransaction) => unit = "transaction"
|
|
281
314
|
|
|
282
315
|
type genericLoaderArgs<'event, 'context> = {
|
|
283
316
|
event: 'event,
|
|
@@ -382,6 +415,11 @@ type eventConfig = private {
|
|
|
382
415
|
paramsRawEventSchema: S.schema<eventParams>,
|
|
383
416
|
simulateParamsSchema: S.schema<eventParams>,
|
|
384
417
|
startBlock: option<int>,
|
|
418
|
+
// Field names selected for the chain's transaction-store materialisation
|
|
419
|
+
// (camelCase, matching the ecosystem's `transactionFields`). Stored as a
|
|
420
|
+
// string set so the shared mask logic is ecosystem-agnostic; sources recover
|
|
421
|
+
// the typed view where they need it.
|
|
422
|
+
selectedTransactionFields: Utils.Set.t<string>,
|
|
385
423
|
}
|
|
386
424
|
|
|
387
425
|
type fuelEventKind =
|
|
@@ -419,7 +457,6 @@ type evmEventConfig = {
|
|
|
419
457
|
...eventConfig,
|
|
420
458
|
getEventFiltersOrThrow: ChainMap.Chain.t => eventFilters,
|
|
421
459
|
selectedBlockFields: Utils.Set.t<evmBlockField>,
|
|
422
|
-
selectedTransactionFields: Utils.Set.t<evmTransactionField>,
|
|
423
460
|
sighash: string,
|
|
424
461
|
topicCount: int,
|
|
425
462
|
paramsMetadata: array<paramMeta>,
|
|
@@ -456,9 +493,7 @@ type svmInstructionEventConfig = {
|
|
|
456
493
|
`dN` selector at query time and the dispatch-key precomputation in the
|
|
457
494
|
router. */
|
|
458
495
|
discriminatorByteLen: int,
|
|
459
|
-
includeTransaction: bool,
|
|
460
496
|
includeLogs: bool,
|
|
461
|
-
includeTokenBalances: bool,
|
|
462
497
|
/** Disjunctive normal form: outer array is OR of AND-groups, inner array is
|
|
463
498
|
AND across positions. Empty outer array means "no account filter". */
|
|
464
499
|
accountFilters: array<svmAccountFilterGroup>,
|
|
@@ -502,6 +537,9 @@ type eventItem = private {
|
|
|
502
537
|
blockNumber: int,
|
|
503
538
|
blockHash: string,
|
|
504
539
|
logIndex: int,
|
|
540
|
+
// Within-block transaction index — the key into the per-chain transaction
|
|
541
|
+
// store. Unused (0) for ecosystems that carry the transaction inline (Fuel).
|
|
542
|
+
transactionIndex: int,
|
|
505
543
|
payload: eventPayload,
|
|
506
544
|
}
|
|
507
545
|
|
|
@@ -554,6 +592,7 @@ type item =
|
|
|
554
592
|
blockNumber: int,
|
|
555
593
|
blockHash: string,
|
|
556
594
|
logIndex: int,
|
|
595
|
+
transactionIndex: int,
|
|
557
596
|
payload: eventPayload,
|
|
558
597
|
})
|
|
559
598
|
| @as(1) Block({onBlockConfig: onBlockConfig, blockNumber: int, logIndex: int})
|
package/src/Internal.res.mjs
CHANGED
|
@@ -74,6 +74,22 @@ let allEvmTransactionFields = [
|
|
|
74
74
|
|
|
75
75
|
let evmTransactionFieldSchema = S$RescriptSchema.$$enum(allEvmTransactionFields);
|
|
76
76
|
|
|
77
|
+
let allSvmTransactionFields = [
|
|
78
|
+
"transactionIndex",
|
|
79
|
+
"signatures",
|
|
80
|
+
"feePayer",
|
|
81
|
+
"success",
|
|
82
|
+
"err",
|
|
83
|
+
"fee",
|
|
84
|
+
"computeUnitsConsumed",
|
|
85
|
+
"accountKeys",
|
|
86
|
+
"recentBlockhash",
|
|
87
|
+
"version",
|
|
88
|
+
"tokenBalances"
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
let svmTransactionFieldSchema = S$RescriptSchema.$$enum(allSvmTransactionFields);
|
|
92
|
+
|
|
77
93
|
let evmNullableBlockFields = new Set([
|
|
78
94
|
"nonce",
|
|
79
95
|
"difficulty",
|
|
@@ -160,6 +176,8 @@ export {
|
|
|
160
176
|
evmBlockFieldSchema,
|
|
161
177
|
allEvmTransactionFields,
|
|
162
178
|
evmTransactionFieldSchema,
|
|
179
|
+
allSvmTransactionFields,
|
|
180
|
+
svmTransactionFieldSchema,
|
|
163
181
|
evmNullableBlockFields,
|
|
164
182
|
evmNullableTransactionFields,
|
|
165
183
|
dependsOnAddresses,
|