Skip to content

fix(maintenance-pool): report the live balance in the exceeds-balance error - #650

Closed
yggdrasilworld wants to merge 3 commits into
MergeFi:mainfrom
yggdrasilworld:fix/pool-stale-balance-608
Closed

yggdrasilworld wants to merge 3 commits into
MergeFi:mainfrom
yggdrasilworld:fix/pool-stale-balance-608

Conversation

@yggdrasilworld

@yggdrasilworld yggdrasilworld commented Oct 14, 2026 •

Copy link
Copy Markdown

What

assignReward's "exceeds pool balance" error read pool.balance fetched before the atomic conditional UPDATE — under the concurrency this guard exists for (#274), that's stale and shows a higher balance than the real one.

The fix

Re-read the live balance (SELECT balance) when the conditional update returns 0 rows, so the error reports the actual current balance — not the pre-update snapshot.

Resolves #608 · Related: #274

Payment: Base USDC 0xD40Df5c27cEa7dd78A3c345401995c319589334e

… error

The error read pool.balance fetched BEFORE the atomic conditional UPDATE —
under the concurrency the guard exists for, it shows a stale (higher)
balance. Re-read the live balance for the message so it reports the real
current value.

Resolves MergeFi#608
@vercel

vercel Bot commented Oct 14, 2026

Copy link
Copy Markdown

@yggdrasilworld is attempting to deploy a commit to the chonilius' projects Team on Vercel.

A member of the Team first needs to authorize it.

yggdrasilworld and others added 2 commits October 18, 2026 21:49
The shared base carried half-written merge artifacts: an orphaned
invokeOnLockedEscrow block in escrow.service.ts, duplicated returns plus
a dead parsePagination in sponsors.controller.ts, and missing
describe/it closers in github-webhooks.service.spec.ts. Aligned each
with the intended form so the branch typechecks and its specs load.
@yggdrasilworld
yggdrasilworld deleted the fix/pool-stale-balance-608 branch October 19, 2026 02:33
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.

MaintenancePoolService.assignReward reports a stale balance in its 'exceeds pool balance' error

2 participants