Skip to content

Type generation is manual and error-prone — needs automation #206

@sameh-farouk

Description

@sameh-farouk

Problem

The type definitions in src/types/ are hand-maintained. This has led to several issues:

  • Stale types: When new chain spec versions are added, type files are manually edited. This is error-prone and has resulted in incorrect or outdated type definitions remaining in the codebase.
  • Inconsistent mapping references: Mapping files reference type versions that don't match the generated event hashes, causing silent mismatches (e.g. wrong version aliases like v122 vs v123, missing renames after type changes).
  • No version tracking: There is no log of which spec versions have been processed by the type generator. Developers must manually inspect files to determine what's current.
  • Multi-file edits required: Adding support for a new chain spec version requires editing multiple type files, the event definitions, and potentially the mapping handlers — all by hand.
  • Duplicate type definitions: Without automation, types that should be shared across versions are duplicated, leading to drift.

Impact

  • Risk of indexing incorrect data due to type mismatches
  • High friction for adding new spec version support
  • No reproducibility — different developers may generate slightly different types

Expected Outcome

An automated make typegen workflow that:

  • Generates types from chain metadata deterministically
  • Maintains an append-only version log for traceability
  • Ensures mapping files reference the correct generated type versions

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions