Skip to content

Multi-version protocol support in transaction indexer #445

@kalloc

Description

@kalloc

Description
The indexer currently supports only a single protocol version for transaction decoding.
When a protocol upgrade happens, transactions may be encoded differently, leading to decoding errors.
We need to add support for handling multiple protocol versions (old + new) during and after upgrades.

Proposed Solutions

  1. Multi-decoding attempt

    • Try decoding with the old version first.
    • If it fails, attempt decoding with the new version.
    • Useful when no strict slot boundary is known.
  2. Slot-based flag switch

    • Define a specific slot number in configuration.
    • Before that slot → use old decoder.
    • After that slot → use new decoder.
    • Predictable and efficient when upgrade slot is known.

Acceptance Criteria

  • Indexer correctly decodes transactions from both protocol versions.
  • Decoding errors from old/new versions do not crash the indexer.
  • Ability to configure strategy:
    • Multi-decoding
    • Slot-based switch
  • Configuration is documented and easy to update.

Priority
High — required for stable operation during protocol upgrades.

Implementation Notes

  • Add protocol version handlers to the decoding layer.
  • Support strategy selection via config.
  • Ensure logs clearly indicate which decoder was used.

Let's discuss it

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions