Problem Statement
Every get_* in campaign/src/storage.rs calls bump_persistent, refreshing the TTL of the loaded entry on every call. This is desirable for frequently-updated campaign state but expensive for views called often by dashboards/UI.
For dashboard viewers, refreshing TTL on every poll pushes the eventual archival further out, but each refresh costs a host invocation. For light-traffic view-only callers (analytics pages that refresh every few seconds), the work is unnecessary.
Expected Outcome
Split reads into:
get_* — read-only, no TTL bump (cheap).
get_*_bumped — read + bump (for state-touching callers).
Update donate, claim_refund, release_milestone*, etc. to explicitly use _bumped reads. Views (analytics, dashboard) use plain get_*.
Acceptance Criteria
- All
#[contractimpl] analytics views (get_campaign_report, get_dashboard_metrics, etc.) use get_* (non-bumping).
- All mutating paths (
donate, claim_refund, release_*, etc.) use get_*_bumped.
- A new test
test_view_does_not_bump_ttl asserts a view call does not bump the TTL.
Implementation Notes
- Refactor
bump_persistent to remain internal (fn rather than pub fn).
- Add JSDoc-style comments on which path each name belongs to.
Affected Files / Modules
campaign/src/storage.rs
campaign/src/lib.rs (entrypoint usage)
campaign/src/views.rs
Dependencies — None.
Problem Statement
Every
get_*incampaign/src/storage.rscallsbump_persistent, refreshing the TTL of the loaded entry on every call. This is desirable for frequently-updated campaign state but expensive for views called often by dashboards/UI.For dashboard viewers, refreshing TTL on every poll pushes the eventual archival further out, but each refresh costs a host invocation. For light-traffic view-only callers (analytics pages that refresh every few seconds), the work is unnecessary.
Expected Outcome
Split reads into:
get_*— read-only, no TTL bump (cheap).get_*_bumped— read + bump (for state-touching callers).Update
donate,claim_refund,release_milestone*, etc. to explicitly use_bumpedreads. Views (analytics, dashboard) use plainget_*.Acceptance Criteria
#[contractimpl]analytics views (get_campaign_report,get_dashboard_metrics, etc.) useget_*(non-bumping).donate,claim_refund,release_*, etc.) useget_*_bumped.test_view_does_not_bump_ttlasserts a view call does not bump the TTL.Implementation Notes
bump_persistentto remain internal (fnrather thanpub fn).Affected Files / Modules
campaign/src/storage.rscampaign/src/lib.rs(entrypoint usage)campaign/src/views.rsDependencies — None.