ponder 0.16.9 → 0.17.0
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 +29 -0
- package/dist/esm/bin/commands/codegen.js +3 -12
- package/dist/esm/bin/commands/codegen.js.map +1 -1
- package/dist/esm/bin/commands/createViews.js +2 -5
- package/dist/esm/bin/commands/createViews.js.map +1 -1
- package/dist/esm/bin/commands/dev.js +4 -22
- package/dist/esm/bin/commands/dev.js.map +1 -1
- package/dist/esm/bin/commands/list.js +4 -8
- package/dist/esm/bin/commands/list.js.map +1 -1
- package/dist/esm/bin/commands/prune.js +4 -8
- package/dist/esm/bin/commands/prune.js.map +1 -1
- package/dist/esm/bin/commands/serve.js +5 -20
- package/dist/esm/bin/commands/serve.js.map +1 -1
- package/dist/esm/bin/commands/start.js +4 -20
- package/dist/esm/bin/commands/start.js.map +1 -1
- package/dist/esm/bin/isolatedController.js +3 -3
- package/dist/esm/bin/isolatedController.js.map +1 -1
- package/dist/esm/bin/isolatedWorker.js +0 -5
- package/dist/esm/bin/isolatedWorker.js.map +1 -1
- package/dist/esm/bin/ponder.js.map +1 -1
- package/dist/esm/bin/utils/exit.js +1 -5
- package/dist/esm/bin/utils/exit.js.map +1 -1
- package/dist/esm/build/config.js +2 -2
- package/dist/esm/build/config.js.map +1 -1
- package/dist/esm/build/factory.js +1 -1
- package/dist/esm/build/factory.js.map +1 -1
- package/dist/esm/build/index.js +17 -14
- package/dist/esm/build/index.js.map +1 -1
- package/dist/esm/build/pre.js +2 -2
- package/dist/esm/build/pre.js.map +1 -1
- package/dist/esm/build/schema.js +2 -2
- package/dist/esm/build/schema.js.map +1 -1
- package/dist/esm/build/stacktrace.js +5 -5
- package/dist/esm/build/stacktrace.js.map +1 -1
- package/dist/esm/client/index.js +8 -9
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/database/actions.js +7 -9
- package/dist/esm/database/actions.js.map +1 -1
- package/dist/esm/database/index.js +7 -7
- package/dist/esm/database/index.js.map +1 -1
- package/dist/esm/database/queryBuilder.js +4 -7
- package/dist/esm/database/queryBuilder.js.map +1 -1
- package/dist/esm/drizzle/bigint.js +3 -5
- package/dist/esm/drizzle/bigint.js.map +1 -1
- package/dist/esm/drizzle/bytes.js +3 -5
- package/dist/esm/drizzle/bytes.js.map +1 -1
- package/dist/esm/drizzle/hex.js +3 -5
- package/dist/esm/drizzle/hex.js.map +1 -1
- package/dist/esm/drizzle/index.js.map +1 -1
- package/dist/esm/drizzle/json.js +8 -12
- package/dist/esm/drizzle/json.js.map +1 -1
- package/dist/esm/drizzle/kit/index.js +24 -38
- package/dist/esm/drizzle/kit/index.js.map +1 -1
- package/dist/esm/drizzle/onchain.js +15 -17
- package/dist/esm/drizzle/onchain.js.map +1 -1
- package/dist/esm/drizzle/text.js +3 -5
- package/dist/esm/drizzle/text.js.map +1 -1
- package/dist/esm/graphql/index.js +6 -6
- package/dist/esm/graphql/index.js.map +1 -1
- package/dist/esm/graphql/json.js.map +1 -1
- package/dist/esm/graphql/middleware.js +2 -2
- package/dist/esm/graphql/middleware.js.map +1 -1
- package/dist/esm/index.js +5 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/indexing/addStackTrace.js +1 -1
- package/dist/esm/indexing/addStackTrace.js.map +1 -1
- package/dist/esm/indexing/client.js +11 -12
- package/dist/esm/indexing/client.js.map +1 -1
- package/dist/esm/indexing/index.js +6 -4
- package/dist/esm/indexing/index.js.map +1 -1
- package/dist/esm/indexing/profile.js +2 -2
- package/dist/esm/indexing/profile.js.map +1 -1
- package/dist/esm/indexing-store/cache.js +4 -4
- package/dist/esm/indexing-store/cache.js.map +1 -1
- package/dist/esm/indexing-store/index.js +10 -13
- package/dist/esm/indexing-store/index.js.map +1 -1
- package/dist/esm/indexing-store/profile.js +3 -3
- package/dist/esm/indexing-store/profile.js.map +1 -1
- package/dist/esm/indexing-store/utils.js +3 -3
- package/dist/esm/indexing-store/utils.js.map +1 -1
- package/dist/esm/internal/logger.js +7 -7
- package/dist/esm/internal/logger.js.map +1 -1
- package/dist/esm/internal/metrics.js +15 -15
- package/dist/esm/internal/metrics.js.map +1 -1
- package/dist/esm/internal/options.js +6 -9
- package/dist/esm/internal/options.js.map +1 -1
- package/dist/esm/internal/shutdown.js.map +1 -1
- package/dist/esm/rpc/actions.js +7 -8
- package/dist/esm/rpc/actions.js.map +1 -1
- package/dist/esm/rpc/http.js +8 -4
- package/dist/esm/rpc/http.js.map +1 -1
- package/dist/esm/rpc/index.js +19 -19
- package/dist/esm/rpc/index.js.map +1 -1
- package/dist/esm/runtime/events.js +7 -9
- package/dist/esm/runtime/events.js.map +1 -1
- package/dist/esm/runtime/filter.js +1 -1
- package/dist/esm/runtime/filter.js.map +1 -1
- package/dist/esm/runtime/fragments.js.map +1 -1
- package/dist/esm/runtime/historical.js +7 -7
- package/dist/esm/runtime/historical.js.map +1 -1
- package/dist/esm/runtime/index.js +2 -2
- package/dist/esm/runtime/index.js.map +1 -1
- package/dist/esm/runtime/isolated.js +18 -11
- package/dist/esm/runtime/isolated.js.map +1 -1
- package/dist/esm/runtime/multichain.js +19 -12
- package/dist/esm/runtime/multichain.js.map +1 -1
- package/dist/esm/runtime/omnichain.js +19 -12
- package/dist/esm/runtime/omnichain.js.map +1 -1
- package/dist/esm/runtime/realtime.js +12 -12
- package/dist/esm/runtime/realtime.js.map +1 -1
- package/dist/esm/server/error.js +1 -1
- package/dist/esm/server/error.js.map +1 -1
- package/dist/esm/server/index.js +4 -4
- package/dist/esm/server/index.js.map +1 -1
- package/dist/esm/sync-historical/index.js +2 -2
- package/dist/esm/sync-historical/index.js.map +1 -1
- package/dist/esm/sync-realtime/bloom.js +1 -1
- package/dist/esm/sync-realtime/bloom.js.map +1 -1
- package/dist/esm/sync-realtime/index.js +1 -1
- package/dist/esm/sync-realtime/index.js.map +1 -1
- package/dist/esm/sync-store/encode.js +1 -1
- package/dist/esm/sync-store/encode.js.map +1 -1
- package/dist/esm/sync-store/index.js +12 -31
- package/dist/esm/sync-store/index.js.map +1 -1
- package/dist/esm/sync-store/migrations.js +1 -1
- package/dist/esm/sync-store/migrations.js.map +1 -1
- package/dist/esm/sync-store/schema.js +2 -2
- package/dist/esm/sync-store/schema.js.map +1 -1
- package/dist/esm/types/db.js.map +1 -1
- package/dist/esm/ui/app.js +2 -2
- package/dist/esm/ui/app.js.map +1 -1
- package/dist/esm/ui/patch.js +1 -2
- package/dist/esm/ui/patch.js.map +1 -1
- package/dist/esm/utils/abi.js +1 -1
- package/dist/esm/utils/abi.js.map +1 -1
- package/dist/esm/utils/bigint.js.map +1 -1
- package/dist/esm/utils/checkpoint.js.map +1 -1
- package/dist/esm/utils/chunk.js.map +1 -1
- package/dist/esm/utils/copy.js +1 -1
- package/dist/esm/utils/copy.js.map +1 -1
- package/dist/esm/utils/decodeAbiParameters.js +2 -3
- package/dist/esm/utils/decodeAbiParameters.js.map +1 -1
- package/dist/esm/utils/decodeEventLog.js.map +1 -1
- package/dist/esm/utils/duplicates.js.map +1 -1
- package/dist/esm/utils/finality.js.map +1 -1
- package/dist/esm/utils/generators.js.map +1 -1
- package/dist/esm/utils/interval.js.map +1 -1
- package/dist/esm/utils/mutex.js.map +1 -1
- package/dist/esm/utils/offset.js.map +1 -1
- package/dist/esm/utils/order.js.map +1 -1
- package/dist/esm/utils/partition.js.map +1 -1
- package/dist/esm/utils/pg.js +2 -2
- package/dist/esm/utils/pg.js.map +1 -1
- package/dist/esm/utils/pglite.js +4 -6
- package/dist/esm/utils/pglite.js.map +1 -1
- package/dist/esm/utils/port.js.map +1 -1
- package/dist/esm/utils/promiseAllSettledWithThrow.js.map +1 -1
- package/dist/esm/utils/queue.js +7 -7
- package/dist/esm/utils/queue.js.map +1 -1
- package/dist/esm/utils/result.js +1 -1
- package/dist/esm/utils/result.js.map +1 -1
- package/dist/esm/utils/sql-parse.js +10 -10
- package/dist/esm/utils/sql-parse.js.map +1 -1
- package/dist/esm/utils/zipper.js.map +1 -1
- package/dist/types/bin/commands/codegen.d.ts.map +1 -1
- package/dist/types/bin/commands/createViews.d.ts.map +1 -1
- package/dist/types/bin/commands/dev.d.ts.map +1 -1
- package/dist/types/bin/commands/list.d.ts.map +1 -1
- package/dist/types/bin/commands/prune.d.ts.map +1 -1
- package/dist/types/bin/commands/serve.d.ts.map +1 -1
- package/dist/types/bin/commands/start.d.ts.map +1 -1
- package/dist/types/bin/isolatedController.d.ts.map +1 -1
- package/dist/types/bin/isolatedWorker.d.ts.map +1 -1
- package/dist/types/bin/ponder.d.ts +1 -1
- package/dist/types/bin/ponder.d.ts.map +1 -1
- package/dist/types/bin/utils/exit.d.ts +1 -1
- package/dist/types/bin/utils/exit.d.ts.map +1 -1
- package/dist/types/build/config.d.ts +1 -1
- package/dist/types/build/config.d.ts.map +1 -1
- package/dist/types/build/factory.d.ts.map +1 -1
- package/dist/types/build/index.d.ts +1 -1
- package/dist/types/build/index.d.ts.map +1 -1
- package/dist/types/build/plugin.d.ts +1 -1
- package/dist/types/build/plugin.d.ts.map +1 -1
- package/dist/types/build/schema.d.ts.map +1 -1
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/config/address.d.ts +1 -1
- package/dist/types/config/address.d.ts.map +1 -1
- package/dist/types/config/index.d.ts +6 -6
- package/dist/types/config/index.d.ts.map +1 -1
- package/dist/types/database/actions.d.ts +5 -5
- package/dist/types/database/actions.d.ts.map +1 -1
- package/dist/types/database/index.d.ts +2 -2
- package/dist/types/database/index.d.ts.map +1 -1
- package/dist/types/database/queryBuilder.d.ts +4 -4
- package/dist/types/database/queryBuilder.d.ts.map +1 -1
- package/dist/types/drizzle/bigint.d.ts +1 -1
- package/dist/types/drizzle/bigint.d.ts.map +1 -1
- package/dist/types/drizzle/bytes.d.ts +2 -1
- package/dist/types/drizzle/bytes.d.ts.map +1 -1
- package/dist/types/drizzle/hex.d.ts +1 -1
- package/dist/types/drizzle/hex.d.ts.map +1 -1
- package/dist/types/drizzle/index.d.ts.map +1 -1
- package/dist/types/drizzle/json.d.ts.map +1 -1
- package/dist/types/drizzle/kit/index.d.ts.map +1 -1
- package/dist/types/drizzle/onchain.d.ts +1 -1
- package/dist/types/drizzle/onchain.d.ts.map +1 -1
- package/dist/types/drizzle/text.d.ts +1 -1
- package/dist/types/drizzle/text.d.ts.map +1 -1
- package/dist/types/graphql/index.d.ts +2 -2
- package/dist/types/graphql/index.d.ts.map +1 -1
- package/dist/types/graphql/middleware.d.ts +3 -3
- package/dist/types/graphql/middleware.d.ts.map +1 -1
- package/dist/types/index.d.ts +11 -11
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/indexing/addStackTrace.d.ts.map +1 -1
- package/dist/types/indexing/client.d.ts +2 -3
- package/dist/types/indexing/client.d.ts.map +1 -1
- package/dist/types/indexing/index.d.ts +2 -2
- package/dist/types/indexing/index.d.ts.map +1 -1
- package/dist/types/indexing/profile.d.ts.map +1 -1
- package/dist/types/indexing-store/cache.d.ts +2 -2
- package/dist/types/indexing-store/cache.d.ts.map +1 -1
- package/dist/types/indexing-store/index.d.ts +3 -4
- package/dist/types/indexing-store/index.d.ts.map +1 -1
- package/dist/types/indexing-store/profile.d.ts +1 -1
- package/dist/types/indexing-store/profile.d.ts.map +1 -1
- package/dist/types/indexing-store/utils.d.ts.map +1 -1
- package/dist/types/internal/common.d.ts +0 -2
- package/dist/types/internal/common.d.ts.map +1 -1
- package/dist/types/internal/logger.d.ts +1 -1
- package/dist/types/internal/logger.d.ts.map +1 -1
- package/dist/types/internal/metrics.d.ts +1 -1
- package/dist/types/internal/metrics.d.ts.map +1 -1
- package/dist/types/internal/options.d.ts +1 -7
- package/dist/types/internal/options.d.ts.map +1 -1
- package/dist/types/internal/types.d.ts +4 -4
- package/dist/types/internal/types.d.ts.map +1 -1
- package/dist/types/rpc/actions.d.ts.map +1 -1
- package/dist/types/rpc/http.d.ts +1 -1
- package/dist/types/rpc/http.d.ts.map +1 -1
- package/dist/types/rpc/index.d.ts +2 -2
- package/dist/types/rpc/index.d.ts.map +1 -1
- package/dist/types/runtime/events.d.ts +1 -1
- package/dist/types/runtime/events.d.ts.map +1 -1
- package/dist/types/runtime/filter.d.ts +1 -1
- package/dist/types/runtime/filter.d.ts.map +1 -1
- package/dist/types/runtime/fragments.d.ts +1 -1
- package/dist/types/runtime/fragments.d.ts.map +1 -1
- package/dist/types/runtime/historical.d.ts.map +1 -1
- package/dist/types/runtime/index.d.ts +2 -3
- package/dist/types/runtime/index.d.ts.map +1 -1
- package/dist/types/runtime/isolated.d.ts.map +1 -1
- package/dist/types/runtime/multichain.d.ts.map +1 -1
- package/dist/types/runtime/omnichain.d.ts.map +1 -1
- package/dist/types/runtime/realtime.d.ts.map +1 -1
- package/dist/types/server/error.d.ts +1 -1
- package/dist/types/server/error.d.ts.map +1 -1
- package/dist/types/server/index.d.ts +1 -1
- package/dist/types/server/index.d.ts.map +1 -1
- package/dist/types/sync-historical/index.d.ts +1 -1
- package/dist/types/sync-historical/index.d.ts.map +1 -1
- package/dist/types/sync-realtime/bloom.d.ts +1 -1
- package/dist/types/sync-realtime/bloom.d.ts.map +1 -1
- package/dist/types/sync-realtime/index.d.ts +1 -1
- package/dist/types/sync-realtime/index.d.ts.map +1 -1
- package/dist/types/sync-store/encode.d.ts.map +1 -1
- package/dist/types/sync-store/index.d.ts +2 -2
- package/dist/types/sync-store/index.d.ts.map +1 -1
- package/dist/types/sync-store/migrations.d.ts +1 -1
- package/dist/types/sync-store/migrations.d.ts.map +1 -1
- package/dist/types/sync-store/schema.d.ts +2 -2
- package/dist/types/sync-store/schema.d.ts.map +1 -1
- package/dist/types/types/db.d.ts +3 -3
- package/dist/types/types/db.d.ts.map +1 -1
- package/dist/types/ui/app.d.ts +3 -3
- package/dist/types/ui/app.d.ts.map +1 -1
- package/dist/types/ui/patch.d.ts.map +1 -1
- package/dist/types/utils/abi.d.ts.map +1 -1
- package/dist/types/utils/chains.d.ts +2 -0
- package/dist/types/utils/chains.d.ts.map +1 -1
- package/dist/types/utils/checkpoint.d.ts.map +1 -1
- package/dist/types/utils/chunk.d.ts.map +1 -1
- package/dist/types/utils/copy.d.ts.map +1 -1
- package/dist/types/utils/decodeAbiParameters.d.ts.map +1 -1
- package/dist/types/utils/estimate.d.ts.map +1 -1
- package/dist/types/utils/partition.d.ts.map +1 -1
- package/dist/types/utils/pg.d.ts +1 -1
- package/dist/types/utils/pg.d.ts.map +1 -1
- package/dist/types/utils/pglite.d.ts +1 -1
- package/dist/types/utils/pglite.d.ts.map +1 -1
- package/dist/types/utils/port.d.ts.map +1 -1
- package/dist/types/utils/promiseWithResolvers.d.ts.map +1 -1
- package/dist/types/utils/queue.d.ts.map +1 -1
- package/dist/types/utils/result.d.ts.map +1 -1
- package/dist/types/utils/zipper.d.ts +2 -2
- package/dist/types/utils/zipper.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/bin/commands/codegen.ts +3 -13
- package/src/bin/commands/createViews.ts +3 -6
- package/src/bin/commands/dev.ts +5 -25
- package/src/bin/commands/list.ts +6 -9
- package/src/bin/commands/prune.ts +6 -9
- package/src/bin/commands/serve.ts +5 -21
- package/src/bin/commands/start.ts +5 -22
- package/src/bin/isolatedController.ts +1 -1
- package/src/bin/isolatedWorker.ts +0 -6
- package/src/bin/ponder.ts +1 -1
- package/src/bin/utils/exit.ts +1 -9
- package/src/build/config.ts +22 -16
- package/src/build/factory.ts +2 -2
- package/src/build/index.ts +29 -19
- package/src/build/plugin.ts +1 -1
- package/src/build/pre.ts +2 -2
- package/src/build/schema.ts +20 -14
- package/src/build/stacktrace.ts +5 -5
- package/src/client/index.ts +23 -21
- package/src/config/address.ts +1 -1
- package/src/config/index.ts +1 -1
- package/src/database/actions.ts +18 -20
- package/src/database/index.ts +17 -17
- package/src/database/queryBuilder.ts +12 -14
- package/src/drizzle/bigint.ts +4 -4
- package/src/drizzle/bytes.ts +4 -4
- package/src/drizzle/hex.ts +4 -4
- package/src/drizzle/index.ts +1 -1
- package/src/drizzle/json.ts +6 -6
- package/src/drizzle/kit/index.ts +30 -44
- package/src/drizzle/onchain.ts +27 -23
- package/src/drizzle/text.ts +2 -2
- package/src/graphql/index.ts +16 -14
- package/src/graphql/json.ts +1 -1
- package/src/graphql/middleware.ts +6 -4
- package/src/index.ts +75 -83
- package/src/indexing/addStackTrace.ts +3 -3
- package/src/indexing/client.ts +40 -37
- package/src/indexing/index.ts +8 -6
- package/src/indexing/profile.ts +3 -3
- package/src/indexing-store/cache.ts +15 -15
- package/src/indexing-store/index.ts +26 -25
- package/src/indexing-store/profile.ts +4 -4
- package/src/indexing-store/utils.ts +11 -11
- package/src/internal/common.ts +0 -2
- package/src/internal/logger.ts +12 -9
- package/src/internal/metrics.ts +4 -4
- package/src/internal/options.ts +2 -10
- package/src/internal/types.ts +13 -13
- package/src/rpc/actions.ts +16 -17
- package/src/rpc/http.ts +9 -5
- package/src/rpc/index.ts +20 -16
- package/src/runtime/events.ts +22 -21
- package/src/runtime/filter.ts +9 -3
- package/src/runtime/fragments.ts +1 -1
- package/src/runtime/historical.ts +9 -6
- package/src/runtime/index.ts +6 -4
- package/src/runtime/isolated.ts +26 -20
- package/src/runtime/multichain.ts +24 -18
- package/src/runtime/omnichain.ts +24 -18
- package/src/runtime/realtime.ts +9 -11
- package/src/server/error.ts +2 -2
- package/src/server/index.ts +5 -5
- package/src/sync-historical/index.ts +13 -13
- package/src/sync-realtime/bloom.ts +1 -1
- package/src/sync-realtime/index.ts +7 -7
- package/src/sync-store/encode.ts +2 -2
- package/src/sync-store/index.ts +33 -58
- package/src/sync-store/migrations.ts +1 -1
- package/src/sync-store/schema.ts +1 -1
- package/src/types/db.ts +3 -3
- package/src/types.d.ts +2 -0
- package/src/ui/app.ts +1 -1
- package/src/ui/patch.ts +2 -3
- package/src/utils/abi.ts +7 -4
- package/src/utils/checkpoint.ts +1 -1
- package/src/utils/copy.ts +1 -1
- package/src/utils/decodeAbiParameters.ts +5 -7
- package/src/utils/pg.ts +1 -1
- package/src/utils/pglite.ts +5 -6
- package/src/utils/queue.ts +4 -4
- package/src/utils/result.ts +1 -1
- package/src/utils/sql-parse.ts +6 -6
- package/dist/esm/internal/telemetry.js +0 -200
- package/dist/esm/internal/telemetry.js.map +0 -1
- package/dist/types/internal/telemetry.d.ts +0 -43
- package/dist/types/internal/telemetry.d.ts.map +0 -1
- package/src/internal/telemetry.ts +0 -303
package/src/runtime/index.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Address, hexToNumber, numberToHex, toHex } from "viem";
|
|
1
2
|
import type { Common } from "@/internal/common.js";
|
|
2
3
|
import type {
|
|
3
4
|
Chain,
|
|
@@ -6,8 +7,8 @@ import type {
|
|
|
6
7
|
Filter,
|
|
7
8
|
Fragment,
|
|
8
9
|
LightBlock,
|
|
10
|
+
SyncBlock,
|
|
9
11
|
} from "@/internal/types.js";
|
|
10
|
-
import type { SyncBlock } from "@/internal/types.js";
|
|
11
12
|
import { eth_getBlockByNumber } from "@/rpc/actions.js";
|
|
12
13
|
import type { Rpc } from "@/rpc/index.js";
|
|
13
14
|
import {
|
|
@@ -23,9 +24,9 @@ import {
|
|
|
23
24
|
} from "@/runtime/fragments.js";
|
|
24
25
|
import type { SyncStore } from "@/sync-store/index.js";
|
|
25
26
|
import {
|
|
26
|
-
MAX_CHECKPOINT,
|
|
27
27
|
blockToCheckpoint,
|
|
28
28
|
encodeCheckpoint,
|
|
29
|
+
MAX_CHECKPOINT,
|
|
29
30
|
} from "@/utils/checkpoint.js";
|
|
30
31
|
import {
|
|
31
32
|
type Interval,
|
|
@@ -36,7 +37,6 @@ import {
|
|
|
36
37
|
intervalUnion,
|
|
37
38
|
sortIntervals,
|
|
38
39
|
} from "@/utils/interval.js";
|
|
39
|
-
import { type Address, hexToNumber, numberToHex, toHex } from "viem";
|
|
40
40
|
|
|
41
41
|
export type SyncProgress = {
|
|
42
42
|
start: SyncBlock | LightBlock;
|
|
@@ -47,7 +47,9 @@ export type SyncProgress = {
|
|
|
47
47
|
isFinalized: () => boolean;
|
|
48
48
|
getCheckpoint: <tag extends "start" | "end" | "current" | "finalized">({
|
|
49
49
|
tag,
|
|
50
|
-
}: {
|
|
50
|
+
}: {
|
|
51
|
+
tag: tag;
|
|
52
|
+
}) => tag extends "end" ? string | undefined : string;
|
|
51
53
|
};
|
|
52
54
|
|
|
53
55
|
export type ChildAddresses = Map<FactoryId, Map<Address, number>>;
|
package/src/runtime/isolated.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { eq, getTableName, isTable, sql } from "drizzle-orm";
|
|
1
2
|
import {
|
|
2
3
|
commitBlock,
|
|
3
4
|
createLiveQueryTriggers,
|
|
@@ -9,14 +10,14 @@ import {
|
|
|
9
10
|
} from "@/database/actions.js";
|
|
10
11
|
import { type Database, getPonderCheckpointTable } from "@/database/index.js";
|
|
11
12
|
import { getLiveQueryTempTableName } from "@/drizzle/onchain.js";
|
|
12
|
-
import { createIndexingCache } from "@/indexing-store/cache.js";
|
|
13
|
-
import { createIndexingStore } from "@/indexing-store/index.js";
|
|
14
13
|
import { createCachedViemClient } from "@/indexing/client.js";
|
|
15
14
|
import {
|
|
16
15
|
createColumnAccessPattern,
|
|
17
16
|
createIndexing,
|
|
18
17
|
getEventCount,
|
|
19
18
|
} from "@/indexing/index.js";
|
|
19
|
+
import { createIndexingCache } from "@/indexing-store/cache.js";
|
|
20
|
+
import { createIndexingStore } from "@/indexing-store/index.js";
|
|
20
21
|
import type { Common } from "@/internal/common.js";
|
|
21
22
|
import {
|
|
22
23
|
InvalidEventAccessError,
|
|
@@ -36,9 +37,9 @@ import { splitEvents } from "@/runtime/events.js";
|
|
|
36
37
|
import type { RealtimeSyncEvent } from "@/sync-realtime/index.js";
|
|
37
38
|
import { createSyncStore } from "@/sync-store/index.js";
|
|
38
39
|
import {
|
|
39
|
-
ZERO_CHECKPOINT_STRING,
|
|
40
40
|
decodeCheckpoint,
|
|
41
41
|
min,
|
|
42
|
+
ZERO_CHECKPOINT_STRING,
|
|
42
43
|
} from "@/utils/checkpoint.js";
|
|
43
44
|
import {
|
|
44
45
|
bufferAsyncGenerator,
|
|
@@ -46,7 +47,6 @@ import {
|
|
|
46
47
|
} from "@/utils/generators.js";
|
|
47
48
|
import { never } from "@/utils/never.js";
|
|
48
49
|
import { startClock } from "@/utils/timer.js";
|
|
49
|
-
import { eq, getTableName, isTable, sql } from "drizzle-orm";
|
|
50
50
|
import {
|
|
51
51
|
getHistoricalEventsIsolated,
|
|
52
52
|
refetchHistoricalEvents,
|
|
@@ -640,25 +640,31 @@ export async function runIsolated({
|
|
|
640
640
|
}
|
|
641
641
|
}
|
|
642
642
|
|
|
643
|
-
|
|
644
|
-
{ label: "update_checkpoints" },
|
|
645
|
-
(db) =>
|
|
646
|
-
db
|
|
647
|
-
.update(PONDER_CHECKPOINT)
|
|
648
|
-
.set({ latestCheckpoint: event.checkpoint })
|
|
649
|
-
.where(eq(PONDER_CHECKPOINT.chainName, event.chain.name)),
|
|
650
|
-
context,
|
|
651
|
-
);
|
|
652
|
-
|
|
653
|
-
if (
|
|
654
|
-
event.events.length > 0 &&
|
|
655
|
-
database.userQB.$dialect === "pglite"
|
|
656
|
-
) {
|
|
643
|
+
try {
|
|
657
644
|
await tx.wrap(
|
|
658
|
-
|
|
659
|
-
|
|
645
|
+
{ label: "update_checkpoints" },
|
|
646
|
+
(db) =>
|
|
647
|
+
db
|
|
648
|
+
.update(PONDER_CHECKPOINT)
|
|
649
|
+
.set({ latestCheckpoint: event.checkpoint })
|
|
650
|
+
.where(eq(PONDER_CHECKPOINT.chainName, event.chain.name)),
|
|
660
651
|
context,
|
|
661
652
|
);
|
|
653
|
+
|
|
654
|
+
if (
|
|
655
|
+
event.events.length > 0 &&
|
|
656
|
+
database.userQB.$dialect === "pglite"
|
|
657
|
+
) {
|
|
658
|
+
await tx.wrap(
|
|
659
|
+
(tx) =>
|
|
660
|
+
tx.execute(`TRUNCATE TABLE ${getLiveQueryTempTableName()}`),
|
|
661
|
+
context,
|
|
662
|
+
);
|
|
663
|
+
}
|
|
664
|
+
} catch (error) {
|
|
665
|
+
indexingCache.invalidate();
|
|
666
|
+
indexingCache.clear();
|
|
667
|
+
throw error;
|
|
662
668
|
}
|
|
663
669
|
},
|
|
664
670
|
undefined,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { eq, getTableName, isTable, isView, sql } from "drizzle-orm";
|
|
1
2
|
import {
|
|
2
3
|
commitBlock,
|
|
3
4
|
createIndexes,
|
|
@@ -15,14 +16,14 @@ import {
|
|
|
15
16
|
getPonderMetaTable,
|
|
16
17
|
} from "@/database/index.js";
|
|
17
18
|
import { getLiveQueryTempTableName } from "@/drizzle/onchain.js";
|
|
18
|
-
import { createIndexingCache } from "@/indexing-store/cache.js";
|
|
19
|
-
import { createIndexingStore } from "@/indexing-store/index.js";
|
|
20
19
|
import { createCachedViemClient } from "@/indexing/client.js";
|
|
21
20
|
import {
|
|
22
21
|
createColumnAccessPattern,
|
|
23
22
|
createIndexing,
|
|
24
23
|
getEventCount,
|
|
25
24
|
} from "@/indexing/index.js";
|
|
25
|
+
import { createIndexingCache } from "@/indexing-store/cache.js";
|
|
26
|
+
import { createIndexingStore } from "@/indexing-store/index.js";
|
|
26
27
|
import type { Common } from "@/internal/common.js";
|
|
27
28
|
import {
|
|
28
29
|
InvalidEventAccessError,
|
|
@@ -44,9 +45,9 @@ import { splitEvents } from "@/runtime/events.js";
|
|
|
44
45
|
import type { RealtimeSyncEvent } from "@/sync-realtime/index.js";
|
|
45
46
|
import { createSyncStore } from "@/sync-store/index.js";
|
|
46
47
|
import {
|
|
47
|
-
ZERO_CHECKPOINT_STRING,
|
|
48
48
|
decodeCheckpoint,
|
|
49
49
|
min,
|
|
50
|
+
ZERO_CHECKPOINT_STRING,
|
|
50
51
|
} from "@/utils/checkpoint.js";
|
|
51
52
|
import { formatEta, formatPercentage } from "@/utils/format.js";
|
|
52
53
|
import {
|
|
@@ -55,7 +56,6 @@ import {
|
|
|
55
56
|
} from "@/utils/generators.js";
|
|
56
57
|
import { never } from "@/utils/never.js";
|
|
57
58
|
import { startClock } from "@/utils/timer.js";
|
|
58
|
-
import { eq, getTableName, isTable, isView, sql } from "drizzle-orm";
|
|
59
59
|
import {
|
|
60
60
|
getHistoricalEventsMultichain,
|
|
61
61
|
refetchHistoricalEvents,
|
|
@@ -63,10 +63,10 @@ import {
|
|
|
63
63
|
import {
|
|
64
64
|
type CachedIntervals,
|
|
65
65
|
type ChildAddresses,
|
|
66
|
-
type SyncProgress,
|
|
67
66
|
getCachedIntervals,
|
|
68
67
|
getChildAddresses,
|
|
69
68
|
getLocalSyncProgress,
|
|
69
|
+
type SyncProgress,
|
|
70
70
|
} from "./index.js";
|
|
71
71
|
import { getRealtimeEventsMultichain } from "./realtime.js";
|
|
72
72
|
|
|
@@ -729,22 +729,28 @@ export async function runMultichain({
|
|
|
729
729
|
);
|
|
730
730
|
}
|
|
731
731
|
|
|
732
|
-
|
|
733
|
-
{ label: "update_checkpoints" },
|
|
734
|
-
(db) =>
|
|
735
|
-
db
|
|
736
|
-
.update(PONDER_CHECKPOINT)
|
|
737
|
-
.set({ latestCheckpoint: event.checkpoint })
|
|
738
|
-
.where(eq(PONDER_CHECKPOINT.chainName, event.chain.name)),
|
|
739
|
-
context,
|
|
740
|
-
);
|
|
741
|
-
|
|
742
|
-
if (database.userQB.$dialect === "pglite") {
|
|
732
|
+
try {
|
|
743
733
|
await tx.wrap(
|
|
744
|
-
|
|
745
|
-
|
|
734
|
+
{ label: "update_checkpoints" },
|
|
735
|
+
(db) =>
|
|
736
|
+
db
|
|
737
|
+
.update(PONDER_CHECKPOINT)
|
|
738
|
+
.set({ latestCheckpoint: event.checkpoint })
|
|
739
|
+
.where(eq(PONDER_CHECKPOINT.chainName, event.chain.name)),
|
|
746
740
|
context,
|
|
747
741
|
);
|
|
742
|
+
|
|
743
|
+
if (database.userQB.$dialect === "pglite") {
|
|
744
|
+
await tx.wrap(
|
|
745
|
+
(tx) =>
|
|
746
|
+
tx.execute(`TRUNCATE TABLE ${getLiveQueryTempTableName()}`),
|
|
747
|
+
context,
|
|
748
|
+
);
|
|
749
|
+
}
|
|
750
|
+
} catch (error) {
|
|
751
|
+
indexingCache.invalidate();
|
|
752
|
+
indexingCache.clear();
|
|
753
|
+
throw error;
|
|
748
754
|
}
|
|
749
755
|
},
|
|
750
756
|
undefined,
|
package/src/runtime/omnichain.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { eq, getTableName, isTable, isView, sql } from "drizzle-orm";
|
|
1
2
|
import {
|
|
2
3
|
commitBlock,
|
|
3
4
|
createIndexes,
|
|
@@ -15,14 +16,14 @@ import {
|
|
|
15
16
|
getPonderMetaTable,
|
|
16
17
|
} from "@/database/index.js";
|
|
17
18
|
import { getLiveQueryTempTableName } from "@/drizzle/onchain.js";
|
|
18
|
-
import { createIndexingCache } from "@/indexing-store/cache.js";
|
|
19
|
-
import { createIndexingStore } from "@/indexing-store/index.js";
|
|
20
19
|
import { createCachedViemClient } from "@/indexing/client.js";
|
|
21
20
|
import {
|
|
22
21
|
createColumnAccessPattern,
|
|
23
22
|
createIndexing,
|
|
24
23
|
getEventCount,
|
|
25
24
|
} from "@/indexing/index.js";
|
|
25
|
+
import { createIndexingCache } from "@/indexing-store/cache.js";
|
|
26
|
+
import { createIndexingStore } from "@/indexing-store/index.js";
|
|
26
27
|
import type { Common } from "@/internal/common.js";
|
|
27
28
|
import {
|
|
28
29
|
InvalidEventAccessError,
|
|
@@ -45,10 +46,10 @@ import { splitEvents } from "@/runtime/events.js";
|
|
|
45
46
|
import type { RealtimeSyncEvent } from "@/sync-realtime/index.js";
|
|
46
47
|
import { createSyncStore } from "@/sync-store/index.js";
|
|
47
48
|
import {
|
|
48
|
-
ZERO_CHECKPOINT_STRING,
|
|
49
49
|
decodeCheckpoint,
|
|
50
50
|
max,
|
|
51
51
|
min,
|
|
52
|
+
ZERO_CHECKPOINT_STRING,
|
|
52
53
|
} from "@/utils/checkpoint.js";
|
|
53
54
|
import { formatEta, formatPercentage } from "@/utils/format.js";
|
|
54
55
|
import {
|
|
@@ -58,7 +59,6 @@ import {
|
|
|
58
59
|
import { never } from "@/utils/never.js";
|
|
59
60
|
import { startClock } from "@/utils/timer.js";
|
|
60
61
|
import { zipperMany } from "@/utils/zipper.js";
|
|
61
|
-
import { eq, getTableName, isTable, isView, sql } from "drizzle-orm";
|
|
62
62
|
import {
|
|
63
63
|
getHistoricalEventsOmnichain,
|
|
64
64
|
refetchHistoricalEvents,
|
|
@@ -66,10 +66,10 @@ import {
|
|
|
66
66
|
import {
|
|
67
67
|
type CachedIntervals,
|
|
68
68
|
type ChildAddresses,
|
|
69
|
-
type SyncProgress,
|
|
70
69
|
getCachedIntervals,
|
|
71
70
|
getChildAddresses,
|
|
72
71
|
getLocalSyncProgress,
|
|
72
|
+
type SyncProgress,
|
|
73
73
|
} from "./index.js";
|
|
74
74
|
import { getRealtimeEventsOmnichain } from "./realtime.js";
|
|
75
75
|
|
|
@@ -749,22 +749,28 @@ export async function runOmnichain({
|
|
|
749
749
|
}
|
|
750
750
|
}
|
|
751
751
|
|
|
752
|
-
|
|
753
|
-
{ label: "update_checkpoints" },
|
|
754
|
-
(db) =>
|
|
755
|
-
db
|
|
756
|
-
.update(PONDER_CHECKPOINT)
|
|
757
|
-
.set({ latestCheckpoint: event.checkpoint })
|
|
758
|
-
.where(eq(PONDER_CHECKPOINT.chainName, event.chain.name)),
|
|
759
|
-
context,
|
|
760
|
-
);
|
|
761
|
-
|
|
762
|
-
if (database.userQB.$dialect === "pglite") {
|
|
752
|
+
try {
|
|
763
753
|
await tx.wrap(
|
|
764
|
-
|
|
765
|
-
|
|
754
|
+
{ label: "update_checkpoints" },
|
|
755
|
+
(db) =>
|
|
756
|
+
db
|
|
757
|
+
.update(PONDER_CHECKPOINT)
|
|
758
|
+
.set({ latestCheckpoint: event.checkpoint })
|
|
759
|
+
.where(eq(PONDER_CHECKPOINT.chainName, event.chain.name)),
|
|
766
760
|
context,
|
|
767
761
|
);
|
|
762
|
+
|
|
763
|
+
if (database.userQB.$dialect === "pglite") {
|
|
764
|
+
await tx.wrap(
|
|
765
|
+
(tx) =>
|
|
766
|
+
tx.execute(`TRUNCATE TABLE ${getLiveQueryTempTableName()}`),
|
|
767
|
+
context,
|
|
768
|
+
);
|
|
769
|
+
}
|
|
770
|
+
} catch (error) {
|
|
771
|
+
indexingCache.invalidate();
|
|
772
|
+
indexingCache.clear();
|
|
773
|
+
throw error;
|
|
768
774
|
}
|
|
769
775
|
},
|
|
770
776
|
undefined,
|
package/src/runtime/realtime.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type Address, hexToNumber } from "viem";
|
|
1
2
|
import type { Database } from "@/database/index.js";
|
|
2
3
|
import type { Common } from "@/internal/common.js";
|
|
3
4
|
import type {
|
|
@@ -21,15 +22,15 @@ import {
|
|
|
21
22
|
syncTransactionToInternal,
|
|
22
23
|
} from "@/runtime/events.js";
|
|
23
24
|
import {
|
|
24
|
-
type RealtimeSyncEvent,
|
|
25
25
|
createRealtimeSync,
|
|
26
|
+
type RealtimeSyncEvent,
|
|
26
27
|
} from "@/sync-realtime/index.js";
|
|
27
28
|
import { createSyncStore } from "@/sync-store/index.js";
|
|
28
29
|
import {
|
|
29
|
-
ZERO_CHECKPOINT_STRING,
|
|
30
30
|
blockToCheckpoint,
|
|
31
31
|
encodeCheckpoint,
|
|
32
32
|
min,
|
|
33
|
+
ZERO_CHECKPOINT_STRING,
|
|
33
34
|
} from "@/utils/checkpoint.js";
|
|
34
35
|
import {
|
|
35
36
|
bufferAsyncGenerator,
|
|
@@ -40,7 +41,6 @@ import { type Interval, intervalIntersection } from "@/utils/interval.js";
|
|
|
40
41
|
import { promiseAllSettledWithThrow } from "@/utils/promiseAllSettledWithThrow.js";
|
|
41
42
|
import { promiseWithResolvers } from "@/utils/promiseWithResolvers.js";
|
|
42
43
|
import { startClock } from "@/utils/timer.js";
|
|
43
|
-
import { type Address, hexToNumber } from "viem";
|
|
44
44
|
import { getFilterFactories } from "./filter.js";
|
|
45
45
|
import type { ChildAddresses, SyncProgress } from "./index.js";
|
|
46
46
|
import { getOmnichainCheckpoint } from "./omnichain.js";
|
|
@@ -90,7 +90,7 @@ export async function* getRealtimeEventsOmnichain(params: {
|
|
|
90
90
|
{ chain: chain.name },
|
|
91
91
|
1,
|
|
92
92
|
);
|
|
93
|
-
return;
|
|
93
|
+
return undefined;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
const rpc =
|
|
@@ -255,7 +255,7 @@ export async function* getRealtimeEventsOmnichain(params: {
|
|
|
255
255
|
if (to <= from) continue;
|
|
256
256
|
|
|
257
257
|
// index of the first unfinalized event
|
|
258
|
-
let finalizeIndex: number | undefined
|
|
258
|
+
let finalizeIndex: number | undefined;
|
|
259
259
|
for (const [index, event] of executedEvents.entries()) {
|
|
260
260
|
if (event.checkpoint > to) {
|
|
261
261
|
finalizeIndex = index;
|
|
@@ -356,7 +356,7 @@ export async function* getRealtimeEventsMultichain(params: {
|
|
|
356
356
|
{ chain: chain.name },
|
|
357
357
|
1,
|
|
358
358
|
);
|
|
359
|
-
return;
|
|
359
|
+
return undefined;
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
const rpc =
|
|
@@ -511,7 +511,7 @@ export async function* getRealtimeEventsMultichain(params: {
|
|
|
511
511
|
const checkpoint = syncProgress.getCheckpoint({ tag: "finalized" });
|
|
512
512
|
|
|
513
513
|
// index of the first unfinalized event
|
|
514
|
-
let finalizeIndex: number | undefined
|
|
514
|
+
let finalizeIndex: number | undefined;
|
|
515
515
|
|
|
516
516
|
for (const [index, event] of executedEvents.entries()) {
|
|
517
517
|
const _chain = params.indexingBuild.chains.find(
|
|
@@ -559,7 +559,7 @@ export async function* getRealtimeEventsMultichain(params: {
|
|
|
559
559
|
const checkpoint = syncProgress.getCheckpoint({ tag: "current" });
|
|
560
560
|
|
|
561
561
|
// index of the first reorged event
|
|
562
|
-
let reorgIndex: number | undefined
|
|
562
|
+
let reorgIndex: number | undefined;
|
|
563
563
|
for (const [index, event] of executedEvents.entries()) {
|
|
564
564
|
if (event.chain.id === chain.id && event.checkpoint > checkpoint) {
|
|
565
565
|
reorgIndex = index;
|
|
@@ -1150,9 +1150,7 @@ export async function* mergeAsyncGeneratorsWithRealtimeOrder(
|
|
|
1150
1150
|
|
|
1151
1151
|
const supremum = min(...blockCheckpoints);
|
|
1152
1152
|
|
|
1153
|
-
index = blockCheckpoints.
|
|
1154
|
-
(checkpoint) => checkpoint === supremum,
|
|
1155
|
-
);
|
|
1153
|
+
index = blockCheckpoints.indexOf(supremum);
|
|
1156
1154
|
}
|
|
1157
1155
|
|
|
1158
1156
|
const resultPromise = generators[index]!.next();
|
package/src/server/error.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import type { Context, HonoRequest } from "hono";
|
|
2
|
+
import { html } from "hono/html";
|
|
1
3
|
import { addStackTrace } from "@/indexing/addStackTrace.js";
|
|
2
4
|
import type { Common } from "@/internal/common.js";
|
|
3
5
|
import type { BaseError } from "@/internal/errors.js";
|
|
4
6
|
import { prettyPrint } from "@/utils/print.js";
|
|
5
|
-
import type { Context, HonoRequest } from "hono";
|
|
6
|
-
import { html } from "hono/html";
|
|
7
7
|
|
|
8
8
|
export const onError = async (_error: Error, c: Context, common: Common) => {
|
|
9
9
|
const error = _error as BaseError;
|
package/src/server/index.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import http from "node:http";
|
|
2
|
+
import { serve } from "@hono/node-server";
|
|
3
|
+
import { Hono } from "hono";
|
|
4
|
+
import { cors } from "hono/cors";
|
|
5
|
+
import { createMiddleware } from "hono/factory";
|
|
6
|
+
import { createHttpTerminator } from "http-terminator";
|
|
2
7
|
import {
|
|
3
8
|
type Database,
|
|
4
9
|
getPonderCheckpointTable,
|
|
@@ -8,11 +13,6 @@ import type { Common } from "@/internal/common.js";
|
|
|
8
13
|
import type { ApiBuild, Status } from "@/internal/types.js";
|
|
9
14
|
import { decodeCheckpoint } from "@/utils/checkpoint.js";
|
|
10
15
|
import { startClock } from "@/utils/timer.js";
|
|
11
|
-
import { serve } from "@hono/node-server";
|
|
12
|
-
import { Hono } from "hono";
|
|
13
|
-
import { cors } from "hono/cors";
|
|
14
|
-
import { createMiddleware } from "hono/factory";
|
|
15
|
-
import { createHttpTerminator } from "http-terminator";
|
|
16
16
|
import { onError } from "./error.js";
|
|
17
17
|
|
|
18
18
|
export type Server = {
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
import { getLogsRetryHelper } from "@ponder/utils";
|
|
2
|
+
import {
|
|
3
|
+
type Address,
|
|
4
|
+
type Hash,
|
|
5
|
+
type Hex,
|
|
6
|
+
hexToNumber,
|
|
7
|
+
type LogTopic,
|
|
8
|
+
numberToHex,
|
|
9
|
+
type RpcError,
|
|
10
|
+
toHex,
|
|
11
|
+
zeroHash,
|
|
12
|
+
} from "viem";
|
|
1
13
|
import type { Common } from "@/internal/common.js";
|
|
2
14
|
import type {
|
|
3
15
|
BlockFilter,
|
|
@@ -46,26 +58,14 @@ import type {
|
|
|
46
58
|
import type { SyncStore } from "@/sync-store/index.js";
|
|
47
59
|
import { dedupe } from "@/utils/dedupe.js";
|
|
48
60
|
import {
|
|
49
|
-
type Interval,
|
|
50
61
|
getChunks,
|
|
62
|
+
type Interval,
|
|
51
63
|
intervalBounds,
|
|
52
64
|
intervalRange,
|
|
53
65
|
} from "@/utils/interval.js";
|
|
54
66
|
import { promiseAllSettledWithThrow } from "@/utils/promiseAllSettledWithThrow.js";
|
|
55
67
|
import { createQueue } from "@/utils/queue.js";
|
|
56
68
|
import { startClock } from "@/utils/timer.js";
|
|
57
|
-
import { getLogsRetryHelper } from "@ponder/utils";
|
|
58
|
-
import {
|
|
59
|
-
type Address,
|
|
60
|
-
type Hash,
|
|
61
|
-
type Hex,
|
|
62
|
-
type LogTopic,
|
|
63
|
-
type RpcError,
|
|
64
|
-
hexToNumber,
|
|
65
|
-
numberToHex,
|
|
66
|
-
toHex,
|
|
67
|
-
zeroHash,
|
|
68
|
-
} from "viem";
|
|
69
69
|
|
|
70
70
|
export type HistoricalSync = {
|
|
71
71
|
/**
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { type Hex, hexToBytes, hexToNumber, keccak256 } from "viem";
|
|
1
2
|
import type { LogFilter, SyncBlock } from "@/internal/types.js";
|
|
2
3
|
import {
|
|
3
4
|
getFilterFromBlock,
|
|
4
5
|
getFilterToBlock,
|
|
5
6
|
isAddressFactory,
|
|
6
7
|
} from "@/runtime/filter.js";
|
|
7
|
-
import { type Hex, hexToBytes, hexToNumber, keccak256 } from "viem";
|
|
8
8
|
|
|
9
9
|
export const zeroLogsBloom =
|
|
10
10
|
"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000";
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Address,
|
|
3
|
+
type Hash,
|
|
4
|
+
hexToNumber,
|
|
5
|
+
numberToHex,
|
|
6
|
+
zeroHash,
|
|
7
|
+
} from "viem";
|
|
1
8
|
import type { Common } from "@/internal/common.js";
|
|
2
9
|
import { ShutdownError } from "@/internal/errors.js";
|
|
3
10
|
import type {
|
|
@@ -49,13 +56,6 @@ import { isAsyncExecutionChain } from "@/utils/finality.js";
|
|
|
49
56
|
import { createLock } from "@/utils/mutex.js";
|
|
50
57
|
import { range } from "@/utils/range.js";
|
|
51
58
|
import { startClock } from "@/utils/timer.js";
|
|
52
|
-
import {
|
|
53
|
-
type Address,
|
|
54
|
-
type Hash,
|
|
55
|
-
hexToNumber,
|
|
56
|
-
numberToHex,
|
|
57
|
-
zeroHash,
|
|
58
|
-
} from "viem";
|
|
59
59
|
import { isFilterInBloom, isInBloom, zeroLogsBloom } from "./bloom.js";
|
|
60
60
|
|
|
61
61
|
export type RealtimeSync = {
|
package/src/sync-store/encode.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { Hex } from "viem";
|
|
2
|
+
import { hexToBigInt, hexToNumber } from "viem";
|
|
1
3
|
import type {
|
|
2
4
|
SyncBlock,
|
|
3
5
|
SyncBlockHeader,
|
|
@@ -7,8 +9,6 @@ import type {
|
|
|
7
9
|
SyncTransactionReceipt,
|
|
8
10
|
} from "@/internal/types.js";
|
|
9
11
|
import { toLowerCase } from "@/utils/lowercase.js";
|
|
10
|
-
import type { Hex } from "viem";
|
|
11
|
-
import { hexToBigInt, hexToNumber } from "viem";
|
|
12
12
|
import type * as ponderSyncSchema from "./schema.js";
|
|
13
13
|
|
|
14
14
|
export const encodeBlock = ({
|