envio 2.29.0 → 2.29.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "envio",
3
- "version": "v2.29.0",
3
+ "version": "v2.29.2",
4
4
  "description": "A latency and sync speed optimized, developer friendly blockchain data indexer.",
5
5
  "bin": "./bin.js",
6
6
  "main": "./index.js",
@@ -25,10 +25,10 @@
25
25
  },
26
26
  "homepage": "https://envio.dev",
27
27
  "optionalDependencies": {
28
- "envio-linux-x64": "v2.29.0",
29
- "envio-linux-arm64": "v2.29.0",
30
- "envio-darwin-x64": "v2.29.0",
31
- "envio-darwin-arm64": "v2.29.0"
28
+ "envio-linux-x64": "v2.29.2",
29
+ "envio-linux-arm64": "v2.29.2",
30
+ "envio-darwin-x64": "v2.29.2",
31
+ "envio-darwin-arm64": "v2.29.2"
32
32
  },
33
33
  "dependencies": {
34
34
  "@envio-dev/hypersync-client": "0.6.6",
@@ -1161,11 +1161,18 @@ let rollbackPartition = (
1161
1161
  ~firstChangeEvent: blockNumberAndLogIndex,
1162
1162
  ~addressesToRemove,
1163
1163
  ) => {
1164
+ let shouldRollbackFetched = p.latestFetchedBlock.blockNumber >= firstChangeEvent.blockNumber
1165
+ let latestFetchedBlock = shouldRollbackFetched
1166
+ ? {
1167
+ blockNumber: firstChangeEvent.blockNumber - 1,
1168
+ blockTimestamp: 0,
1169
+ }
1170
+ : p.latestFetchedBlock
1164
1171
  switch p {
1165
1172
  | {selection: {dependsOnAddresses: false}} =>
1166
1173
  Some({
1167
1174
  ...p,
1168
- // FIXME: Should rollback latestFetchedBlock???
1175
+ latestFetchedBlock,
1169
1176
  status: {
1170
1177
  fetchingStateId: None,
1171
1178
  },
@@ -1183,8 +1190,6 @@ let rollbackPartition = (
1183
1190
  if rollbackedAddressesByContractName->Js.Dict.keys->Array.length === 0 {
1184
1191
  None
1185
1192
  } else {
1186
- let shouldRollbackFetched = p.latestFetchedBlock.blockNumber >= firstChangeEvent.blockNumber
1187
-
1188
1193
  Some({
1189
1194
  id: p.id,
1190
1195
  selection: p.selection,
@@ -1192,12 +1197,7 @@ let rollbackPartition = (
1192
1197
  fetchingStateId: None,
1193
1198
  },
1194
1199
  addressesByContractName: rollbackedAddressesByContractName,
1195
- latestFetchedBlock: shouldRollbackFetched
1196
- ? {
1197
- blockNumber: firstChangeEvent.blockNumber - 1,
1198
- blockTimestamp: 0,
1199
- }
1200
- : p.latestFetchedBlock,
1200
+ latestFetchedBlock,
1201
1201
  })
1202
1202
  }
1203
1203
  }
@@ -890,13 +890,18 @@ function pruneQueueFromFirstChangeEvent(queue, firstChangeEvent) {
890
890
  }
891
891
 
892
892
  function rollbackPartition(p, firstChangeEvent, addressesToRemove) {
893
+ var shouldRollbackFetched = p.latestFetchedBlock.blockNumber >= firstChangeEvent.blockNumber;
894
+ var latestFetchedBlock = shouldRollbackFetched ? ({
895
+ blockNumber: firstChangeEvent.blockNumber - 1 | 0,
896
+ blockTimestamp: 0
897
+ }) : p.latestFetchedBlock;
893
898
  if (!p.selection.dependsOnAddresses) {
894
899
  return {
895
900
  id: p.id,
896
901
  status: {
897
902
  fetchingStateId: undefined
898
903
  },
899
- latestFetchedBlock: p.latestFetchedBlock,
904
+ latestFetchedBlock: latestFetchedBlock,
900
905
  selection: p.selection,
901
906
  addressesByContractName: p.addressesByContractName
902
907
  };
@@ -914,20 +919,17 @@ function rollbackPartition(p, firstChangeEvent, addressesToRemove) {
914
919
  }));
915
920
  if (Object.keys(rollbackedAddressesByContractName).length === 0) {
916
921
  return ;
922
+ } else {
923
+ return {
924
+ id: p.id,
925
+ status: {
926
+ fetchingStateId: undefined
927
+ },
928
+ latestFetchedBlock: latestFetchedBlock,
929
+ selection: p.selection,
930
+ addressesByContractName: rollbackedAddressesByContractName
931
+ };
917
932
  }
918
- var shouldRollbackFetched = p.latestFetchedBlock.blockNumber >= firstChangeEvent.blockNumber;
919
- return {
920
- id: p.id,
921
- status: {
922
- fetchingStateId: undefined
923
- },
924
- latestFetchedBlock: shouldRollbackFetched ? ({
925
- blockNumber: firstChangeEvent.blockNumber - 1 | 0,
926
- blockTimestamp: 0
927
- }) : p.latestFetchedBlock,
928
- selection: p.selection,
929
- addressesByContractName: rollbackedAddressesByContractName
930
- };
931
933
  }
932
934
 
933
935
  function rollback(fetchState, firstChangeEvent) {
@@ -3,6 +3,9 @@ type t<+'a> = promise<'a>
3
3
  @new
4
4
  external make: ((@uncurry 'a => unit, 'e => unit) => unit) => t<'a> = "Promise"
5
5
 
6
+ @new
7
+ external makeAsync: ((@uncurry 'a => unit, 'e => unit) => promise<unit>) => t<'a> = "Promise"
8
+
6
9
  @val @scope("Promise")
7
10
  external resolve: 'a => t<'a> = "resolve"
8
11