Files
pezkuwi-subquery/pezkuwi-assethub.yaml
T
pezkuwichain ad4c9c9331 fix: update startBlock to current chain height to avoid pruned state crash
Both AH (56400→579775) and Relay (57100→708687) startBlocks were
pointing to blocks whose state has been pruned by the chain nodes.
This caused a crash loop: SubQuery couldn't index those blocks because
api.query calls returned 'State already discarded' errors.

Root cause: AH node has ~200 block state window (default pruning).
Fix: set startBlock to current tip - 50 blocks (safely within window).
Also added --state-pruning=archive to AH collator azad on VPS3 so
this doesn't recur as SubQuery re-syncs.
2026-04-11 14:58:09 +03:00

100 lines
3.1 KiB
YAML

specVersion: 1.0.0
name: subquery-pezkuwi-assethub
version: 1.0.0
runner:
node:
name: "@subql/node"
version: ">=4.6.6"
query:
name: "@subql/query"
version: "*"
description: Pezkuwi Asset Hub SubQuery - Indexes NominationPools, transfers, swaps
repository: https://github.com/pezkuwichain/pezkuwi-subquery
schema:
file: ./schema.graphql
network:
chainId: "0xe7c15092dcbe3f320260ddbbc685bfceed9125a3b3d8436db2766201dec3b949"
endpoint:
- wss://asset-hub-rpc.pezkuwichain.io
dataSources:
- name: main
kind: substrate/Runtime
startBlock: 579775
mapping:
file: ./dist/index.js
handlers:
# Block handler: initialize active pool stakers from chain state
- handler: handleBlock
kind: substrate/BlockHandler
# Signed extrinsics for history
- handler: handleHistoryElement
kind: substrate/CallHandler
filter:
isSigned: true
# Nomination Pools rewards
- handler: handlePoolReward
kind: substrate/EventHandler
filter:
module: nominationPools
method: PaidOut
# Pool member bonded (track active stakers)
- handler: handlePoolBonded
kind: substrate/EventHandler
filter:
module: nominationPools
method: Bonded
# Pool member unbonded (cleanup active stakers)
- handler: handlePoolUnbonded
kind: substrate/EventHandler
filter:
module: nominationPools
method: Unbonded
# Pool bonded slash
- handler: handlePoolBondedSlash
kind: substrate/EventHandler
filter:
module: nominationPools
method: PoolSlashed
# Pool unbonding slash
- handler: handlePoolUnbondingSlash
kind: substrate/EventHandler
filter:
module: nominationPools
method: UnbondingPoolSlashed
# Staking rewards on AH (validators + direct nominators)
- handler: handleAHRewarded
kind: substrate/EventHandler
filter:
module: staking
method: Rewarded
# Staking slashes on AH
- handler: handleAHSlashed
kind: substrate/EventHandler
filter:
module: staking
method: Slashed
# Era changes on AH (staking pallet lives here) - old format
- handler: handleAHNewEra
kind: substrate/EventHandler
filter:
module: staking
method: StakingElection
# Era changes on AH - new format (Polkadot 2.0)
- handler: handleAHStakersElected
kind: substrate/EventHandler
filter:
module: staking
method: StakersElected
# Native transfers
- handler: handleTransfer
kind: substrate/EventHandler
filter:
module: balances
method: Transfer
# Asset transfers
- handler: handleAssetTransfer
kind: substrate/EventHandler
filter:
module: assets
method: Transferred