Skip to content
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

paymod: Activate the new payment flow for good (part 04) #3826

Merged
merged 9 commits into from
Jul 13, 2020

Conversation

cdecker
Copy link
Member

@cdecker cdecker commented Jul 8, 2020

This is the last step in activating the new payment flow.

  • It removes all the compat changes to tests done in the previous parts and now uses the updated RPC everywhere
  • Added a legacy option to pay (and legacypay in order not to cause param failures) to fall back on the old implementation should there be an issue.
  • Fixed a tiny regression with flapping payment status if we happen to wait for the blockheights to match up.

We informally decided to activate the new payment flow for everybody and provide an escape hatch, for users that require the legacy payment model.

Open questions

  • Do we need a legacypay exposed via JSON-RPC at all, or should we only expose via legacy flag on the pay command?

Changelog-None

@cdecker cdecker added this to the v0.9.0 milestone Jul 8, 2020
@cdecker cdecker self-assigned this Jul 8, 2020
@rustyrussell
Copy link
Contributor

* [ ]  Do we need a `legacypay` exposed via JSON-RPC at all, or should we only expose via `legacy` flag on the `pay` command?

Removing parameters is hard. Let's just call it legacypay and remove it later.

Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

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

Ack b3b532d

But prefer not to add YA pay flag we'll have to deprecate...

Copy link
Collaborator

@niftynei niftynei left a comment

Choose a reason for hiding this comment

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

ACK b3b532d

@cdecker cdecker force-pushed the paymod-04 branch 2 times, most recently from c83413e to a384e69 Compare July 9, 2020 20:11
@cdecker cdecker requested a review from rustyrussell July 9, 2020 20:18
@cdecker
Copy link
Member Author

cdecker commented Jul 9, 2020

I removed the legacy parameter from pay and kept the old pay code in legacypay unchanged. This way we'll just have to phase out legacypay once COMPAT_090 gets removed.

@cdecker cdecker dismissed rustyrussell’s stale review July 10, 2020 08:48

legacy argument removed from pay

@cdecker cdecker force-pushed the paymod-04 branch 2 times, most recently from fbb9798 to 6ae5e18 Compare July 10, 2020 18:05
As suggested during the paymod-03 review it is better to activate the new code
right away, and give users an escape hatch to use the legacy code instead. The
way I implemented it allows using either `legacypay` or `pay` and then set
`legacy` to switch to the other implementation.

Changelog-Added: JSON-RPC: The `pay` command now uses the new payment flow, the new `legacypay` command can be used to issue payment with the legacy code if required.

Suggested-by: Rusty Russell <@rustyrussell>
Suggested-by: ZmnSCPxj <@ZmnSCPxj>
@cdecker
Copy link
Member Author

cdecker commented Jul 13, 2020

Rebased on top of #3792 now in master and added some more minor fixes.

This was causing the state flapping test to fail, since we were yielding
control of the io_loop, waiting for the blockheight to be reached, and not
setting the status beforehand. An interim `paystatus` call would then find a
failed leaf and deduce the entire payment failed. Setting it back to the
previous state keeps the overall payment pending while we wait.
Tests were timing out, and there is no point in artificially limiting
ourselves if we can be quicker.
We were wrongfully identifying all payment failures as blockheight mismatches.
Amount, parent_part_id  and own partid can be helpful when debugging.
We were applying the fee exemption to all payments individually, which is ok
until we switch to MPP, where amounts change. Also the log entry was referring
to the total amount, and not the fee of the payment.
Copy link
Contributor

@rustyrussell rustyrussell left a comment

Choose a reason for hiding this comment

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

Ack 55e1aa8

@rustyrussell rustyrussell merged commit 65963bc into master Jul 13, 2020
@rustyrussell rustyrussell deleted the paymod-04 branch August 15, 2022 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants