Skip to content

Feat/offchain non voters#1794

Merged
LeonardoVieira1630 merged 37 commits intodevfrom
feat/offchain_non_voters
Apr 9, 2026
Merged

Feat/offchain non voters#1794
LeonardoVieira1630 merged 37 commits intodevfrom
feat/offchain_non_voters

Conversation

@LeonardoVieira1630
Copy link
Copy Markdown
Member

@LeonardoVieira1630 LeonardoVieira1630 commented Mar 31, 2026

Summary

Add a new API endpoint (GET /offchain/proposals/{id}/non-voters) that returns active delegates who did not vote on a given offchain (Snapshot) proposal, enabling governance participation analysis. This also normalizes addresses to checksummed format in the offchain indexer to ensure consistent cross-schema joins.

Changes

  • API endpoint & controller (apps/api/src/controllers/votes/offchainNonVoters.ts): New OpenAPI route wired to the Hono app that accepts proposal ID, pagination, ordering, and optional address filter params
  • Repository (apps/api/src/repositories/votes/offchainNonVoters.ts): Cross-schema query using a LEFT JOIN between accountPower (public schema) and offchainVotes (snapshot schema) to identify delegates with voting power > 0 who did not vote, with pagination and address filtering
  • Unified Drizzle client (apps/api/src/database/index.ts, apps/api/cmd/index.ts): New UnifiedDrizzle type and pgUnifiedClient instance combining both schemas to support cross-schema queries
  • Service layer (apps/api/src/services/votes/offchainNonVoters.ts): Orchestrates repository calls, converts bigint voting power to string, and optimizes totalCount by using addresses.length when a filter is provided
  • Zod schemas (apps/api/src/mappers/proposals/offchainVoters.ts): Request/response validation schemas for the non-voters endpoint
  • Address normalization (apps/offchain-indexer/src/mappers/proposal.ts, apps/offchain-indexer/src/mappers/vote.ts): Added viem's getAddress transform to ensure proposal authors and voters are stored as EIP-55 checksummed addresses
  • Tests: Integration tests for the repository (PGlite-based) and unit tests for the service layer covering pagination, ordering, address filtering, and edge cases
  • Gateway schema (apps/api-gateway/schema.graphql): Regenerated with the new offchainProposalNonVoters query and enriched field descriptions

LeonardoVieira1630 and others added 8 commits March 26, 2026 17:45
Adds UnifiedDrizzle type (public + snapshot schemas combined) and a
_pgUnifiedClient in cmd/index.ts for future cross-schema queries such
as offchain non-voters. Applied fallback plan: existing offchain repos
keep OffchainDrizzle; _pgUnifiedClient is reserved for the new repository.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements the service layer (bigint→string conversion, totalCount logic)
and OpenAPI controller for GET /offchain/proposals/{id}/non-voters, wiring
OffchainNonVotersRepositoryImpl through the unified Drizzle client.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@LeonardoVieira1630 LeonardoVieira1630 self-assigned this Mar 31, 2026
@LeonardoVieira1630 LeonardoVieira1630 added the enhancement Improving an already existing feature label Mar 31, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
anticapture Ready Ready Preview, Comment Apr 9, 2026 4:58pm
anticapture-storybook Ready Ready Preview, Comment Apr 9, 2026 4:58pm

Request Review

@vercel vercel bot temporarily deployed to Preview – anticapture-storybook March 31, 2026 17:38 Inactive
@claude
Copy link
Copy Markdown

claude bot commented Mar 31, 2026

Claude encountered an error —— View job


I'll analyze this and get back to you.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 340b6d87ad

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3313d67962

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dff54aa7f6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53e5ea6d5b

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Only DAOs that support offchain data now get a unified pg client and
offchain route registration, removing the always-eager pgOffchainClient
and pgUnifiedClient. Repos updated to accept UnifiedDrizzle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8cef2e7ac6

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6c63270639

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

@LeonardoVieira1630 LeonardoVieira1630 merged commit cfb7d08 into dev Apr 9, 2026
6 checks passed
@LeonardoVieira1630 LeonardoVieira1630 deleted the feat/offchain_non_voters branch April 9, 2026 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API Dashboard enhancement Improving an already existing feature Gateway Indexer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants