ACINQ / eclair

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

Flaky test in StandardChannelIntegration*Spec (txn-mempool-conflict) #2869

Closed remyers closed 3 months ago

remyers commented 3 months ago

When I locally run mvn test I sometimes get a failure with the test "punish a node that has published a revoked commit tx". I first saw this error while testing with bitcoind 27.1RC1 in PR #2862, but now I also see it after I rolled back to master at 3bb5f3e to test with bitcoind 26.1 .

I have also seen this error in StandardChannelIntegrationWithEclairSignerSpec which runs the same tests as StandardChannelIntegrationSpec.

The mempool acceptance error txn-mempool-conflict in the stack trace indicates that a conflicting tx has already spent the commitment tx output used as an input for an htlcSuccess or htlcTimeout tx and the conflicting tx does not have RBF enabled.


StandardChannelIntegrationWithEclairSignerSpec:

- punish a node that has published a revoked commit tx *** FAILED ***
  java.lang.AssertionError: assertion failed: expected e9c4f9cee4357c1d5449bd3e531a2c0b65fa6769bbc409da48b408b98d275c68, found Failure(fr.acinq.eclair.blockchain.bitcoind.rpc.JsonRPCError: txn-mempool-conflict (code: -26))
  at scala.Predef$.assert(Predef.scala:279)
  at akka.testkit.TestKitBase.expectMsg_internal(TestKit.scala:462)
  at akka.testkit.TestKitBase.expectMsg(TestKit.scala:438)
  at akka.testkit.TestKitBase.expectMsg$(TestKit.scala:438)
  at akka.testkit.TestKit.expectMsg(TestKit.scala:973)
  at fr.acinq.eclair.integration.StandardChannelIntegrationSpec.$anonfun$new$19(ChannelIntegrationSpec.scala:628)
  at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
  at org.scalatest.OutcomeOf.outcomeOf(OutcomeOf.scala:85)
  at org.scalatest.OutcomeOf.outcomeOf$(OutcomeOf.scala:83)
  at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)

I have seen it fail trying to publish both htlcSuccess.head and htlcTimeout.head transactions

    bitcoinClient.publishTransaction(htlcSuccess.head).pipeTo(sender.ref)
    sender.expectMsg(htlcSuccess.head.txid) <<<
    bitcoinClient.publishTransaction(htlcTimeout.head).pipeTo(sender.ref)
    sender.expectMsg(htlcTimeout.head.txid)  <<<
remyers commented 3 months ago

This also occurred with bitcoind 26.1 so not related to 27.1. I've fixed it with PR #2871 .