Skip to content

lnwallet+peer: properly process update_fee messages sent after a shutdown has been initiated  #6522

@Roasbeef

Description

@Roasbeef

Today when we receive a shutdown requests, we'll remove the link from the switch entirely also (

lnd/peer/brontide.go

Lines 2695 to 2701 in ddeccf8

// Optimistically try a link shutdown, erroring out if it
// failed.
if err := p.tryLinkShutdown(chanID); err != nil {
peerLog.Errorf("failed link shutdown: %v", err)
req.Err <- err
return
}
). This means that any inbound messages to the link will be dropped from the peer's readHandler. This was fine when we wanted to not process any further updates, but breaks down given that the spec requires (being updated to make this more clear) that one still process updateFee messages after a shutdown has been sent (but before the first closing signed).

What we should still remove the link from the switch and send out a disable, but we need to special case for the sig+revoke and UpdateFee messages when we're in this state. One way to do this (given we already have the channel struct at that point) would be to manually feed in these messages into the channel state machine.

Steps To Completion

  • Update the readHandler loop to send any update messages post channel close into the chan closer
  • Have the chan close then manually apply only the UpdateFee message, generating the corresponding messages needed to fully lock in the change.

Metadata

Metadata

Assignees

Labels

P1MUST be fixed or reviewedchannel closingRelated to the closing of channels cooperatively and uncooperativelyspec

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions