Up to 30% faster indexing, with field selection in onBlock.
30% faster indexing
We cut per-event handler overhead. This resulted in up to a 30% speedup for many indexing cases.
#1771
25% more efficient storage
We moved Postgres storage into Rust. This reduced CPU usage by 25%.
#1649
Field selection for onBlock / onSlot handlers
Use fields to select which fields to index for a block. This is especially useful for building time-based workflows and more.
indexer.onBlock(
{
name: "headers",
where: () => ({ block: { number: { _gte: 10, _every: 2 } } }),
fields: { block: ["timestamp", "miner"] },
},
async ({ block }) => {
block.timestamp;
block.miner;
},
);
#1766
ClickHouse-only entities
ClickHouse-only entities can now be read from handlers. You can index the whole dataset into ClickHouse while keeping only metadata in the Postgres database.
This feature allows 5-20x smaller storage for your indexers, as well as powerful analytics queries.
#1710
Anonymous events support
Anonymous EVM events can now be indexed. An event is anonymous when its signature ends in anonymous or its ABI entry has "anonymous": true.
events:
- event: LogNote(bytes4 indexed sig, ...) anonymous
Such logs carry no signature topic, so every registration of an anonymous event must filter that param by concrete values:
indexer.onEvent(
{
contract: "Vat",
event: "LogNote",
where: { params: { sig: "0x29ae8114" } },
},
async ({ event }) => {
/* event.params.sig === "0x29ae8114" */
},
);
#1769
console.log
We replaced Pino logging with a native Rust logger and redesigned how logging is done in general.
Every console.log performed in your handler files now goes through the Envio logger. This allows it to be displayed on Envio Cloud and augments it with the current timestamp.
When calling console.log from a handler, it is also automatically augmented with handler details the same way context.log does. There is no need to pass context around for this.
#1763
Strict Hex Type
We added an option to make types stricter for hex values: string -> `0x${string}`
strict_hex_type: true # default false for backward compatibility
#1761
Fixes
- Fix TUI for chains at the head without events #1692
- Fix race condition for TUI #1693
- Fix onEvent's where filter for Fuel handlers #1770
- Fix SVM handlers crash for instructions with no logs #1777
Other Improvements
- Lower the client-side filter's threshold default to 100k addresses #1755
- Improve error message when a value is too large for Postgres index #1752
- Updated supported HyperSync chains #1765
- Dead code removal #1760
- New metric.
envio_indexing_source_rate_limited_secondsreports how long a chain spent waiting out source rate limits. #1775 - Removed
postgres.js,viemandpinodependencies #1772 - Speed up tests in CI #1690
- Fix race condition for tests #1674, #1694
- More reliable and agent-friendly internal testing framework #1753
- Move internal tests to use a black-box approach #1762, #1775