a188657b2f
In this commit, we introduce a new subsystem for the gossiper: the SyncManager. This subsystem is a major overhaul on the way the daemon performs the graph query sync state machine with peers. Along with this subsystem, we also introduce the concept of an active syncer. An active syncer is simply a GossipSyncer currently operating under an ActiveSync sync type. Before this commit, all GossipSyncer's would act as active syncers, which means that we were receiving new graph updates from all of them. This isn't necessary, as it greatly increases bandwidth usage as the network grows. The SyncManager changes this by requiring a specific number of active syncers. Once we reach this specified number, any future peers will have a GossipSyncer with a PassiveSync sync type. It is responsible for three main things: 1. Choosing different peers randomly to receive graph updates from to ensure we don't only receive them from the same set of peers. 2. Choosing different peers to force a historical sync with to ensure we have as much of the public network as possible. The first syncer registered with the manager will also attempt a historical sync. 3. Managing an in-order queue of active syncers where the next cannot be started until the current one has completed its state machine to ensure they don't overlap and request the same set of channels, which significantly reduces bandwidth usage and addresses a number of issues. |
||
---|---|---|
.. | ||
bootstrapper.go | ||
chan_series.go | ||
gossiper_test.go | ||
gossiper.go | ||
log.go | ||
message_store_test.go | ||
message_store.go | ||
mock_test.go | ||
reliable_sender_test.go | ||
reliable_sender.go | ||
sync_manager_test.go | ||
sync_manager.go | ||
syncer_test.go | ||
syncer.go | ||
utils.go |