Skip to content

fix: use unique proposal-based IDs for ProposalMetadata entities#165

Merged
hudsonhrh merged 1 commit intomainfrom
hudsonhrh/washington-v6
Apr 16, 2026
Merged

fix: use unique proposal-based IDs for ProposalMetadata entities#165
hudsonhrh merged 1 commit intomainfrom
hudsonhrh/washington-v6

Conversation

@hudsonhrh
Copy link
Copy Markdown
Member

Summary

  • Uses the proposal entity ID (contractAddress-proposalId) instead of the IPFS CID as the ProposalMetadata entity ID, so each proposal gets its own immutable metadata entity
  • Fixes the indexer crash at block 45679972 on gnosis caused by two proposals (55 and 56) sharing the same IPFS CID — in specVersion >= 1.0.0, each block's file data source handler runs in a separate offchain causality region and can't see entities from other blocks, causing a duplicate INSERT on the immutable entity
  • Applied consistently across hybrid-voting.ts, direct-democracy-voting.ts, and proposal-metadata.ts

Test plan

  • npm run codegen passes
  • npm run build passes
  • All 241 tests pass
  • subgraph-lint — 0 errors (7 pre-existing warnings)
  • Deploy to gnosis and verify indexer syncs past block 45679972

🤖 Generated with Claude Code

…SERT conflicts

When two proposals share the same IPFS CID across different blocks, the immutable
ProposalMetadata entity would crash the indexer with a duplicate INSERT — each block's
file handler runs in a separate offchain causality region and can't see the other's
entities. This fix uses the proposal entity ID instead of the CID as the metadata
entity ID, giving each proposal its own metadata entity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@hudsonhrh hudsonhrh merged commit 30721fb into main Apr 16, 2026
2 checks passed
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