Skip to content

fix(ttl): extend instance storage TTL in keep_alive across all contracts (#566) - #764

Open
huangji6693-max wants to merge 1 commit into
MergeFi:mainfrom
huangji6693-max:fix/keep-alive-extend-instance-ttl-566
Open

huangji6693-max wants to merge 1 commit into
MergeFi:mainfrom
huangji6693-max:fix/keep-alive-extend-instance-ttl-566

Conversation

@huangji6693-max

Copy link
Copy Markdown

Closes #566

Problem

keep_alive in mergefi-escrow, mergefi-milestones, and mergefi-maintenance-pool extended the target persistent record and its sub-records, but never called extend_instance_ttl(&env). Because instance storage holds Admin, Oracle, Treasury, FeeBps, Paused, and MaxSponsors, a contract kept alive solely via keep_alive during a quiet period would allow its instance storage to archive.

Solution

  • Call extend_instance_ttl(&env) inside keep_alive in escrow, milestones, and maintenance-pool.
  • Add test_keep_alive_refreshes_instance_ttl in all three contracts advancing the ledger sequence past INSTANCE_TTL_THRESHOLD (50_000 ledgers remaining < 100_000 threshold) while calling only keep_alive, asserting instance TTL is restored to 500_000 ledgers.

Verification

  • CARGO_BUILD_JOBS=2 cargo test -p mergefi-escrow -- test_keep_alive_refreshes_instance_ttl (passed)
  • CARGO_BUILD_JOBS=2 cargo test -p mergefi-milestones -- test_keep_alive_refreshes_instance_ttl (passed)
  • CARGO_BUILD_JOBS=2 cargo test -p mergefi-maintenance-pool -- test_keep_alive_refreshes_instance_ttl (passed)
  • CARGO_BUILD_JOBS=2 cargo clippy --workspace --lib --locked -- -D warnings (0 warnings)

@vercel

vercel Bot commented Oct 27, 2026

Copy link
Copy Markdown

@huangji6693-max is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

This branch has not been deployed

No deployments
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.

keep_alive never refreshes instance storage, so a contract kept alive only via keep_alive can still archive Admin/Oracle/Treasury

1 participant