Repository navigation
fix(accrual-keeper): keep accruing when state store is unclaimable - #1175
Conversation
|
@liutingqiu is attempting to deploy a commit to the Collins' projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@liutingqiu Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
Verified locally on this branch before asking for review. Full workspace suite, The regression test added here is Repro: |
4481c31 to
8812d4c
Compare
8812d4c to
603b9ad
Compare
|
The Commit Messages failure was only the 77-character subject line; I shortened it and left the code unchanged. The new workflow runs are waiting for maintainer approval (action_required), so CI cannot re-run yet. Could you approve the runs and take a look when you have a moment? Happy to adjust anything else. |
|
@collinsezedike The only failing check on this PR is Vercel's |
collinsezedike
left a comment
There was a problem hiding this comment.
Thanks for the fix, @liutingqiu. This is a solid contribution. If you'd like to pick up another open issue, there are several available in the tracker.
|
@liutingqiu thank you again for getting this over the line. If you are enjoying working on Meridian, starring the repository helps more contributors find the project and is much appreciated. |
|
Thanks—I’m enjoying contributing to Meridian and will star the repository to help more contributors find the project. |
Closes #1132
What was wrong
accrual-keeper.tsdocuments a deliberate fail-open whenprior.state === "unknown"(a state-store outage), then immediately takes aSubmissionLeasethrough the same store. When the store is unreachable,SubmissionLease.acquirereturns{ error: "submission state store unavailable" }and the old code pushed the adapter intoskipped— producing exactly the halted accrual the fail-open exists to prevent.Fix
The two failure modes of
acquireare now distinguished:accrue()re-syncs a cached value and costs one Soroban fee, which is cheaper than leaving every vault's TVL/APY stale for the length of the outage.leaseis now optional soreleaseIfUnsent()only runs when a claim was actually taken.Tests
accrual-keeper.test.tsgains a test for a full outage (both the prior read and the claim throw), asserting the adapter is not skipped, the submission still happens, and the "proceeding without a submission lease" warning is emitted. The existing test that only failsgetkeeps passing.Verification
No Postgres/network needed — this package's suite is fully mocked:
Both new tests fail on the pre-fix commit and pass after it.