Skip to content

Modernize indexer toolchain and index provider preimages via Ink event#5

Open
gibsfinancedev wants to merge 2 commits into
masterfrom
update-engines
Open

Modernize indexer toolchain and index provider preimages via Ink event#5
gibsfinancedev wants to merge 2 commits into
masterfrom
update-engines

Conversation

@gibsfinancedev

Copy link
Copy Markdown
Contributor

This branch brings the indexer toolchain up to date and makes the
provider preimage commitments indexable on chain 943 without call traces.

What's here

Index provider preimages via the Ink event (primary change)
The original provider-commitment handler read call traces, which need a
trace-capable archive endpoint and millions of trace calls over full
history. It is replaced with an event-driven handler that decodes the
Ink event's transaction calldata (ink(info, data)) to recover the
section parameters and the raw preimage bytes, indexing full history on
an ordinary archive endpoint. This is the handler validated live on the
943 entropy indexer, ported back so the source is canonical.

  • Add the Random:Ink event handler; guard the reconstructed section
    against the emitted one; skip indirectly-invoked inks with a warning.
  • Fix the Heat and Cast handlers' all-columns selects, which referenced
    an undefined schema.X._.columns and crash-looped on the first event.
  • Adapt the decoded section field to the current contract interface
    (durationIsTimestamp was renamed to usesTimestamp); the on-chain
    tuple layout is unchanged, so historical calldata still decodes.

Toolchain modernization (earlier commits on the branch)

  • Upgrade the indexer to ponder 0.16 and convert to an npm workspace.
  • Update the continuous-integration node and package-manager versions.

Supporting reconciliation

  • Restore the chain-943 deployment-address record the config imports.
  • Exclude the local backups directory from type checking.

Notes

  • The ported handler and all real source files type-check cleanly.
  • Two pre-existing type errors remain in ponder.config.ts, from stale
    contract artifacts missing their generated type companions; that is a
    separate contracts rebuild, out of scope for this branch.

The original provider-commitment handler relied on call traces, which
need a trace-capable archive endpoint and millions of trace calls over
full history — impractical on the available endpoints. Replace it with
an event-driven handler that decodes the Ink event's transaction
calldata (`ink(info, data)`) to recover the section parameters and raw
preimage bytes, indexing full history on an ordinary archive endpoint.

This is the handler validated live on the 943 entropy indexer, ported
back from the gitignored deploy copy so the source is canonical:

- Add the Random:Ink event handler; guard the reconstructed section
  against the emitted one; skip indirectly-invoked inks with a warning.
- Adapt the decoded section field to the current contract API
  (durationIsTimestamp was renamed to usesTimestamp); the on-chain
  tuple layout is unchanged, so historical calldata still decodes.
- Fix the Heat and Cast handlers' all-columns selects, which used an
  undefined `schema.X._.columns` and crash-looped on the first event.
- Drop an unused destructure in the Bleach handler.

Supporting reconciliation so the source builds against ponder 0.16:
- Install ponder 0.16.6 (package.json declared it; node_modules still
  carried the pre-upgrade 0.10.9, collapsing the typed Context).
- Restore the chain-943 deployment-address record the config imports.
- Exclude the local backups dir from typecheck.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant