-
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
htlcswitch: fix flake in TestChannelLinkCancelFullCommitment
#9221
htlcswitch: fix flake in TestChannelLinkCancelFullCommitment
#9221
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 (
|
ef158a0
to
d5cb942
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.
Thanks for the fix!
d5cb942
to
e669504
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.
I think we need to either change the description of the TestSwitchDustForwarding
or adopt the logic if I am not mistaken.
@@ -4318,22 +4318,12 @@ func TestSwitchDustForwarding(t *testing.T) { | |||
OnionBlob: blob, | |||
} | |||
|
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.
I tried to understand this testcase but tbh, I don't really understand it. In the description it says that we are testing the treshold here however I think what we are really testing is the channel contraint of the max_inflight_htlcs we are allowed to put onto a channel. So my question is what do we really want to test here.
When sending dust (sendDustHtlcs
) we are putting 50 htlcs onto the channel in each direction, the 51 one fails:
2024-10-31 10:28:31.426 [WRN] HSWC: ChannelLink(bcfe226d21c9936ee578df4afb65835abb9790392e45bbaf0c245394430838f8:0): Unable to handle downstream add HTLC: commitment transaction exceed max htlc number
2024-10-31 10:28:31.426 [DBG] HSWC: Storing result for attemptID=50
2024-10-31 10:28:31.439 [DBG] HSWC: Tearing down circuit with FAIL pkt, removing circuit=(Chan ID=0:0:0, HTLC ID=50) with keystone=(Chan ID=0:0:0, HTLC ID=0)
And all the followup tests just try to add another htlc to the link but its already blocked, so I think this testcase might be a relict of the former dust-treshold implementation, which now changed and is by default 500_000 sats ?
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.
the main test I think is in checkAlmostDust
or assertAlmostDust
, so this PR focuses on removing the test flakes, but yeah agree we should start making the tests here better since it gives flakes quite often.
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.
decreased the fee-exposure and made sure we hit the error of being overexposed and not hitting the error that we hit the channel contraint.
We bring down the max number of inflight HTLCs in the link's unit tests to speed up the tests.
e669504
to
8311bc5
Compare
As seen from this and other builds,