mirror of
https://github.com/lightninglabs/faraday.git
synced 2026-08-13 12:33:35 +02:00
itest: bump lnd to v0.21.0-beta and fix close flakes
Bump the integration test lnd binary to v0.21.0-beta. Two test fixes are required for the new version: - nodereport: the anchor commitment close fee changed by 10 sat, update the hardcoded CHANNEL_CLOSE_FEE expectation from 4535 to 4525 sat. - test_context: closeChannel mined a block while still waiting for the pending close update, which confirmed the force close tx out of the mempool before its fee could be read, causing a 'Transaction not in mempool' failure. Only start mining once the close fee has been captured from the mempool.
This commit is contained in:
parent
0402279352
commit
689cfdd55b
3 changed files with 19 additions and 7 deletions
|
|
@ -4,7 +4,7 @@
|
|||
# binaries required to run the tests with.
|
||||
FROM golang:1.25.10-alpine as builder
|
||||
|
||||
ARG LND_VERSION=dd65ba2b01063c4b6e3022835168b19a204f9408
|
||||
ARG LND_VERSION=v0.21.0-beta
|
||||
|
||||
RUN apk add --no-cache git make
|
||||
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ func TestNodeAudit(t *testing.T) {
|
|||
|
||||
expected[accounting.FeeReference(closeTx.String())] = expectedReport{
|
||||
eventType: frdrpc.EntryType_CHANNEL_CLOSE_FEE,
|
||||
amount: lnwire.MilliSatoshi(4535 * 1000),
|
||||
amount: lnwire.MilliSatoshi(4525 * 1000),
|
||||
onChain: true,
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -299,8 +299,9 @@ func (c *testContext) closeChannel(client lndclient.LightningClient,
|
|||
require.NoError(c.t, err, "could not close channel")
|
||||
|
||||
var (
|
||||
closeTx chainhash.Hash
|
||||
closeFee btcutil.Amount
|
||||
closeTx chainhash.Hash
|
||||
closeFee btcutil.Amount
|
||||
gotPending bool
|
||||
)
|
||||
|
||||
// Wait for us to get an update from our channel indicating that it is
|
||||
|
|
@ -314,7 +315,10 @@ func (c *testContext) closeChannel(client lndclient.LightningClient,
|
|||
case *lndclient.PendingCloseUpdate:
|
||||
// Get our close tx from the mempool to get its fee
|
||||
// and add an expected entry because we opened the
|
||||
// channel so we pay the fees.
|
||||
// channel so we pay the fees. This must happen
|
||||
// before we mine any block, otherwise the close tx
|
||||
// is confirmed out of the mempool and the lookup
|
||||
// fails.
|
||||
close, err := c.bitcoindClient.GetMempoolEntry(
|
||||
closeTx.String(),
|
||||
)
|
||||
|
|
@ -323,6 +327,8 @@ func (c *testContext) closeChannel(client lndclient.LightningClient,
|
|||
closeFee, err = btcutil.NewAmount(close.Fee)
|
||||
require.NoError(c.t, err, "could not get fee")
|
||||
|
||||
gotPending = true
|
||||
|
||||
case *lndclient.ChannelClosedUpdate:
|
||||
return true
|
||||
}
|
||||
|
|
@ -331,9 +337,15 @@ func (c *testContext) closeChannel(client lndclient.LightningClient,
|
|||
c.t.Fatalf("error closing channel: %v, %v", channel,
|
||||
err)
|
||||
|
||||
// If we have not received an update yet, mine a block.
|
||||
// If we have not received an update yet, wait for the pending
|
||||
// close to broadcast. Only once we have captured the close tx
|
||||
// fee from the mempool do we start mining blocks to drive the
|
||||
// channel to its fully resolved state, so that mining does not
|
||||
// confirm the close tx before we read its fee.
|
||||
default:
|
||||
c.mine()
|
||||
if gotPending {
|
||||
c.mine()
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue