ACINQ / eclair

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

Test bitcoind wallet behavior during mempool eviction #2817

Closed t-bast closed 8 months ago

t-bast commented 9 months ago

When transactions are being evicted from the mempool, we want to make sure that bitcoind keeps the corresponding wallet inputs locked to avoid accidentally double-spending ourselves. We update our unit tests to be closer to common scenarios (chain of unconfirmed splice txs, commit txs replaced by the remote version, anchor tx RBF and htlc txs conflicts).

These tests confirm that:

codecov-commenter commented 9 months ago

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (e66e6d2) 85.86% compared to head (e92291f) 85.90%. Report is 4 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 #2817 +/- ## ========================================== + Coverage 85.86% 85.90% +0.04% ========================================== Files 216 217 +1 Lines 18228 18296 +68 Branches 772 793 +21 ========================================== + Hits 15652 15718 +66 - Misses 2576 2578 +2 ``` | [Files](https://app.codecov.io/gh/ACINQ/eclair/pull/2817?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ) | Coverage Δ | | |---|---|---| | [...re/src/main/scala/fr/acinq/eclair/NodeParams.scala](https://app.codecov.io/gh/ACINQ/eclair/pull/2817?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ#diff-ZWNsYWlyLWNvcmUvc3JjL21haW4vc2NhbGEvZnIvYWNpbnEvZWNsYWlyL05vZGVQYXJhbXMuc2NhbGE=) | `93.41% <100.00%> (+0.02%)` | :arrow_up: | | [...r/acinq/eclair/blockchain/fee/OnChainFeeConf.scala](https://app.codecov.io/gh/ACINQ/eclair/pull/2817?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ#diff-ZWNsYWlyLWNvcmUvc3JjL21haW4vc2NhbGEvZnIvYWNpbnEvZWNsYWlyL2Jsb2NrY2hhaW4vZmVlL09uQ2hhaW5GZWVDb25mLnNjYWxh) | `95.00% <ø> (ø)` | | | [...q/eclair/channel/publish/ReplaceableTxFunder.scala](https://app.codecov.io/gh/ACINQ/eclair/pull/2817?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ#diff-ZWNsYWlyLWNvcmUvc3JjL21haW4vc2NhbGEvZnIvYWNpbnEvZWNsYWlyL2NoYW5uZWwvcHVibGlzaC9SZXBsYWNlYWJsZVR4RnVuZGVyLnNjYWxh) | `85.05% <100.00%> (+0.07%)` | :arrow_up: | | [.../scala/fr/acinq/eclair/payment/PaymentPacket.scala](https://app.codecov.io/gh/ACINQ/eclair/pull/2817?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ#diff-ZWNsYWlyLWNvcmUvc3JjL21haW4vc2NhbGEvZnIvYWNpbnEvZWNsYWlyL3BheW1lbnQvUGF5bWVudFBhY2tldC5zY2FsYQ==) | `91.45% <100.00%> (+1.27%)` | :arrow_up: | | [...la/fr/acinq/eclair/payment/relay/NodeRelayer.scala](https://app.codecov.io/gh/ACINQ/eclair/pull/2817?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ#diff-ZWNsYWlyLWNvcmUvc3JjL21haW4vc2NhbGEvZnIvYWNpbnEvZWNsYWlyL3BheW1lbnQvcmVsYXkvTm9kZVJlbGF5ZXIuc2NhbGE=) | `100.00% <100.00%> (ø)` | | | [.../scala/fr/acinq/eclair/payment/relay/Relayer.scala](https://app.codecov.io/gh/ACINQ/eclair/pull/2817?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ#diff-ZWNsYWlyLWNvcmUvc3JjL21haW4vc2NhbGEvZnIvYWNpbnEvZWNsYWlyL3BheW1lbnQvcmVsYXkvUmVsYXllci5zY2FsYQ==) | `89.13% <100.00%> (ø)` | | | [...air/payment/send/CompactBlindedPathsResolver.scala](https://app.codecov.io/gh/ACINQ/eclair/pull/2817?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ#diff-ZWNsYWlyLWNvcmUvc3JjL21haW4vc2NhbGEvZnIvYWNpbnEvZWNsYWlyL3BheW1lbnQvc2VuZC9Db21wYWN0QmxpbmRlZFBhdGhzUmVzb2x2ZXIuc2NhbGE=) | `100.00% <100.00%> (ø)` | | | [...scala/fr/acinq/eclair/payment/send/Recipient.scala](https://app.codecov.io/gh/ACINQ/eclair/pull/2817?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ#diff-ZWNsYWlyLWNvcmUvc3JjL21haW4vc2NhbGEvZnIvYWNpbnEvZWNsYWlyL3BheW1lbnQvc2VuZC9SZWNpcGllbnQuc2NhbGE=) | `98.63% <100.00%> (+2.79%)` | :arrow_up: | | [...a/fr/acinq/eclair/wire/protocol/PaymentOnion.scala](https://app.codecov.io/gh/ACINQ/eclair/pull/2817?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ#diff-ZWNsYWlyLWNvcmUvc3JjL21haW4vc2NhbGEvZnIvYWNpbnEvZWNsYWlyL3dpcmUvcHJvdG9jb2wvUGF5bWVudE9uaW9uLnNjYWxh) | `99.36% <ø> (+3.82%)` | :arrow_up: | | [...r-core/src/main/scala/fr/acinq/eclair/Eclair.scala](https://app.codecov.io/gh/ACINQ/eclair/pull/2817?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ#diff-ZWNsYWlyLWNvcmUvc3JjL21haW4vc2NhbGEvZnIvYWNpbnEvZWNsYWlyL0VjbGFpci5zY2FsYQ==) | `56.43% <80.00%> (+0.36%)` | :arrow_up: | | ... and [3 more](https://app.codecov.io/gh/ACINQ/eclair/pull/2817?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ) | | ... and [13 files with indirect coverage changes](https://app.codecov.io/gh/ACINQ/eclair/pull/2817/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ACINQ)