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

track: Blockchain Lag #347

Closed
cdecker opened this issue Jan 5, 2024 · 1 comment
Closed

track: Blockchain Lag #347

cdecker opened this issue Jan 5, 2024 · 1 comment

Comments

@cdecker
Copy link
Collaborator

cdecker commented Jan 5, 2024

When a node is offline, it may start to accumulate /blockchain
lag/. Blockchain lag is defined as the number of blocks that are in
the blockchain, but that the node has not yet seen and processed.

A large blockchain lag can cause a number of symptoms:

  • Failing payments with WIRE_UNKNOWN_INVOICE_DETAILS / 16399
    despite the invoice definitely coming from the recipient: the CLTV
    is too low for the recipient to accept it, hence it sends back a
    signal that some choice on the sender was wrong. This can be a
    disagreement on payment rules, or in this case a disagreement on
    what is far enough in the future for the payment to be safe.
  • Missing incoming on-chain payment: we will see them and add them
    once we process the block that contained the transaction.
  • Missing confirmations for sent transactions, and missing spent
    marking of outputs used in a sent transaction: both of these will
    be set when we witness the transaction in a block. Before that you
    may refer to the reserved flag in listfunds to determine if an
    output is likely soon to be marked as spent and should therefore
    not be used. This reflects the intrinsic issue with confirmations
    on blockchains, since there is this limbo state between broadcast
    and confirmation, and so we chose to expose these details rather
    than pretending that broadcast is confirming.

For all of these the cause is the same, and addressing it,
automatically addresses them too. As such we are working on improving
the blockchain lag, by synchronizing in the background (not counted
towards the node's runtime for accounting!), and to optimize the sync
of the last couple of blocks for interactive (user) sessions.

@cdecker
Copy link
Collaborator Author

cdecker commented May 8, 2024

The blockchain lag issues have been resolved on the server side. With the inclusion of ElementsProject/lightning#7190, the problems related to small blockchain lag have also been mostly addressed. Closing.

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

No branches or pull requests

1 participant