Skip to content

Update CIP-179 indexing and survey support to v5#70

Open
Cerkoryn wants to merge 2 commits into
nomos-guild:mainfrom
Cerkoryn:feat/cip-179-v5
Open

Update CIP-179 indexing and survey support to v5#70
Cerkoryn wants to merge 2 commits into
nomos-guild:mainfrom
Cerkoryn:feat/cip-179-v5

Conversation

@Cerkoryn

Copy link
Copy Markdown
Contributor

Summary

Updates CGov API’s existing CIP-179 implementation to the stable v5 specification, superseding the earlier implementation introduced in #44.

  • Replaces the legacy local codec and tally implementation with the reusable cip-179 package.
  • Extracts CIP-179 survey links from governance action metadata.
  • Indexes and validates native label-17 survey definitions, responses, and cancellations.
  • Verifies transaction proofs, survey ownership, linked-action constraints, and response eligibility.
  • Supports public survey aggregation and produces finalized v5 tally artifacts.
  • Adds the database migration, API responses, synchronization endpoint, and deployment configuration required by the new implementation.
  • Removes obsolete data structures and ingestion logic from the earlier CIP-179 version.

This API change accompanies the CGov frontend implementation in cgov#132.

Separate Bug Fix

The second commit contains an independent DRep verification fix that is not specific to CIP-179.

Vote ingestion can create an incomplete DRep database record before the regular DRep inventory sync populates its registration data. These incomplete records were previously treated as authoritative, which
could incorrectly disable the governance vote buttons.

The fix refreshes incomplete DRep records from Koios before determining voting eligibility and adds a focused regression test. It is kept in a separate commit so it can be reviewed independently from the
CIP-179 implementation.

Verification

  • npm run build
  • npx jest --runInBand test/cip179-v5.test.ts test/drep-lookup.test.ts
  • npx prisma validate

All six focused CIP-179 tests and both DRep verification regression tests pass. The Prisma schema is valid.

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.

1 participant