Blockstream / greenlight

Build apps using self-custodial lightning nodes in the cloud
https://blockstream.github.io/greenlight/getting-started/
MIT License
113 stars 27 forks source link

track: Receiving payments is slow when we have blockchain lag #448

Closed danielgranhao closed 1 month ago

danielgranhao commented 4 months ago

We've noticed one of our nodes consistently taking longer to receive payments when compared to the rest. This one takes around 1 minute while others take under 10 seconds.

The node ID is 035458b2dd3e2a89213f6ea4cb205463c6d1c3bbbafd30d77ffa1875e957ae1382

cdecker commented 4 months ago

Ok, looking into session_id=7197154242203648 from 2024-05-17T10:41:29+02:00

Timeline

Blockchain sync in progress from block 843708 to 843837.

Analysis

So the root cause for this 30 second receive is the blockchain lag that the node had at that time (129 blocks). Obviously the payment itself may have taken longer to find a route and actually route the payment to us, but that's the part we have control over.

Resolution

This is the counterpart to https://github.com/ElementsProject/lightning/pull/7190 which we just release a couple of weeks ago. We are planning to tackle this in two ways:

This may take a bit, as it requires going all the way up the stack to CLN to implement this, but it should be doable.

cdecker commented 1 month ago

Both regions are now back in sync with the blockchain, with individual stragglers due to different block processing speeds, depending on number of addresses we're checking for.