Skip to content

Better Docs/Exposed Events for current-state-behind-peer #685

Closed

Description

@TheBlueMatt

When a peer gives us a channel_reestablish message that proves we're using an old state, we give an error message and hope they broadcast, then pass a ChannelMonitorUpdateStep::ChannelForceClosed to the monitor with should_broadcast set to false. This results in a somewhat-helpful error message logged (

"Channel {} need to be shutdown but closing transactions not broadcast due to We have fallen behind - we have received proof that if we broadcast remote is going to claim our funds - we can't do any automated broadcasting" followed by
"You have a toxic holder commitment transaction avaible in channel monitor, read comment in ChannelMonitor::get_latest_holder_commitment_txn to be informed of manual action to take")

but nothing further. get_latest_holder_commitment_txn's docs could probably describe the exact case a bit better, but we should also provide an Event that more programmatically alerts the user to what happened (probably also providing a general "channel closed" Event, which we currently do not do).

Lastly, because we call force_shutdown(false) from ChannelManager::process_pending_monitor_events() when we get a CommitmentTxBroadcasted event, we'll get the second log message above in the case that our counterparty went to chain, which is bogus.

Activity

  1. TheBlueMatt commented on Oct 1, 2025

    @TheBlueMatt
    CollaboratorAuthor

    We now panic if we get proof we're using an old state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions