Full proposal: https://index.acuity.network/proposals/2/
Currently Acuity Index works by decoding each event into a Rust type that has been generated automatically by the subxt
macro by calling EventDetails::as_root_event()
This has a number of problems. Currently event types are only derived for the latest runtime for each chain. If events have been modified or removed during chain upgrades the latest version of the indexer may not be able to index certain events from older blocks.
One solution to this would be to derive event types and maintain indexing macros for all runtimes that a chain has had. The burden of maintaining the indexer for each chain would be large and complex.
During build the subxt
macro is extremely slow and requires a considerable amount of RAM. Running it for every individual runtime would increase the build requirements considerably making maintenance even harder.
Converting the event into dedicated types also increases the CPU time required during indexing.
Consumers of the index (dapps) typically will not want to decode events into runtime-specific types. This would add to the complexity and maintenance burden of the dapp.
It is unusual for the schema of an individual event to change over a runtime upgrade. Typically events are added or removed.
A much better approach is to call EventDetails::field_values()
This has a number of advantages:
A chain index specification will include the following config items:
default
for Polkadot SDK built-in palletscustom
for each event variant specify which parameters should be indexed by which keyFull proposal: https://index.acuity.network/proposals/2/