feat: add max_votes_per_option support to amaci circuits, sdk and con…#23
Open
99Kies wants to merge 3 commits into
Open
feat: add max_votes_per_option support to amaci circuits, sdk and con…#2399Kies wants to merge 3 commits into
99Kies wants to merge 3 commits into
Conversation
…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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…tracts