-
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+sqldb: small fixes to address some inconsistencies between KV and native SQL invoice DB implementations #9050
invoices+sqldb: small fixes to address some inconsistencies between KV and native SQL invoice DB implementations #9050
Conversation
Important Review skippedAuto reviews are limited to specific labels. Labels to auto review (1)
Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
a126bee
to
f094b7f
Compare
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.
Nice work with these fixes! Great how even all of them combined weren't too involved.
@@ -204,6 +204,9 @@ replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2 | |||
// allows us to specify that as an option. | |||
replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display | |||
|
|||
// Temporary replace until the next version of sqldb is taged. | |||
replace github.com/lightningnetwork/lnd/sqldb => ./sqldb |
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.
If we merge this PR by itself first, then we can do the tag of this portion first, then merge the rest 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.
Perhaps best to merge this PR which contains @aakselrod's fixes, so the whole things goes in together.
When fetching an AMP invoice we sometimes filter HTLCs to selected set IDs, however we always kept the full AMP state which is irrelevant as it contains state for all AMP payments. This was a side effect of UpdateInvoice needing to serialize the whole invoice when storing after an update but it is an unwanted "feature" as users will need to filter to relevant set when listing an AMP payment or subsribing to an update.
Previously SQL invoice updater ignored the set ID hint when updating an AMP invoice resulting in update subscriptions returning all of the AMP state as well as all AMP HTLCs. This commit synchornizes behavior with the KV implementation such that we now only return relevant AMP state and HTLCs when updating an AMP invoice.
Previously, the SQL implementation of the invoice query simply converted the start and end timestamps to time and used them in SQL queries to check for inclusivity. However, this logic failed when the start and end timestamps were equal. This commit addresses and corrects this issue.
bf0d8ad
to
2c2537e
Compare
2c2537e
to
1f7ac8e
Compare
Native sql tests were green in the last run! Kicking the other failed tests to see if they're flakes. |
This PR fixes a few inconsistencies between KV and native SQL invoice DB implementations that caused numerous test failures on our CI:
Now includes changes from #9022:
The PR fixes the following test:
make itest backend=btcd dbbackend=postgres nativesql=true icase=sendpayment_amp_invoice
Note that the sendpayment_amp_invoice_repeat test is not fixed by this. Also note that this depends on #9021 to unmask the test failure.