Repository navigation
feat(peering): decide and pay peer invoices within budgets #1168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
cf74f95
feat(peering): decide and pay peer invoices within budgets
Ferryx349 8c4df0c
fix(peering): restore buyer types and manual budget mutations
Ferryx349 241072c
Merge branch 'main' into feat/peering-auto-pay-2-policy
Ferryx349 c8af5b3
fix(peering): allow route-hint invoices and cover buyer policy in int…
Ferryx349 f39dcf5
fix(peering): expose auto-pay settings and harden budget reservation
Ferryx349 afd8718
fix(peering): bind both limit operands in the budget upsert
Ferryx349 9cec3d6
fix(peering): make a zero global budget an explicit no-cap
Ferryx349 43d485e
test(peering): cover buyer hold paths and payment failures
Ferryx349 e13d408
chore(peering): add the buyer policy changeset
Ferryx349 ff9c09b
fix(peering): keep paid charges and recover interrupted payments
Ferryx349 8c4c6bf
fix(peering): make payment recovery atomic and budget-complete
Ferryx349 bf301ce
Merge branch 'main' into feat/peering-auto-pay-2-policy
Ferryx349 4193086
fix(peering): require successful budget accounting before paying
Ferryx349 caea8df
test(peering): remove unused recovery fixture variables
Ferryx349 001499b
test(peering): restore the peer key in the auto-pay fixture
Ferryx349 b5af61a
fix(peering): recover paying invoices on redelivery and approval
Ferryx349 76a875f
fix(peering): recover a PAYING row when the claim is lost
Ferryx349 9c5917d
chore(peering): add a changeset for the buyer policy slice
Ferryx349 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| "nostream": minor | ||
| --- | ||
|
|
||
| feat(peering): enforce buyer budgets before paying peer invoices | ||
|
|
||
| Adds the buying-side policy: verify a peer invoice against its advertised | ||
| NIP-11 term, dedupe on the payment hash, reserve per-peer and global budget | ||
| counters atomically, pay through the configured wallet, and hold anything | ||
| outside the envelope for operator approval. |
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
13 changes: 13 additions & 0 deletions
13
migrations/20261119_120000_add_peering_invoice_global_budget_window.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| exports.up = async function (knex) { | ||
| await knex.schema.alterTable('peering_invoices', (table) => { | ||
| table.timestamp('global_budget_period_start', { useTz: true }).nullable() | ||
| table.timestamp('global_budget_period_end', { useTz: true }).nullable() | ||
| }) | ||
| } | ||
|
|
||
| exports.down = async function (knex) { | ||
| await knex.schema.alterTable('peering_invoices', (table) => { | ||
| table.dropColumn('global_budget_period_start') | ||
| table.dropColumn('global_budget_period_end') | ||
| }) | ||
| } |
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.