Skip to content

[indexer]: index solana ismp host events#812

Draft
dharjeezy wants to merge 1 commit into
mainfrom
dami/index-solana
Draft

[indexer]: index solana ismp host events#812
dharjeezy wants to merge 1 commit into
mainfrom
dami/index-solana

Conversation

@dharjeezy
Copy link
Copy Markdown
Contributor

@dharjeezy dharjeezy commented May 5, 2026

Summary

  • Adds a third solana branch to the indexer config schema, manifest template, and codegen, so a Solana ISMP host slots into the multichain SubQuery project the same way EVM and Substrate hosts do.
  • Wires three handlers against the real PR [solana]: Host, Handler and Verifier Programs #801 host program: storeStateCommitment (= EVM StateMachineUpdated), dispatchIncoming (= EVM PostRequestHandled), and vetoStateCommitment (logs at WARN until the GraphQL schema gains a vetoed flag).
  • Inbound-only by design, matching the host program. No outbound dispatch indexing, no timeout handlers.

Background

PR #801 (royvardhan/solana-ismp-host) ships the Hyperbridge host program for Solana.

The host has no Anchor #[event]s, so every indexable surface is an InstructionHandler filtered by Anchor discriminator (camelCase function name from the IDL). The instruction params carry state_root, overlay_root, and timestamp directly, so the handler decodes the commitment from the params rather than fetching the [b"commit", state_machine_u32_le, height_u64_le] PDA after the fact.

What has been done so far

  • src/configs/index.ts: Zod solana branch with ismpHost / tokenGateway / intentGateway base58 program ids plus an optional quorum policy
    (providers, threshold) and a refinement that rejects threshold > providers.length.
  • scripts/templates/solana-chain.yaml.hbs: Handlebars template emitting a solana/Runtime data source per program. Three InstructionHandler entries on the host program (storeStateCommitment, dispatchIncoming, vetoStateCommitment), conditional blocks for token and intent gateways for forward compatibility.
  • scripts/generate-chain-yamls.ts: generateSolanaYaml (uses getSlot at commitment: "finalized" for the local-env live head, static startBlock elsewhere), config.type dispatch in generateAllChainYamls, and Solana-aware sidecar generators (chains-by-ismp-host, gateway-address maps).
  • src/handlers/events/solana/storeStateCommitment.instruction.handler.ts: decodes StoreStateCommitmentParams, derives source-chain id (POLKADOT-${u32} on mainnet), writes StateMachineUpdateEvent.
  • src/handlers/events/solana/dispatchIncoming.instruction.handler.ts: decodes DispatchIncomingParams, pulls relayer pubkey from instruction account index 1,
    calls RequestService.updateStatus({ status: Status.DESTINATION }) keyed by the 32-byte commitment.
  • src/handlers/events/solana/vetoStateCommitment.instruction.handler.ts: logs at WARN. See doc section 5.5 for why we don't write a row yet.
  • src/utils/solana.helpers.ts: hand-written decoders for StoreStateCommitmentParams and DispatchIncomingParams. No Borsh runtime dep; the layouts are short and fixed-size.
  • src/services/stateMachine.service.ts: createSolanaStateMachineUpdatedEvent. Receives the commitment in args (no fetch) since the instruction params carry
    it.
  • src/types/subql-solana.ts: local SolanaInstruction interface which will be replaced when @subql/types-solana is added.
  • src/mappings/mappingHandlers.ts: re-exports the three handlers under their YAML-bound names.

Depends on #801.

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