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

Expand #3313 test #3514

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Expand #3313 test #3514

wants to merge 4 commits into from

Conversation

shaavan
Copy link
Member

@shaavan shaavan commented Jan 9, 2025

Resolves #3320

This PR expands the test introduced in #3313 to include claiming the payment on-chain after Alice's node reloads. It ensures that, once we verify Alice's node does not reattempt paying a duplicate invoice, the payment process is also completed successfully.

Copy link
Member Author

@shaavan shaavan left a comment

Choose a reason for hiding this comment

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

Hi @TheBlueMatt ,

While trying to solve this issue, I ran into some questions and roadblocks. Would love to get your insights on these. Thanks!

Comment on lines +2284 to +2285
// ??: The amount need to be modified to match the total amount received to bob, why?
let amt_msat = nodes[0].node.list_usable_channels()[0].next_outbound_htlc_limit_msat + 1000; // Force MPP
Copy link
Member Author

Choose a reason for hiding this comment

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

It looks like the amt_msat needed to be changed to ensure it matches the amt_msat Bob receives. I’m not entirely sure why this change is required—would you happen to have any insights on why this might be happening?

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this is because test_default_channel_config() sets htlc_minimum_msat to 1000 so it gets rounded up in the router. Probably fine to just make this change, for that reason.

Comment on lines +2372 to +2376
match events[0] {
Event::PaymentSent { .. } => {},
Event::PaymentPathFailed { .. } => panic!("Received PaymentPathFailed"),
_ => panic!("Unexpected event")
}
Copy link
Member Author

Choose a reason for hiding this comment

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

The test ran successfully, but instead of the payment going through, it actually fails. I’m not sure if this is due to how I designed the test or if it’s unexpected behaviour in the code. Any insights you could share would be super helpful. Thanks so much, Matt!

Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, there needs to be a second channel opened between Alice and Bob so that Alice has a payment path to retry over. Will also need to adjust the Retry passed to pay_for_offer above.

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.

#3313 test should be expanded
2 participants