ACINQ / eclair

A scala implementation of the Lightning Network.
Apache License 2.0
1.24k stars 266 forks source link

Fix flaky test for punishing a published revoked commit #2871

Closed remyers closed 4 months ago

remyers commented 4 months ago

Fix flaky test for punishing a published revoked commit

A race exists because node C can publish the txs to spend the htlcs from the revoked commitment before F publishes their txs to spend two of the htlc outputs.

Instead we handle the rare case of a txn-mempool-conflict failure.

We will sometimes miss testing that C claims those two htlcs via 3rd stage txs.

codecov-commenter commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.94%. Comparing base (40f13f4) to head (aa3b823). Report is 3 commits behind head on master.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #2871 +/- ## ========================================== + Coverage 85.92% 85.94% +0.01% ========================================== Files 219 219 Lines 18488 18501 +13 Branches 794 792 -2 ========================================== + Hits 15886 15900 +14 + Misses 2602 2601 -1 ``` [see 2 files with indirect coverage changes](https://app.codecov.io/gh/ACINQ/eclair/pull/2871/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ)
remyers commented 4 months ago

@t-bast I've fixed this PR so that C can claim with 3rd stage txs most of the time, but if C happens to beat F in spending the htlcs directly from the revoked commit, it won't fail the test.