Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug]: unclean shutdown in funding causes ChannelFinalized to be missed #9414

Open
Crypt-iQ opened this issue Jan 13, 2025 · 2 comments
Open
Labels
bug Unintended code behaviour needs triage

Comments

@Crypt-iQ
Copy link
Collaborator

  • If a node is the funder in a funding flow and receives FundingSigned, funderProcessFundingSigned will be called: https://github.com/lightningnetwork/lnd/blob/e9dd01b60dd22a3e0181a1f4e924cb3d438fb518/funding/manager.go#L2683C19-L2683C45
  • If the node has an unclean shutdown of lnd immediately after a successful call to CompleteReservation here (

    lnd/funding/manager.go

    Lines 2778 to 2780 in e9dd01b

    completeChan, err := resCtx.reservation.CompleteReservation(
    nil, commitSig,
    )
    ), then potentially some of the below calls won't ever execute if they're not also handled in the restart case. A similar thing happens in the CompleteReservationSingle case. The only call I found that was missed on restart was the ChannelFinalized call to the AuxController:

    lnd/funding/manager.go

    Lines 2835 to 2840 in e9dd01b

    err = fn.MapOptionZ(
    f.cfg.AuxFundingController,
    func(controller AuxFundingController) error {
    return controller.ChannelFinalized(cid.tempChanID)
    },
    )
@Crypt-iQ Crypt-iQ added bug Unintended code behaviour needs triage labels Jan 13, 2025
@Crypt-iQ Crypt-iQ changed the title [bug]: unclean shutdown in funding causes ntfns to be missed [bug]: unclean shutdown in funding causes ChannelFinalized to be missed Jan 13, 2025
@dstadulis
Copy link
Collaborator

unclean shutdown

clarifying:
unclean shutdown = premature shutdown? e.g. a call doesn't sufficiently block shutdown
or
unclean shutdown = mutated state is written

@Crypt-iQ
Copy link
Collaborator Author

@dstadulis The process itself uncleanly shuts down (e.g. killed by oom-killer or something)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unintended code behaviour needs triage
Projects
None yet
Development

No branches or pull requests

2 participants