-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
invoices: amp invoices bugfix. #9459
Merged
Roasbeef
merged 2 commits into
lightningnetwork:master
from
ziggie1984:amp-htlc-invoices
Jan 31, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -1,8 +1,58 @@ | ||
## Bug Fixes | ||
# Release Notes | ||
- [Bug Fixes](#bug-fixes) | ||
- [New Features](#new-features) | ||
- [Functional Enhancements](#functional-enhancements) | ||
- [RPC Additions](#rpc-additions) | ||
- [lncli Additions](#lncli-additions) | ||
- [Improvements](#improvements) | ||
- [Functional Updates](#functional-updates) | ||
- [RPC Updates](#rpc-updates) | ||
- [lncli Updates](#lncli-updates) | ||
- [Breaking Changes](#breaking-changes) | ||
- [Performance Improvements](#performance-improvements) | ||
- [Technical and Architectural Updates](#technical-and-architectural-updates) | ||
- [BOLT Spec Updates](#bolt-spec-updates) | ||
- [Testing](#testing) | ||
- [Database](#database) | ||
- [Code Health](#code-health) | ||
- [Tooling and Documentation](#tooling-and-documentation) | ||
|
||
# Bug Fixes | ||
|
||
* [Fixed a bug](https://github.com/lightningnetwork/lnd/pull/9459) where we | ||
would not cancel accepted HTLCs on AMP invoices if the whole invoice was | ||
canceled. | ||
|
||
# New Features | ||
|
||
## Functional Enhancements | ||
|
||
## RPC Additions | ||
|
||
## lncli Additions | ||
|
||
|
||
# Improvements | ||
## Functional Updates | ||
## RPC Updates | ||
|
||
## lncli Updates | ||
## Code Health | ||
## Breaking Changes | ||
## Performance Improvements | ||
|
||
# Technical and Architectural Updates | ||
## BOLT Spec Updates | ||
|
||
## Testing | ||
## Database | ||
## Code Health | ||
|
||
* [Improved user experience](https://github.com/lightningnetwork/lnd/pull/9454) | ||
by returning a custom error code when HTLC carries incorrect custom records. | ||
|
||
## Tooling and Documentation | ||
|
||
# Contributors (Alphabetical Order) | ||
|
||
* Ziggie | ||
* Ziggie |
This file contains 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 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 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 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this changes behavior slightly as previously we'd pass in a pointer to an empty set id if the hint was
nil
whereas now we pass in thenil
which isn't considered the same as an empty set id. PTAL here on how it is used within this package:lnd/channeldb/invoices.go
Line 1579 in 32cdbb4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I know this is a change to the logic however I think it was a bug in the first place, for the
UpdateInvoice
functionality. Because UpdateInvoice will always update a state. Normally we should always have the setID set for AMP invoices. However now that we cancel also the AMP invoice we need to make sure we consider all HTLCs according all setIDs if we cancel the invoice (in case multiple attempts are in the accepted state across multiple setIDs).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moreover if it is not a AMP invoice in the first place this setting is irrelevant anyways:
We already prevent fetching it for non-AMP invoices here in the kv store:
lnd/channeldb/invoices.go
Lines 1541 to 1543 in f4bf99b
And also in the sql store:
lnd/invoices/sql_store.go
Lines 1556 to 1569 in f4bf99b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed this offline too. It's probably the best if we remove the
HtlcSetBlankModifier
altogether as it is not used anywhere.