Fix/govenance bound snapshot ttl - #455
Open
awwalmust wants to merge 4 commits into
Open
Conversation
AbuJulaybeeb
requested changes
Aug 24, 2026
AbuJulaybeeb
left a comment
Contributor
There was a problem hiding this comment.
A very good and clean work.
KIndly resolve conflicts
…rch#134 - Add GET /api/donations endpoint with 'since' timestamp and 'projectId' query params to fetch donations created after a given timestamp for backfill on reconnect - Backfill validates and enforces required query parameters, returns up to 500 donations - Frontend hook maintains lastEventTimestampRef updated on every donation_event - On Socket.IO connect (including reconnections), invoke backfillMissedDonations() to fetch missed donations and process them through onDonation callback - Add comprehensive unit tests: - Test backfill on reconnect with simulated missed donations - Test fetch called with correct 'since' timestamp and projectId - Test graceful handling of backfill fetch failures - Test skipping backfill when no previous donations received Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
awwalmust
force-pushed
the
Fix/Govenance-bound-Snapshot-TTL
branch
from
August 25, 2026 23:15
a40da75 to
08ef833
Compare
Contributor
Author
|
The errors keep coming and coming |
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.
Description
Resolves #116
Prevents unbounded persistent storage growth in
dao-governance-contractby restrictingSnapshotTTL extensions to active proposal voting windows. Once a proposal is finalized (ExecutedorDefeated), itsSnapshotentries are no longer rent-bumped, allowing them to naturally expire from ledger state.Key Changes
contracts/dao-governance-contract/src/lib.rs): Updatedcast_vote/ proposal finalization logic so thatDataKey::Snapshot(proposal_id, voter)entries are only rent-extended while proposal status isActive.env.storage().persistent().has(&snap_key)checks remain fully functional throughout active voting windows.stdpanics.Storage Growth Analysis
u64+ VoterAddress+ boolean choice + key metadata).Acceptance Criteria Checklist
How Has This Been Tested?
cargo testacrossdao-governance-contract.Closes Contracts: dao-governance-contract's per-vote Snapshot entries accumulate forever with no archival path #116