Skip to content

feat: implement version registry and name-service event metadata (#403) - #497

Open
Tekgodfrey wants to merge 1 commit into
enliven17:mainfrom
Tekgodfrey:feat/issue-403-event-metadata
Open

feat: implement version registry and name-service event metadata (#403)#497
Tekgodfrey wants to merge 1 commit into
enliven17:mainfrom
Tekgodfrey:feat/issue-403-event-metadata

Conversation

@Tekgodfrey

Copy link
Copy Markdown
  • Dual emit tls_crt2 and name_reg2 events with schema version alongside old events
  • Add UnsupportedVersionError to off-chain TypeScript parser
  • Update event fixtures and tests to verify decoding and rejection of unsupported versions
  • Document new events and fix fee_chg table formatting in README.md

Summary

This PR addresses the need for the on-chain event consumers to be resilient to future contract schema changes without breaking the existing indexing infrastructure. It implements a dual-emission strategy for the talos_registry and talos_name_service contracts, where version-aware events (tls_crt2 and name_reg2) are now emitted alongside the original tls_crt and name_reg events. A new version field (u32) was explicitly added to these v2 payloads.

Furthermore, strict rejection handling (UnsupportedVersionError) was added to the TypeScript off-chain decoder in event-query.ts to ensure that it explicitly rejects any event version it doesn't recognize rather than attempting to decode it with outdated schema logic.

Related Issues

Closes #403

Test Plan

  • Automated tests run:
    • cargo test executed in contracts/talos_registry (76/76 tests passing).
    • cargo test executed in contracts/talos_name_service (42/42 tests passing).
    • pnpm --dir contracts test:fixtures executed (36/36 tests passing).
  • Manual verification steps performed:
      1. Hand-crafted a malformed event fixture with an unsupported version (version: 2) inside event_fixtures.json.
      1. Verified that the TypeScript indexer correctly throws an UnsupportedVersionError when iterating over the new malformed fixture.
  • Relevant docs updated when setup, environment variables, or workflows changed (Updated README.md and EVENTS.md with new schema properties).

Visual Changes (if applicable)

N/A (Backend / Smart Contract event schema updates only)

Checklist

  • I have read the CONTRIBUTING.md guide.
  • My code follows the style guidelines of this project.
  • I have updated .env.example files and documentation if I changed environment variables.
  • My changes generate no new warnings or errors.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

…iven17#403)

- Dual emit tls_crt2 and name_reg2 events with schema version alongside old events

- Add UnsupportedVersionError to off-chain TypeScript parser

- Update event fixtures and tests to verify decoding and rejection of unsupported versions

- Document new events and fix fee_chg table formatting in README.md
@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

@Tekgodfrey is attempting to deploy a commit to the Cankat's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(contracts): version registry and name-service event metadata

1 participant