Introducing Preload Optimization
Important! Preload optimization makes your handlers run twice. Starting from
envio@2.27all new indexers are created with preload optimization pre-configured by default.
This optimization enables HyperIndex to efficiently preload entities used by handlers through batched database queries, while ensuring events are processed synchronously in their original order. When combined with the Effect API for external calls, this feature delivers performance improvements of multiple orders of magnitude compared to other indexing solutions.
Set a single line in your config and make your handlers multiple times faster without changing a single line of code:
preload_handlers: true
For power users - This is like Loaders, but for all handlers by default.
Read more about Preload Optimization in the dedicated guide.
Contract-specific start block
A highly requested feature contributed by one of our users @rori4
Specify a later start block for a contract to optimize indexing performance:
name: nft-indexer
description: NFT Factory
networks:
- id: 1337
start_block: 0
contracts:
- name: NftFactory
address: 0x4675a6B115329294e0518A2B7cC12B70987895C4
handler: src/EventHandlers.ts
events:
- event: SimpleNftCreated(string name, string symbol, uint256 maxSupply, address contractAddress)
- name: Nft
# No address field - we'll discover these addresses from SimpleNftCreated events
start_block:
handler: src/EventHandlers.ts
start_block: 30000000 # Overwrite the network start block
events:
- event: Transfer(address from, address to, uint256 tokenId)
In the Factory Contract example above, it'll register all NFT addresses, but it'll start processing Transfers only from the block 30000000.
Contributing Improvements
To support new contributors, we have updated our CONTRIBUTING.md file with a detailed guide on navigating the HyperIndex codebase, as well as examples of what a change would look like. To make it even easier, we added .cursor rules to help develop new HyperIndex features.
Embrace Vibe-Coding
All new projects are now created with an initial .cursor rules included to help you build indexers with the agent support.
Also, feel free to create PRs with the rules suggestions to improve the experience for everyone
Fixes & Improvements
- Started including an address in a handler error log #658
- Support nullable effect cache output #665
- Fix e2e tests #666
- Error when contract start block is earlier than the network's #670
New Contributors
- @rori4 made their first contribution in #669