Skip to content

[bug]: failed to send payments in zero_conf-channel_policy_update_public_zero_conf #9912

Open
@yyforyongyu

Description

@yyforyongyu

Found from this build,

--- FAIL: TestLightningNetworkDaemon/tranche01/48-of-301/bitcoind/zero_conf-channel_policy_update_public_zero_conf (151.80s)
        harness_node.go:403: Starting node (name=Eve) with PID=18006
        harness_node.go:403: Starting node (name=Carol) with PID=18306
        harness_node.go:403: Starting node (name=Dave) with PID=18496
        harness_assertion.go:1087: 
            	Error Trace:	/home/runner/work/lnd/lnd/lntest/harness_assertion.go:1087
            	            				/home/runner/work/lnd/lnd/lntest/harness_assertion.go:1040
            	            				/home/runner/work/lnd/lnd/lntest/harness.go:1588
            	            				/home/runner/work/lnd/lnd/lntest/harness.go:1601
            	            				/home/runner/work/lnd/lnd/itest/lnd_zero_conf_test.go:673
            	            				/home/runner/work/lnd/lnd/itest/lnd_zero_conf_test.go:65
            	            				/home/runner/work/lnd/lnd/lntest/harness.go:303
            	            				/home/runner/work/lnd/lnd/itest/lnd_test.go:130
            	Error:      	Received unexpected error:
            	            	received error from payment stream: EOF
            	Test:       	TestLightningNetworkDaemon/tranche01/48-of-301/bitcoind/zero_conf-channel_policy_update_public_zero_conf
            	Messages:   	timeout while waiting payment
        harness.go:381: finished test: zero_conf-channel_policy_update_public_zero_conf, start height=574, end height=588, mined blocks=14
        harness.go:340: test failed, skipped cleanup
    lnd_test.go:138: Failure time: 2025-06-04 15:32:32.374

Eve tried to send a payment to Dave via Carol, but Carol cannot find the channel between her and Dave, causing the payment to fail,

2025-06-04 15:31:01.819 [DBG] HSWC link.go:4115: ChannelLink([ChanPoint: Eve=>Carol]): forwarding 1 packets to switch: replay=false
2025-06-04 15:31:01.822 [DBG] HSWC switch.go:2253: Querying outgoing link using chanID=583:1:0, aliasID=false
2025-06-04 15:31:01.822 [DBG] HSWC switch.go:2869: unable to find link with destination 583:1:0
2025-06-04 15:31:01.822 [ERR] HSWC switch.go:1238: UnknownNextPeer
2025-06-04 15:31:01.822 [ERR] HSWC switch.go:840: Unhandled error while reforwarding htlc settle/fail over htlcswitch: UnknownNextPeer
2025-06-04 15:31:01.822 [DBG] HSWC link.go:1926: ChannelLink([ChanPoint: Eve=>Carol]): queueing removal of FAIL closed circuit: (Chan ID=577:1:0, HTLC ID=0)->(Chan ID=583:1:0, HTLC ID=0)

It's like a bug in zeroconf or channel policy update, causing the channel to not be found here,

lnd/htlcswitch/switch.go

Lines 2285 to 2306 in 4a7cd00

// The outgoingChanID is a confirmed SCID. Attempt to fetch the base
// SCID from baseIndex.
baseScid, ok := s.baseIndex[chanID]
if !ok {
// outgoingChanID is not a key in base index meaning this
// channel did not have the option-scid-alias feature bit
// negotiated. We'll fetch the link and return it.
link, ok := s.forwardingIndex[chanID]
if !ok {
// The link wasn't found, bail out.
return nil, ErrChannelLinkNotFound
}
return link, nil
}
// Fetch the link whose internal SCID is baseScid.
link, ok := s.forwardingIndex[baseScid]
if !ok {
// Link wasn't found, bail out.
return nil, ErrChannelLinkNotFound
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1MUST be fixed or revieweditestsIssues related to integration tests.needs triagezero conf

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions