Skip to content

Conversation

@ziggie1984
Copy link
Collaborator

@ziggie1984 ziggie1984 commented Oct 21, 2025

Builds on top of the latest payment SQL changes and threads the context through payment functions.

This is part 1 threads the context up to the Router Level. We can even further thread the context up to the rpc level, however we need to be careful which functions we allow to be canceled by the RPC level. But this is tackled in Part 2.

@ziggie1984 ziggie1984 changed the base branch from master to elle-payment-sql-series-new October 21, 2025 08:37
@ziggie1984 ziggie1984 force-pushed the introduce-sql-schema-payments-part-5 branch from 283469a to bc81c3a Compare October 21, 2025 08:43
@ziggie1984 ziggie1984 added payments Related to invoices/payments refactoring labels Oct 21, 2025
@ziggie1984 ziggie1984 added this to the v0.21.0 milestone Oct 21, 2025
@ziggie1984 ziggie1984 added this to v0.21 Oct 21, 2025
@ziggie1984 ziggie1984 self-assigned this Oct 21, 2025
@saubyk saubyk moved this to In progress in v0.21 Oct 23, 2025
@ziggie1984 ziggie1984 force-pushed the introduce-sql-schema-payments-part-5 branch from bc81c3a to 7e6cabd Compare November 11, 2025 17:51
@ziggie1984 ziggie1984 marked this pull request as ready for review November 11, 2025 17:59
@ziggie1984 ziggie1984 force-pushed the elle-payment-sql-series-new branch 4 times, most recently from e991cd0 to 6860702 Compare November 13, 2025 06:45
@ziggie1984 ziggie1984 force-pushed the introduce-sql-schema-payments-part-5 branch 2 times, most recently from a5be3ed to d76ffcd Compare November 16, 2025 14:51
@ziggie1984 ziggie1984 moved this from In progress to In review in v0.21 Nov 17, 2025
Copy link
Collaborator

@ellemouton ellemouton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice! quick question

// The context is already cancelled at this point, so we create
// a new context so the payment can successfully be marked as
// failed.
cleanupCtx := context.WithoutCancel(ctx)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm - i wonder if we should make it a timeout context so we dont let it run forever?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I want this to securly commit to the db without any timeout, if something is wrong with the db it will be shown here. I mean in case the db connection flakes, this call will nonetheless return an error. Introducing like a context with a random timeout felt not good design but open to change it if yy things its better to have a timeout call.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point i think it's easier to merge this PR and then address this question in a new PR, as most part of the PR is just passing the ctx, would be nice to merge first.

@ziggie1984 ziggie1984 force-pushed the elle-payment-sql-series-new branch 2 times, most recently from 47606dd to 01d9986 Compare November 20, 2025 13:26
@ziggie1984 ziggie1984 force-pushed the introduce-sql-schema-payments-part-5 branch 2 times, most recently from 3f22326 to 86ebeb7 Compare November 24, 2025 19:33
@ziggie1984 ziggie1984 force-pushed the introduce-sql-schema-payments-part-5 branch from 86ebeb7 to 736f645 Compare November 25, 2025 13:56
Copy link
Member

@yyforyongyu yyforyongyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚢

// The context is already cancelled at this point, so we create
// a new context so the payment can successfully be marked as
// failed.
cleanupCtx := context.WithoutCancel(ctx)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this point i think it's easier to merge this PR and then address this question in a new PR, as most part of the PR is just passing the ctx, would be nice to merge first.

@yyforyongyu yyforyongyu merged commit fcd4345 into lightningnetwork:elle-payment-sql-series-new Nov 27, 2025
36 of 38 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in v0.21 Nov 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

payments Related to invoices/payments refactoring

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants