ponder 0.18.0 → 0.18.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/CHANGELOG.md +16 -0
- package/dist/esm/indexing-store/index.js +8 -4
- package/dist/esm/indexing-store/index.js.map +1 -1
- package/dist/esm/indexing-store/utils.js +3 -1
- package/dist/esm/indexing-store/utils.js.map +1 -1
- package/dist/esm/rpc/actions.js +2 -16
- package/dist/esm/rpc/actions.js.map +1 -1
- package/dist/esm/runtime/filter.js +80 -32
- package/dist/esm/runtime/filter.js.map +1 -1
- package/dist/esm/sync-historical/in-memory.js +1 -2
- package/dist/esm/sync-historical/in-memory.js.map +1 -1
- package/dist/esm/sync-historical/index.js +1 -2
- package/dist/esm/sync-historical/index.js.map +1 -1
- package/dist/esm/sync-realtime/bloom.js +72 -64
- package/dist/esm/sync-realtime/bloom.js.map +1 -1
- package/dist/esm/sync-realtime/index.js +79 -50
- package/dist/esm/sync-realtime/index.js.map +1 -1
- package/dist/esm/utils/copy.js +77 -56
- package/dist/esm/utils/copy.js.map +1 -1
- package/dist/esm/utils/decodeEventLog.js +20 -6
- package/dist/esm/utils/decodeEventLog.js.map +1 -1
- package/dist/types/indexing-store/index.d.ts.map +1 -1
- package/dist/types/indexing-store/utils.d.ts.map +1 -1
- package/dist/types/rpc/actions.d.ts +2 -3
- package/dist/types/rpc/actions.d.ts.map +1 -1
- package/dist/types/runtime/filter.d.ts +24 -1
- package/dist/types/runtime/filter.d.ts.map +1 -1
- package/dist/types/sync-historical/in-memory.d.ts.map +1 -1
- package/dist/types/sync-historical/index.d.ts.map +1 -1
- package/dist/types/sync-realtime/bloom.d.ts +52 -8
- package/dist/types/sync-realtime/bloom.d.ts.map +1 -1
- package/dist/types/sync-realtime/index.d.ts.map +1 -1
- package/dist/types/utils/copy.d.ts +10 -2
- package/dist/types/utils/copy.d.ts.map +1 -1
- package/dist/types/utils/decodeEventLog.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/indexing-store/index.ts +8 -4
- package/src/indexing-store/utils.ts +3 -1
- package/src/rpc/actions.ts +1 -21
- package/src/runtime/filter.ts +116 -52
- package/src/sync-historical/in-memory.ts +0 -2
- package/src/sync-historical/index.ts +0 -2
- package/src/sync-realtime/bloom.ts +129 -79
- package/src/sync-realtime/index.ts +114 -72
- package/src/utils/copy.ts +83 -64
- package/src/utils/decodeEventLog.ts +28 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/rpc/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,4BAA4B,EAElC,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,IAAI,EAUV,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,eAAe,EACf,OAAO,EACP,SAAS,EACT,eAAe,EACf,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/rpc/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,4BAA4B,EAElC,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,KAAK,IAAI,EAUV,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EACT,eAAe,EACf,OAAO,EACP,SAAS,EACT,eAAe,EACf,sBAAsB,EACvB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAK7D,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,oBAAoB,6GAM1B,GAAG,4BAEE,WAAW,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;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,WACN,QAAQ,iBAAiB,EAAE;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC,KAC7D,OAAO,EA0IT,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,UACpB,SAAS,WACP,QACP,iBAAiB,EACjB;IAAE,MAAM,EAAE,0BAA0B,GAAG,wBAAwB,CAAA;CAAE,CAClE,KACA,SA2DF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,8BAA8B,aAC/B,sBAAsB,EAAE,WACzB,QACP,iBAAiB,EACjB;IAAE,MAAM,EAAE,sBAAsB,GAAG,2BAA2B,CAAA;CAAE,CACjE,KACA,sBAAsB,EA6IxB,CAAC"}
|
|
@@ -34,6 +34,29 @@ type EthGetLogsRequest = Extract<RequestParameters, {
|
|
|
34
34
|
* requests originating from different factories can still be merged.
|
|
35
35
|
*/
|
|
36
36
|
export declare const mergeLogFiltersToRequests: (filters: IntervalWithFilter[], childAddresses: ChildAddresses, factoryAddressCountThreshold: number) => EthGetLogsRequest[];
|
|
37
|
+
/** `address` and `topics` for an "eth_getLogs" request for one block. */
|
|
38
|
+
export type BlockLogsRequestFilter = {
|
|
39
|
+
address: Address[] | undefined;
|
|
40
|
+
topics: (Hex[] | null)[] | undefined;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Merge `LogFilter`s and `Factory`s into the `address` and `topics` of one
|
|
44
|
+
* "eth_getLogs" request for one block. The request matches a superset of the
|
|
45
|
+
* logs that `logFilters` and `factories` require. Returns `undefined` if no
|
|
46
|
+
* logs are required.
|
|
47
|
+
*
|
|
48
|
+
* @dev A log filter with a factory address matches all addresses, because child
|
|
49
|
+
* addresses created in the same block are not known before the request.
|
|
50
|
+
*
|
|
51
|
+
* @dev Each dimension is the union of all inputs, so the result can match logs
|
|
52
|
+
* that no single input matches. Logs must be filtered again after the request.
|
|
53
|
+
*
|
|
54
|
+
* @dev A dimension with more than `ADDRESS_CHUNK_SIZE` values matches all values.
|
|
55
|
+
*/
|
|
56
|
+
export declare const mergeLogFiltersToBlockRequest: ({ logFilters, factories, }: {
|
|
57
|
+
logFilters: LogFilter[];
|
|
58
|
+
factories: Factory[];
|
|
59
|
+
}) => BlockLogsRequestFilter | undefined;
|
|
37
60
|
export declare const getChildAddress: ({ log, factory, }: {
|
|
38
61
|
log: SyncLog;
|
|
39
62
|
factory: Factory;
|
|
@@ -90,7 +113,7 @@ export declare const isBlockFilterMatched: ({ filter, block, }: {
|
|
|
90
113
|
export declare const getFilterFactories: (filter: Filter) => Factory[];
|
|
91
114
|
export declare const getFilterFromBlock: (filter: Filter) => number;
|
|
92
115
|
export declare const getFilterToBlock: (filter: Filter) => number;
|
|
93
|
-
export declare const isBlockInFilter: (filter: Filter, blockNumber: number) => boolean;
|
|
116
|
+
export declare const isBlockInFilter: (filter: Filter | Factory, blockNumber: number) => boolean;
|
|
94
117
|
export declare const defaultBlockInclude: (keyof Block)[];
|
|
95
118
|
export declare const requiredBlockInclude: RequiredBlockColumns[];
|
|
96
119
|
export declare const defaultTransactionInclude: (keyof Transaction)[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/runtime/filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,GAAG,EAA4B,MAAM,MAAM,CAAC;AACxE,OAAO,KAAK,EACV,WAAW,EACX,OAAO,EACP,MAAM,EACN,aAAa,EACb,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,oBAAoB,EACpB,kBAAkB,EAClB,oBAAoB,EACpB,0BAA0B,EAC1B,iCAAiC,EACjC,SAAS,EACT,eAAe,EACf,OAAO,EACP,SAAS,EACT,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACf,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/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"in-memory.d.ts","sourceRoot":"","sources":["../../../src/sync-historical/in-memory.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EACV,KAAK,EAON,MAAM,qBAAqB,CAAC;AAW7B,OAAO,EAAE,KAAK,GAAG,EAAqB,MAAM,gBAAgB,CAAC;AAqB7D,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"in-memory.d.ts","sourceRoot":"","sources":["../../../src/sync-historical/in-memory.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EACV,KAAK,EAON,MAAM,qBAAqB,CAAC;AAW7B,OAAO,EAAE,KAAK,GAAG,EAAqB,MAAM,gBAAgB,CAAC;AAqB7D,OAAO,KAAK,EACV,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAAE,KAAK,QAAQ,EAAkB,MAAM,qBAAqB,CAAC;AAGpE,KAAK,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;AAEhE,MAAM,MAAM,sBAAsB,GAAG;IACnC,aAAa,CAAC,MAAM,EAAE;QACpB,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;QACxC,wBAAwB,EAAE,mBAAmB,EAAE,CAAC;KACjD,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;CAC/B,CAAC;AAEF,wBAAgB,4BAA4B,CAAC,MAAM,EAAE;IACnD,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,YAAY,EAAE,cAAc,CAAC;CAC9B,GAAG,sBAAsB,CA0sBzB;AAED,wBAAuB,uBAAuB,CAC5C,gBAAgB,EAAE,GAAG,CAAC;IAAE,QAAQ,EAAE,QAAQ,CAAA;CAAE,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAC,GACtE,cAAc,CAAC,QAAQ,CAAC,CAwC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sync-historical/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAAO,EAQb,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAEV,KAAK,EAGL,SAAS,EAET,SAAS,EACT,OAAO,EAMR,MAAM,qBAAqB,CAAC;AAW7B,OAAO,KAAK,EAAqB,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAe7D,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sync-historical/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAAO,EAQb,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAEV,KAAK,EAGL,SAAS,EAET,SAAS,EACT,OAAO,EAMR,MAAM,qBAAqB,CAAC;AAW7B,OAAO,KAAK,EAAqB,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAe7D,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EACnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvD,OAAO,EAEL,KAAK,QAAQ,EAGd,MAAM,qBAAqB,CAAC;AAK7B,MAAM,MAAM,cAAc,GAAG;IAC3B;;OAEG;IACH,kBAAkB,CAAC,MAAM,EAAE;QACzB,QAAQ,EAAE,QAAQ,CAAC;QACnB,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;QACxC,wBAAwB,EAAE,mBAAmB,EAAE,CAAC;QAChD,SAAS,EAAE,SAAS,CAAC;KACtB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,MAAM,EAAE;QACpB,QAAQ,EAAE,QAAQ,CAAC;QACnB,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;QACxC,IAAI,EAAE,OAAO,EAAE,CAAC;QAChB,SAAS,EAAE,SAAS,CAAC;KACtB,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;CACpC,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,cAAc,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD,CAAC;AAEF,eAAO,MAAM,oBAAoB,SACzB,8BAA8B,KACnC,cAqwBF,CAAC"}
|
|
@@ -1,18 +1,62 @@
|
|
|
1
1
|
import { type Hex } from "viem";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Factory, LogFilter } from '../internal/types.js';
|
|
3
3
|
export declare const zeroLogsBloom = "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
|
|
4
|
-
export
|
|
4
|
+
export type BloomBits = {
|
|
5
|
+
byte0: number;
|
|
6
|
+
mask0: number;
|
|
7
|
+
byte1: number;
|
|
8
|
+
mask1: number;
|
|
9
|
+
byte2: number;
|
|
10
|
+
mask2: number;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A `LogFilter` with each address and topic converted to `BloomBits`.
|
|
14
|
+
*
|
|
15
|
+
* `undefined` matches every bloom. An array matches if any item is in the bloom.
|
|
16
|
+
*/
|
|
17
|
+
export type LogFilterBloom = {
|
|
18
|
+
address: BloomBits[] | undefined;
|
|
19
|
+
topics: (BloomBits[] | undefined)[];
|
|
20
|
+
};
|
|
21
|
+
export declare const getBloomBits: (input: Hex) => BloomBits;
|
|
22
|
+
export declare const isBloomBitsInBloom: (bloom: Uint8Array, bits: BloomBits) => boolean;
|
|
23
|
+
export declare const isInBloom: (bloom: Uint8Array, input: Hex) => boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Convert `filter` to a `LogFilterBloom`. Call once for each filter,
|
|
26
|
+
* so that the inputs are not hashed again for each block.
|
|
27
|
+
*/
|
|
28
|
+
export declare const getLogFilterBloom: (filter: LogFilter) => LogFilterBloom;
|
|
5
29
|
/**
|
|
6
30
|
* Return true if `filter` is in `bloom`.
|
|
7
31
|
*
|
|
8
|
-
* A filter with an address of type `LogFactory`
|
|
9
|
-
*
|
|
10
|
-
*
|
|
32
|
+
* A filter with an address of type `LogFactory` matches all addresses.
|
|
33
|
+
* Use `isFactoryInBloom` to check for new child contracts.
|
|
34
|
+
*
|
|
35
|
+
* Note: False positives are possible.
|
|
36
|
+
*/
|
|
37
|
+
export declare function isFilterInBloom({ bloom, filter, }: {
|
|
38
|
+
bloom: Uint8Array;
|
|
39
|
+
filter: LogFilterBloom;
|
|
40
|
+
}): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* A `Factory` with its address and event selector converted to `BloomBits`.
|
|
43
|
+
*/
|
|
44
|
+
export type FactoryBloom = {
|
|
45
|
+
address: BloomBits[] | undefined;
|
|
46
|
+
eventSelector: BloomBits;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Convert `factory` to a `FactoryBloom`. Call once for each factory,
|
|
50
|
+
* so that the inputs are not hashed again for each block.
|
|
51
|
+
*/
|
|
52
|
+
export declare const getFactoryBloom: (factory: Factory) => FactoryBloom;
|
|
53
|
+
/**
|
|
54
|
+
* Return true if a log that matches `factory` can be in `bloom`.
|
|
11
55
|
*
|
|
12
56
|
* Note: False positives are possible.
|
|
13
57
|
*/
|
|
14
|
-
export declare function
|
|
15
|
-
|
|
16
|
-
|
|
58
|
+
export declare function isFactoryInBloom({ bloom, factory, }: {
|
|
59
|
+
bloom: Uint8Array;
|
|
60
|
+
factory: FactoryBloom;
|
|
17
61
|
}): boolean;
|
|
18
62
|
//# sourceMappingURL=bloom.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bloom.d.ts","sourceRoot":"","sources":["../../../src/sync-realtime/bloom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,
|
|
1
|
+
{"version":3,"file":"bloom.d.ts","sourceRoot":"","sources":["../../../src/sync-realtime/bloom.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,GAAG,EAAa,MAAM,MAAM,CAAC;AAC3C,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAG9D,eAAO,MAAM,aAAa,ugBAC4e,CAAC;AAIvgB,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;IACjC,MAAM,EAAE,CAAC,SAAS,EAAE,GAAG,SAAS,CAAC,EAAE,CAAC;CACrC,CAAC;AAEF,eAAO,MAAM,YAAY,UAAW,GAAG,KAAG,SAmBzC,CAAC;AAEF,eAAO,MAAM,kBAAkB,UACtB,UAAU,QACX,SAAS,KACd,OAGsC,CAAC;AAE1C,eAAO,MAAM,SAAS,UAAW,UAAU,SAAS,GAAG,KAAG,OACV,CAAC;AAgBjD;;;GAGG;AACH,eAAO,MAAM,iBAAiB,WAAY,SAAS,KAAG,cAiBrD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,EAC9B,KAAK,EACL,MAAM,GACP,EAAE;IACD,KAAK,EAAE,UAAU,CAAC;IAClB,MAAM,EAAE,cAAc,CAAC;CACxB,GAAG,OAAO,CAKV;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,SAAS,EAAE,GAAG,SAAS,CAAC;IACjC,aAAa,EAAE,SAAS,CAAC;CAC1B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,eAAe,YAAa,OAAO,KAAG,YAGjD,CAAC;AAEH;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,OAAO,GACR,EAAE;IACD,KAAK,EAAE,UAAU,CAAC;IAClB,OAAO,EAAE,YAAY,CAAC;CACvB,GAAG,OAAO,CAKV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sync-realtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sync-realtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,OAAO,EAOb,MAAM,MAAM,CAAC;AACd,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAEnD,OAAO,KAAK,EAEV,KAAK,EACL,aAAa,EAEb,iBAA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AAE,UAAU,EAAE,CAAA;CAAE,CAAC;AAEtE,KAAK,4BAA4B,GAAG;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,CAAC;IAC9C,cAAc,EAAE,GAAG,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;CACtD,CAAC;AAKF,eAAO,MAAM,kBAAkB,SACvB,4BAA4B,KACjC,YA8oCF,CAAC"}
|
|
@@ -3,9 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const COPY_ON_WRITE: unique symbol;
|
|
5
5
|
/**
|
|
6
|
-
* Create a copy-on-write proxy for
|
|
6
|
+
* Create a copy-on-write proxy for a plain object.
|
|
7
|
+
*
|
|
8
|
+
* @dev Arrays and other exotic objects are not supported. The proxy target
|
|
9
|
+
* is a `CopyOnWriteTarget`, not `obj`, so the proxy invariants break for
|
|
10
|
+
* non-configurable properties such as `Array.length`:
|
|
11
|
+
* `Object.keys()` and spread throw a `TypeError`, and `Array.isArray()`
|
|
12
|
+
* returns `false`.
|
|
7
13
|
*/
|
|
8
|
-
export declare const copyOnWrite: <T extends
|
|
14
|
+
export declare const copyOnWrite: <T extends {
|
|
15
|
+
[key: string]: unknown;
|
|
16
|
+
}>(obj: T) => T;
|
|
9
17
|
/**
|
|
10
18
|
* Create a deep copy of an object.
|
|
11
19
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../src/utils/copy.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,aAAa,eAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../src/utils/copy.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,aAAa,eAAmC,CAAC;AA0E9D;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW;;QACjB,CAAC,KACL,CAKF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,IAAI,WAAY,CAAC,QAAQ,OAAO,KAAG,CAoC/C,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decodeEventLog.d.ts","sourceRoot":"","sources":["../../../src/utils/decodeEventLog.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EAKb,KAAK,GAAG,EACT,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"decodeEventLog.d.ts","sourceRoot":"","sources":["../../../src/utils/decodeEventLog.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,QAAQ,EAKb,KAAK,GAAG,EACT,MAAM,MAAM,CAAC;AAgCd;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,MAAM,EACN,IAAI,GACL,EAAE;IACD,OAAO,EAAE,QAAQ,CAAC;IAClB,MAAM,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,CAAC,GAAG,EAAE,CAAC;IAC9C,IAAI,EAAE,GAAG,CAAC;CACX,GAAG,GAAG,CAuDN"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ponder",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "An open-source TypeScript framework for EVM data indexing",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"@escape.tech/graphql-armor-max-depth": "^2.2.0",
|
|
56
56
|
"@escape.tech/graphql-armor-max-tokens": "^2.3.0",
|
|
57
57
|
"@hono/node-server": "1.19.5",
|
|
58
|
+
"@ponder/utils": "0.3.0",
|
|
58
59
|
"abitype": "^0.10.2",
|
|
59
60
|
"ansi-escapes": "^7.0.0",
|
|
60
61
|
"commander": "^12.0.0",
|
|
@@ -76,11 +77,11 @@
|
|
|
76
77
|
"superjson": "^2.2.2",
|
|
77
78
|
"terminal-size": "^4.0.0",
|
|
78
79
|
"vite": "8.3.1",
|
|
79
|
-
"ws": "^8.18.3"
|
|
80
|
-
"@ponder/utils": "0.3.0"
|
|
80
|
+
"ws": "^8.18.3"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
83
|
"@pgsql/types": "16.0.0",
|
|
84
|
+
"@ponder/client": "0.18.2",
|
|
84
85
|
"@types/babel__code-frame": "^7.0.6",
|
|
85
86
|
"@types/glob": "^8.1.0",
|
|
86
87
|
"@types/node": "^22.0.0",
|
|
@@ -95,8 +96,7 @@
|
|
|
95
96
|
"mitata": "^1.0.34",
|
|
96
97
|
"rimraf": "^5.0.5",
|
|
97
98
|
"tsx": "^4.19.2",
|
|
98
|
-
"vitest": "5.0.2"
|
|
99
|
-
"@ponder/client": "0.18.0"
|
|
99
|
+
"vitest": "5.0.2"
|
|
100
100
|
},
|
|
101
101
|
"engines": {
|
|
102
102
|
"node": ">=22.12"
|
|
@@ -352,7 +352,8 @@ export const createIndexingStore = ({
|
|
|
352
352
|
primaryKeyCache,
|
|
353
353
|
);
|
|
354
354
|
normalizeUpdateSet(table, ponderSet);
|
|
355
|
-
for (const
|
|
355
|
+
for (const key in ponderSet) {
|
|
356
|
+
const value = ponderSet[key];
|
|
356
357
|
if (value === undefined) continue;
|
|
357
358
|
ponderRowUpdate[key] = value;
|
|
358
359
|
}
|
|
@@ -366,7 +367,8 @@ export const createIndexingStore = ({
|
|
|
366
367
|
primaryKeyCache,
|
|
367
368
|
);
|
|
368
369
|
normalizeUpdateSet(table, ponderSet);
|
|
369
|
-
for (const
|
|
370
|
+
for (const key in ponderSet) {
|
|
371
|
+
const value = ponderSet[key];
|
|
370
372
|
if (value === undefined) continue;
|
|
371
373
|
ponderRowUpdate[key] = value;
|
|
372
374
|
}
|
|
@@ -550,7 +552,8 @@ export const createIndexingStore = ({
|
|
|
550
552
|
primaryKeyCache,
|
|
551
553
|
);
|
|
552
554
|
normalizeUpdateSet(table, ponderSet);
|
|
553
|
-
for (const
|
|
555
|
+
for (const key in ponderSet) {
|
|
556
|
+
const value = ponderSet[key];
|
|
554
557
|
if (value === undefined) continue;
|
|
555
558
|
ponderRowUpdate[key] = value;
|
|
556
559
|
}
|
|
@@ -564,7 +567,8 @@ export const createIndexingStore = ({
|
|
|
564
567
|
primaryKeyCache,
|
|
565
568
|
);
|
|
566
569
|
normalizeUpdateSet(table, ponderSet);
|
|
567
|
-
for (const
|
|
570
|
+
for (const key in ponderSet) {
|
|
571
|
+
const value = ponderSet[key];
|
|
568
572
|
if (value === undefined) continue;
|
|
569
573
|
ponderRowUpdate[key] = value;
|
|
570
574
|
}
|
|
@@ -147,7 +147,9 @@ export const normalizeUpdateSet = (
|
|
|
147
147
|
row: { [key: string]: unknown },
|
|
148
148
|
) => {
|
|
149
149
|
const { columns } = getCachedTableColumns(table);
|
|
150
|
-
|
|
150
|
+
// Note: `row` is a plain object, so `for...in` only visits own keys.
|
|
151
|
+
for (const columnName in row) {
|
|
152
|
+
const value = row[columnName];
|
|
151
153
|
const column = columns[columnName];
|
|
152
154
|
if (value === undefined || column === undefined) continue;
|
|
153
155
|
row[columnName] = normalizeColumn(column, value, true);
|
package/src/rpc/actions.ts
CHANGED
|
@@ -30,7 +30,7 @@ import { zeroLogsBloom } from "@/sync-realtime/bloom.js";
|
|
|
30
30
|
import { chunk } from "@/utils/chunk.js";
|
|
31
31
|
import { PG_BIGINT_MAX, PG_INTEGER_MAX } from "@/utils/pg.js";
|
|
32
32
|
|
|
33
|
-
const ADDRESS_CHUNK_SIZE = 50;
|
|
33
|
+
export const ADDRESS_CHUNK_SIZE = 50;
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Helper function for "eth_getBlockByNumber" request.
|
|
@@ -503,8 +503,6 @@ export const validateTransactionsAndBlock = (
|
|
|
503
503
|
* Validate that the logs are consistent with the block.
|
|
504
504
|
*
|
|
505
505
|
* @dev Allows `log.transactionHash` to be `zeroHash`.
|
|
506
|
-
* @dev Allows `block.logsBloom` to be `zeroLogsBloom`.
|
|
507
|
-
* @dev Skips bloom validation on async-execution chains.
|
|
508
506
|
*/
|
|
509
507
|
export const validateLogsAndBlock = (
|
|
510
508
|
logs: SyncLog[],
|
|
@@ -514,25 +512,7 @@ export const validateLogsAndBlock = (
|
|
|
514
512
|
RequestParameters,
|
|
515
513
|
{ method: "eth_getBlockByNumber" | "eth_getBlockByHash" }
|
|
516
514
|
>,
|
|
517
|
-
isAsyncExecutionChain: boolean,
|
|
518
515
|
) => {
|
|
519
|
-
if (
|
|
520
|
-
isAsyncExecutionChain === false &&
|
|
521
|
-
block.logsBloom !== zeroLogsBloom &&
|
|
522
|
-
logs.length === 0
|
|
523
|
-
) {
|
|
524
|
-
const error = new RpcProviderError(
|
|
525
|
-
`Inconsistent RPC response data. The logs array has length 0, but the associated block has a non-empty 'block.logsBloom'.`,
|
|
526
|
-
);
|
|
527
|
-
error.meta = [
|
|
528
|
-
"Please report this error to the RPC operator.",
|
|
529
|
-
requestText(blockRequest),
|
|
530
|
-
requestText(logsRequest),
|
|
531
|
-
];
|
|
532
|
-
error.stack = undefined;
|
|
533
|
-
throw error;
|
|
534
|
-
}
|
|
535
|
-
|
|
536
516
|
const transactionByIndex = new Map<Hex, SyncTransaction>(
|
|
537
517
|
block.transactions.map((transaction) => [
|
|
538
518
|
transaction.transactionIndex,
|
package/src/runtime/filter.ts
CHANGED
|
@@ -23,6 +23,7 @@ import type {
|
|
|
23
23
|
TransactionFilter,
|
|
24
24
|
TransferFilter,
|
|
25
25
|
} from "@/internal/types.js";
|
|
26
|
+
import { ADDRESS_CHUNK_SIZE } from "@/rpc/actions.js";
|
|
26
27
|
import { type RequestParameters, sanitizeLogTopics } from "@/rpc/index.js";
|
|
27
28
|
import type { ChildAddresses, IntervalWithFilter } from "@/runtime/index.js";
|
|
28
29
|
import type {
|
|
@@ -222,6 +223,101 @@ export const mergeLogFiltersToRequests = (
|
|
|
222
223
|
return requests;
|
|
223
224
|
};
|
|
224
225
|
|
|
226
|
+
/** `address` and `topics` for an "eth_getLogs" request for one block. */
|
|
227
|
+
export type BlockLogsRequestFilter = {
|
|
228
|
+
address: Address[] | undefined;
|
|
229
|
+
topics: (Hex[] | null)[] | undefined;
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
const toLogFilterValues = (
|
|
233
|
+
value: Hex | Hex[] | null | undefined,
|
|
234
|
+
): Hex[] | undefined => {
|
|
235
|
+
if (value === null || value === undefined) return undefined;
|
|
236
|
+
return Array.isArray(value) ? value : [value];
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Convert `values` to a request value. A list with more than
|
|
241
|
+
* `ADDRESS_CHUNK_SIZE` values matches all values, so that `eth_getLogs`
|
|
242
|
+
* sends exactly one request.
|
|
243
|
+
*/
|
|
244
|
+
const fromLogFilterValues = (values: Hex[] | undefined): Hex[] | null => {
|
|
245
|
+
if (values === undefined || values.length > ADDRESS_CHUNK_SIZE) return null;
|
|
246
|
+
return values;
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Merge `LogFilter`s and `Factory`s into the `address` and `topics` of one
|
|
251
|
+
* "eth_getLogs" request for one block. The request matches a superset of the
|
|
252
|
+
* logs that `logFilters` and `factories` require. Returns `undefined` if no
|
|
253
|
+
* logs are required.
|
|
254
|
+
*
|
|
255
|
+
* @dev A log filter with a factory address matches all addresses, because child
|
|
256
|
+
* addresses created in the same block are not known before the request.
|
|
257
|
+
*
|
|
258
|
+
* @dev Each dimension is the union of all inputs, so the result can match logs
|
|
259
|
+
* that no single input matches. Logs must be filtered again after the request.
|
|
260
|
+
*
|
|
261
|
+
* @dev A dimension with more than `ADDRESS_CHUNK_SIZE` values matches all values.
|
|
262
|
+
*/
|
|
263
|
+
export const mergeLogFiltersToBlockRequest = ({
|
|
264
|
+
logFilters,
|
|
265
|
+
factories,
|
|
266
|
+
}: {
|
|
267
|
+
logFilters: LogFilter[];
|
|
268
|
+
factories: Factory[];
|
|
269
|
+
}): BlockLogsRequestFilter | undefined => {
|
|
270
|
+
let address: Hex[] | undefined = [];
|
|
271
|
+
let topics: (Hex[] | undefined)[] = [[], [], [], []];
|
|
272
|
+
let isEmpty = true;
|
|
273
|
+
|
|
274
|
+
const add = (
|
|
275
|
+
inputAddress: Hex[] | undefined,
|
|
276
|
+
inputTopics: (Hex[] | undefined)[],
|
|
277
|
+
) => {
|
|
278
|
+
isEmpty = false;
|
|
279
|
+
address = mergeLogFilterValue(address, inputAddress);
|
|
280
|
+
topics = topics.map((values, i) =>
|
|
281
|
+
mergeLogFilterValue(values, inputTopics[i]),
|
|
282
|
+
);
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
for (const filter of logFilters) {
|
|
286
|
+
if (Array.isArray(filter.address) && filter.address.length === 0) continue;
|
|
287
|
+
|
|
288
|
+
add(
|
|
289
|
+
isAddressFactory(filter.address)
|
|
290
|
+
? undefined
|
|
291
|
+
: toLogFilterValues(filter.address),
|
|
292
|
+
[filter.topic0, filter.topic1, filter.topic2, filter.topic3].map(
|
|
293
|
+
toLogFilterValues,
|
|
294
|
+
),
|
|
295
|
+
);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
for (const factory of factories) {
|
|
299
|
+
if (Array.isArray(factory.address) && factory.address.length === 0) {
|
|
300
|
+
continue;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
add(toLogFilterValues(factory.address), [
|
|
304
|
+
[factory.eventSelector],
|
|
305
|
+
undefined,
|
|
306
|
+
undefined,
|
|
307
|
+
undefined,
|
|
308
|
+
]);
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
if (isEmpty) return undefined;
|
|
312
|
+
|
|
313
|
+
const requestTopics = sanitizeLogTopics(topics.map(fromLogFilterValues));
|
|
314
|
+
|
|
315
|
+
return {
|
|
316
|
+
address: fromLogFilterValues(address) ?? undefined,
|
|
317
|
+
topics: requestTopics.length === 0 ? undefined : requestTopics,
|
|
318
|
+
};
|
|
319
|
+
};
|
|
320
|
+
|
|
225
321
|
export const getChildAddress = ({
|
|
226
322
|
log,
|
|
227
323
|
factory,
|
|
@@ -260,14 +356,8 @@ export const isAddressMatched = ({
|
|
|
260
356
|
childAddresses: Map<Address, number>;
|
|
261
357
|
}) => {
|
|
262
358
|
if (address === undefined) return false;
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
childAddresses.get(toLowerCase(address))! <= blockNumber
|
|
266
|
-
) {
|
|
267
|
-
return true;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
return false;
|
|
359
|
+
const childBlockNumber = childAddresses.get(toLowerCase(address));
|
|
360
|
+
return childBlockNumber !== undefined && childBlockNumber <= blockNumber;
|
|
271
361
|
};
|
|
272
362
|
|
|
273
363
|
const isValueMatched = <T extends string>(
|
|
@@ -280,18 +370,18 @@ const isValueMatched = <T extends string>(
|
|
|
280
370
|
// missing value
|
|
281
371
|
if (eventValue === undefined) return false;
|
|
282
372
|
|
|
373
|
+
// Note: `filterValue` is lowercase, so an exact match avoids allocating
|
|
374
|
+
// a lowercase copy of `eventValue`.
|
|
375
|
+
if (filterValue === eventValue) return true;
|
|
376
|
+
|
|
377
|
+
const value = toLowerCase(eventValue);
|
|
378
|
+
|
|
283
379
|
// array
|
|
284
|
-
if (
|
|
285
|
-
|
|
286
|
-
filterValue.some((v) => v === toLowerCase(eventValue))
|
|
287
|
-
) {
|
|
288
|
-
return true;
|
|
289
|
-
}
|
|
380
|
+
if (Array.isArray(filterValue))
|
|
381
|
+
return (filterValue as string[]).includes(value);
|
|
290
382
|
|
|
291
383
|
// single
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
return false;
|
|
384
|
+
return filterValue === value;
|
|
295
385
|
};
|
|
296
386
|
|
|
297
387
|
/**
|
|
@@ -343,13 +433,7 @@ export const isLogFilterMatched = ({
|
|
|
343
433
|
filter: LogFilter;
|
|
344
434
|
log: InternalLog | SyncLog;
|
|
345
435
|
}): boolean => {
|
|
346
|
-
|
|
347
|
-
if (
|
|
348
|
-
Number(log.blockNumber) < (filter.fromBlock ?? 0) ||
|
|
349
|
-
Number(log.blockNumber) > (filter.toBlock ?? Number.POSITIVE_INFINITY)
|
|
350
|
-
) {
|
|
351
|
-
return false;
|
|
352
|
-
}
|
|
436
|
+
if (isBlockInFilter(filter, Number(log.blockNumber)) === false) return false;
|
|
353
437
|
|
|
354
438
|
if (isValueMatched(filter.topic0, log.topics[0]) === false) return false;
|
|
355
439
|
if (isValueMatched(filter.topic1, log.topics[1]) === false) return false;
|
|
@@ -379,12 +463,7 @@ export const isTransactionFilterMatched = ({
|
|
|
379
463
|
filter: TransactionFilter;
|
|
380
464
|
transaction: InternalTransaction | SyncTransaction;
|
|
381
465
|
}): boolean => {
|
|
382
|
-
|
|
383
|
-
if (
|
|
384
|
-
Number(transaction.blockNumber) < (filter.fromBlock ?? 0) ||
|
|
385
|
-
Number(transaction.blockNumber) >
|
|
386
|
-
(filter.toBlock ?? Number.POSITIVE_INFINITY)
|
|
387
|
-
) {
|
|
466
|
+
if (isBlockInFilter(filter, Number(transaction.blockNumber)) === false) {
|
|
388
467
|
return false;
|
|
389
468
|
}
|
|
390
469
|
|
|
@@ -423,13 +502,7 @@ export const isTraceFilterMatched = ({
|
|
|
423
502
|
trace: InternalTrace | SyncTrace["trace"];
|
|
424
503
|
block: Pick<InternalBlock | SyncBlock, "number">;
|
|
425
504
|
}): boolean => {
|
|
426
|
-
|
|
427
|
-
if (
|
|
428
|
-
Number(block.number) < (filter.fromBlock ?? 0) ||
|
|
429
|
-
Number(block.number) > (filter.toBlock ?? Number.POSITIVE_INFINITY)
|
|
430
|
-
) {
|
|
431
|
-
return false;
|
|
432
|
-
}
|
|
505
|
+
if (isBlockInFilter(filter, Number(block.number)) === false) return false;
|
|
433
506
|
|
|
434
507
|
if (
|
|
435
508
|
isAddressFactory(filter.fromAddress) === false &&
|
|
@@ -476,13 +549,7 @@ export const isTransferFilterMatched = ({
|
|
|
476
549
|
trace: InternalTrace | SyncTrace["trace"];
|
|
477
550
|
block: Pick<InternalBlock | SyncBlock, "number">;
|
|
478
551
|
}): boolean => {
|
|
479
|
-
|
|
480
|
-
if (
|
|
481
|
-
Number(block.number) < (filter.fromBlock ?? 0) ||
|
|
482
|
-
Number(block.number) > (filter.toBlock ?? Number.POSITIVE_INFINITY)
|
|
483
|
-
) {
|
|
484
|
-
return false;
|
|
485
|
-
}
|
|
552
|
+
if (isBlockInFilter(filter, Number(block.number)) === false) return false;
|
|
486
553
|
|
|
487
554
|
if (
|
|
488
555
|
trace.value === undefined ||
|
|
@@ -531,13 +598,7 @@ export const isBlockFilterMatched = ({
|
|
|
531
598
|
filter: BlockFilter;
|
|
532
599
|
block: Pick<InternalBlock | SyncBlock | SyncBlockHeader, "number">;
|
|
533
600
|
}): boolean => {
|
|
534
|
-
|
|
535
|
-
if (
|
|
536
|
-
Number(block.number) < (filter.fromBlock ?? 0) ||
|
|
537
|
-
Number(block.number) > (filter.toBlock ?? Number.POSITIVE_INFINITY)
|
|
538
|
-
) {
|
|
539
|
-
return false;
|
|
540
|
-
}
|
|
601
|
+
if (isBlockInFilter(filter, Number(block.number)) === false) return false;
|
|
541
602
|
|
|
542
603
|
return (Number(block.number) - filter.offset) % filter.interval === 0;
|
|
543
604
|
};
|
|
@@ -614,7 +675,10 @@ export const getFilterToBlock = (filter: Filter): number => {
|
|
|
614
675
|
return Math.max(...blocks);
|
|
615
676
|
};
|
|
616
677
|
|
|
617
|
-
export const isBlockInFilter = (
|
|
678
|
+
export const isBlockInFilter = (
|
|
679
|
+
filter: Filter | Factory,
|
|
680
|
+
blockNumber: number,
|
|
681
|
+
) => {
|
|
618
682
|
// Return `false` for out of range blocks
|
|
619
683
|
if (
|
|
620
684
|
blockNumber < (filter.fromBlock ?? 0) ||
|
|
@@ -53,7 +53,6 @@ import type {
|
|
|
53
53
|
IntervalWithFilter,
|
|
54
54
|
} from "@/runtime/index.js";
|
|
55
55
|
import type { SyncStore } from "@/sync-store/index.js";
|
|
56
|
-
import { isAsyncExecutionChain } from "@/utils/finality.js";
|
|
57
56
|
import { drainAsyncGenerator } from "@/utils/generators.js";
|
|
58
57
|
import { type Interval, intervalBounds } from "@/utils/interval.js";
|
|
59
58
|
import { startClock } from "@/utils/timer.js";
|
|
@@ -487,7 +486,6 @@ export function createInMemoryHistoricalSync(params: {
|
|
|
487
486
|
method: "eth_getBlockByNumber",
|
|
488
487
|
params: [toHex(blockNumber), true],
|
|
489
488
|
},
|
|
490
|
-
isAsyncExecutionChain(params.chain.id),
|
|
491
489
|
);
|
|
492
490
|
}
|
|
493
491
|
}
|
|
@@ -56,7 +56,6 @@ import type {
|
|
|
56
56
|
} from "@/runtime/index.js";
|
|
57
57
|
import type { SyncStore } from "@/sync-store/index.js";
|
|
58
58
|
import { dedupe } from "@/utils/dedupe.js";
|
|
59
|
-
import { isAsyncExecutionChain } from "@/utils/finality.js";
|
|
60
59
|
import {
|
|
61
60
|
getChunks,
|
|
62
61
|
type Interval,
|
|
@@ -557,7 +556,6 @@ export const createHistoricalSync = (
|
|
|
557
556
|
method: "eth_getBlockByNumber",
|
|
558
557
|
params: [toHex(blockNumber), true],
|
|
559
558
|
},
|
|
560
|
-
isAsyncExecutionChain(args.chain.id),
|
|
561
559
|
);
|
|
562
560
|
}
|
|
563
561
|
}
|