[indexer]: index solana ismp host events#812
Draft
dharjeezy wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
solanabranch 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.storeStateCommitment(= EVMStateMachineUpdated),dispatchIncoming(= EVMPostRequestHandled), andvetoStateCommitment(logs at WARN until the GraphQL schema gains avetoedflag).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 anInstructionHandlerfiltered by Anchor discriminator (camelCase function name from the IDL). The instruction params carrystate_root,overlay_root, andtimestampdirectly, 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: Zodsolanabranch withismpHost/tokenGateway/intentGatewaybase58 program ids plus an optionalquorumpolicy(
providers,threshold) and a refinement that rejectsthreshold > providers.length.scripts/templates/solana-chain.yaml.hbs: Handlebars template emitting asolana/Runtimedata source per program. ThreeInstructionHandlerentries on the host program (storeStateCommitment,dispatchIncoming,vetoStateCommitment), conditional blocks for token and intent gateways for forward compatibility.scripts/generate-chain-yamls.ts:generateSolanaYaml(usesgetSlotatcommitment: "finalized"for the local-env live head, staticstartBlockelsewhere),config.typedispatch ingenerateAllChainYamls, and Solana-aware sidecar generators (chains-by-ismp-host, gateway-address maps).src/handlers/events/solana/storeStateCommitment.instruction.handler.ts: decodesStoreStateCommitmentParams, derives source-chain id (POLKADOT-${u32} on mainnet), writesStateMachineUpdateEvent.src/handlers/events/solana/dispatchIncoming.instruction.handler.ts: decodesDispatchIncomingParams, 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 forStoreStateCommitmentParamsandDispatchIncomingParams. 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 carryit.
src/types/subql-solana.ts: localSolanaInstructioninterface which will be replaced when@subql/types-solanais added.src/mappings/mappingHandlers.ts: re-exports the three handlers under their YAML-bound names.Depends on #801.