Skip to content

feat: add max_votes_per_option support to amaci circuits, sdk and con…#23

Open
99Kies wants to merge 3 commits into
mainfrom
feature/max-votes-per-option
Open

feat: add max_votes_per_option support to amaci circuits, sdk and con…#23
99Kies wants to merge 3 commits into
mainfrom
feature/max-votes-per-option

Conversation

@99Kies

@99Kies 99Kies commented Jul 18, 2026

Copy link
Copy Markdown
Collaborator

…tracts

  • add maxVotesPerOption signal to messageValidator/stateLeafTransformer/processMessages circuits (amaci/power)
  • pack maxVotesPerOption into the 4th 32-bit slot of packedVals (bits 96-127), 0 = unlimited (backward compatible)
  • sdk: operator.ts/voter.ts/contract.ts support configuring and validating maxVotesPerOption
  • contracts: amaci/registry/api-saas msg/state/contract updated to store, validate and query max_votes_per_option
  • regenerate test-scale (2-1-1-5) zkey/vkey and logs.json fixtures to match the updated circuits
  • add circuit unit tests (MessageValidator/StateLeafTransformer/ProcessMessages) and a full-round contract test driven by real generated proofs
  • fix generate-logs.ts: REQUIRED_REMOTE_ARTIFACTS was evaluated at module load before its referenced vars were assigned NOTE: production-scale (9-4-3-125) vkey/zkey has NOT been regenerated; a real trusted setup ceremony is still required before this can be deployed to production rounds.

…tracts

- add maxVotesPerOption signal to messageValidator/stateLeafTransformer/processMessages circuits (amaci/power)
- pack maxVotesPerOption into the 4th 32-bit slot of packedVals (bits 96-127), 0 = unlimited (backward compatible)
- sdk: operator.ts/voter.ts/contract.ts support configuring and validating maxVotesPerOption
- contracts: amaci/registry/api-saas msg/state/contract updated to store, validate and query max_votes_per_option
- regenerate test-scale (2-1-1-5) zkey/vkey and logs.json fixtures to match the updated circuits
- add circuit unit tests (MessageValidator/StateLeafTransformer/ProcessMessages) and a full-round contract test driven by real generated proofs
- fix generate-logs.ts: REQUIRED_REMOTE_ARTIFACTS was evaluated at module load before its referenced vars were assigned
NOTE: production-scale (9-4-3-125) vkey/zkey has NOT been regenerated;
a real trusted setup ceremony is still required before this can be
deployed to production rounds.
@vercel

vercel Bot commented Jul 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
maci Ready Ready Preview, Comment Jul 20, 2026 4:37am

Request Review

Regenerate AMaci/Registry/ApiSaas schema JSON and generated TS
client/types files (both contracts/*/ts and packages/sdk copies) so
the max_votes_per_option field/query added earlier is reflected in the
auto-generated bindings. Verified the two generated copies are
byte-identical (pre-existing Uint64 number/string discrepancy in
Registry.types.ts predates this change) and that packages/sdk builds
cleanly (tsc --build + tsup).
- amaci: add ExecuteMsg::SetMaxVotesPerOption, restricted the same way as
  SetRoundInfo (admin-only, only before voting starts); extract the 32-bit
  bound check into a shared validate_max_votes_per_option used by both
  instantiate and the new update path
- api-saas: add SetMaxVotesPerOption proxy execute msg (operator-gated,
  forwards to the target amaci round which enforces its own admin+timing
  checks)
- regenerate amaci/api-saas JSON schema and cosmwasm-ts-codegen TS
  client/types (both contracts/*/ts and packages/sdk mirrors)
- sdk: add setApiSaasMaciRoundMaxVotesPerOption and getMaxVotesPerOption
  to packages/sdk/src/libs/contract/contract.ts
- amaci multitest: add set_max_votes_per_option helper and 5 tests
  covering success-before-voting, PeriodError after/at voting start,
  Unauthorized for non-admin, and MaxVotesPerOptionExceeded on update
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