v3.6.0
One step closer to truly isolated multichain ⛓️
Per-chain isolation by default (recommended)
Until now, every entity row was shared across every chain, so multichain indexers had to namespace ids by hand: ${event.chainId}_${pool}. This release lets you turn that off:
name: my-indexer
disable_default_cross_chain: true # recommended for all projects, and the default in future HyperIndex v4With the flag on, entities and effects are scoped per chain. Entity tables get a composite (id, chainId) primary key, so the same id on two chains is two independent rows.
Handlers don't change. A handler always runs on a single chain, so context.Token.get(id) reads that chain's row — and ids no longer need a chain prefix to stay unique.
Opting back into cross-chain
With disable_default_cross_chain: true, you can still share data across chains where you need it. Add @crossChain to an entity, or crossChain: true to an effect:
type Counter { # per-chain: one row per (id, chainId)
id: ID!
count: BigInt!
}
type GlobalCounter @crossChain { # one row shared by every chain
id: ID!
count: BigInt!
}Outside a handler there's no chain in context, so Test Indexer operations now take one explicitly:
indexer.Counter.set({ id, count, chainId }).indexer.Counter.get(id)throws if the id exists on more than one chain — narrow it with the newindexer.Counter.getWhere({ chainId: { _eq: 1 } }).
Other changes
- Faster pruning of stale entity history by @DZakh in #1531
result.changesentries no longer repeatchainIdper entity — the change itself carries the chain by @DZakh in #1531getWhereis now available on the test indexer's entity operations by @DZakh in #1531envio inittemplates drop the${event.chainId}_prefix from entity ids, and the bundled indexer skills teach the per-chain convention by @DZakh in #1531
Full Changelog: v3.5.1...v3.6.0