Skip to content

Conversation

@ziggie1984
Copy link
Collaborator

@ziggie1984 ziggie1984 commented Nov 19, 2025

We now allow the mission control manager to skip over deserializable
errors. We cannot repair this these results but we just skip over
it so we can startup properly. Moreover we also delete those corrupted values.

So we still don't know why it happens so rarely now this problem is fixed anyways because we now validate the ExtraTLVData when receiving a payment error:

Invalid data gets rejected naturally: If a peer sends a ChannelUpdate with malformed ExtraOpaqueData:
- DecodeFailure() fails
- htlcswitch returns UnknownForwardingError (without the ChannelUpdate)
- Mission control stores the failure but without the corrupted ChannelUpdate data

So we basically only have to deal with old data here.

Copy link
Collaborator

@bhandras bhandras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🎉

Copy link
Collaborator

@bitromortac bitromortac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, it fixes the problem ⚡. It would be nice to remove that code again in the future if we can be sure we're in a clean state (and only allow future sane writes) for example using a possible migration to sql. Perhaps it would be good to add a TODO/issue for a future migration?

addresses](https://github.com/lightningnetwork/lnd/pull/10341) were added to
the node announcement and `getinfo` output.

* [Fix a startup issue in LND when ecounntering a
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: encountering

@ziggie1984 ziggie1984 force-pushed the bugfix/fix-mission-control-startup branch from 4749b60 to ca9ba1c Compare December 2, 2025 19:28
We now allow the mission control manager to skip over deserializable
errors. We cannot repair this these results but we just skip over
it so we can startup properly.

When fetchAll() encounters entries that fail to deserialize, in
addition to skipping them, now also:

- Delete the corrupted entries from the database
- Remove them from the in-memory keysMap and keys tracking structures

This prevents corrupted entries from:
- Being counted toward maxRecords, which would cause valid entries
  to be pruned prematurely
- Persisting in the database indefinitely
- Causing inaccurate entry counts in startup logs
@ziggie1984 ziggie1984 force-pushed the bugfix/fix-mission-control-startup branch from ca9ba1c to 17b77b6 Compare December 2, 2025 19:39
@ziggie1984
Copy link
Collaborator Author

added a TODO

@Roasbeef Roasbeef merged commit 140248b into lightningnetwork:master Dec 3, 2025
37 of 39 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in lnd v0.20 Dec 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[bug]: LND not able to startup if MissionControl encounters an error deserializing payment results

4 participants