-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
P4low priolow prioadvancedIssues suitable for very experienced developersIssues suitable for very experienced developersenhancementImprovements to existing features / behaviourImprovements to existing features / behavioursecurityGeneral label for issues/PRs related to the security of the softwareGeneral label for issues/PRs related to the security of the software
Milestone
Description
As of today, subsystems in lnd
subscribe to new blocks via RegisterBlockEpochNtfn
and process them independently. Since the speed of processing varies in subsystems, they may end up having a different view of the current best block, causing undefined behaviors. This happens more in itest than in reality, as block production is generally slow. To make sure every subsystem shares the same view, we could introduce a new service, blockbeat
, that handles producing new blocks, and other subsystems will consume the block and signal the consumption, in specific,
blockbeat
will be the only service that callsRegisterBlockEpochNtfn
. Upon receiving a new block, the service will send it to all its subscribers.- the subscribers will then consume the block, and signal back when the consumption is done.
blockbeat
will refuse to move ahead without receiving the done signals from all its subscribers, hence making sure all subsystems are sharing the same best block.blockbeat
can further handle reorg events, thus making all other subsystems handle it.
blockbeat
will behave as the heartbeat of lnd
, monitoring the subsystems to properly handle the blocks in a time-sensitive manner.
guggero, saubyk, ziggie1984 and bhandrasellemouton
Metadata
Metadata
Assignees
Labels
P4low priolow prioadvancedIssues suitable for very experienced developersIssues suitable for very experienced developersenhancementImprovements to existing features / behaviourImprovements to existing features / behavioursecurityGeneral label for issues/PRs related to the security of the softwareGeneral label for issues/PRs related to the security of the software