Repository navigation
fix: apply reward routing budget to payouts - #2479
Open
keshav0479 wants to merge 5 commits into
Open
keshav0479 wants to merge 5 commits into
keshav0479 wants to merge 5 commits into
Conversation
Member
|
Ey @keshav0479 sorry for taking this long but the recent security fixed caused conflicts with this PR |
keshav0479
force-pushed
the
fix/rewards-routing-budget-payment
branch
from
September 18, 2026 18:31
7e7b24d to
8399975
Compare
Contributor
Author
|
@KoalaSat updated this one too , now it should be fine |
gabbygator184
approved these changes
Oct 1, 2026
This branch has not been deployed
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.
What does this PR do?
Related to #1382. Follow-up to #2038 and #2364.
Reward invoice validation honored the submitted routing budget, but the actual payout still used the coordinator's default cap. Store the reward budget on the
LNPaymentand use that same absolute cap for validation and LND/CLN payment requests. Explicit budgets are deducted from the invoice amount; omitted or null budgets preserve the full reward amount and the default fee cap.Preserve rewards credited during a withdrawal. Successful payouts increment claimed rewards without clearing new credits; confirmed failures restore the full reserved balance. Pending or unknown outcomes keep the reservation. Atomic reward credits and scoped robot settings/identity writes prevent stale objects from overwriting balances.
Widen the budget and paid-fee columns with migration
0060. A 100,000,000-sat accumulated balance with a 100,000-ppm budget needs a 10,000,000-sat cap, which overflowed the old budget column before payment. Both the cap and a fee at that cap now fit, so the returned fee can also be saved after success.Update the reward tests to use the shared decoded-invoice format and import LND outside the CLN import mocks.
Correct the frontend fetch tests to accept the production minifier's optional HTML opening tag. The doctype, status, title, and bundle checks remain in place.
How tested
python manage.py test api.tests --verbosity 2 --noinput: 171 tests passed with LND selected, using PostgreSQL and Redis.LNVENDOR=CLN python manage.py test api.tests --shuffle 2479 --verbosity 2 --noinput: 171 tests passed.python manage.py makemigrations --check --dry-run.git diff --check.The local gRPC server checks the application and wire requests; the passing coordinator CI suites cover live Lightning trade flows and HTLC settlement.