Skip to content

Avoid re-persisting monitors if they are unchanged on startup #2852

Closed
@TheBlueMatt

Description

@TheBlueMatt

Our current startup ordering is (a) ChannelMonitors are loaded from disk, (b) ChannelManager is loaded from disk, possibly updating those ChannelMonitors, (c) the chain is synced on the monitors and manager, (d) the monitors are re-persisted to ensure any changes make it to disk (and that the monitors are in the ChainMonitor).

This is fine, except the re-persistence in step (d) is overkill in most cases where no changes were made during (b). If we move to doing all the changes from (b) via the ChannelMonitorUpdate pipeline (which we may, in fact, have already done? We've certainly mostly done it by now) then we may be able to skip it entirely, which would be a nice win. We'll want to balance that against the cost of replaying the chain again on next startup if we're on mobile and aren't going to stay up for very long.

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