-
Notifications
You must be signed in to change notification settings - Fork 3
Add Per-Ballot Token/Vote Limits #39
Copy link
Copy link
Open
Labels
GrantFox OSSIssue tracked in GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignCampaign: Official Campaign
Metadata
Metadata
Assignees
Labels
GrantFox OSSIssue tracked in GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official CampaignCampaign: Official Campaign
Type
Fields
Give feedbackNo fields configured for issues without a type.
��# Issue 20: Add Per-Ballot Token/Vote Limits
Problem
No upper bound on tokens or votes per ballot. Uncapped counts could exhaust ledger resources.
Solution
BallotLimits { max_tokens: u32, max_votes: u32 }structBallotMetadataduringrecord_ballotrecord_tokenandrecord_votebefore incrementingLimitExceedederror when limit reachedImplementation Tasks
BallotLimitsstructrecord_ballotparametersrecord_tokenandrecord_voteLimitExceedederror with current countNote for Contributors
Complete Issue #1 (ballot metadata storage) first. Limits are set during
record_ballotand are immutable thereafter. The ballots creator (or admin) specifies max_tokens and max_votes when creating the ballot. Zero limit means unlimited (or use u32::MAX for explicit "no limit"). When incrementing would exceed limit, return LimitExceeded error with current count. This prevents ballots from growing unbounded and exhausting ledger resources. Limits enable resource management for ballot operators. Consider implementing optional limits (configurable per ballot). Each ballot can have different limits. Limits do not prevent reading � only writes are blocked when limits are reached.