-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server: Only send fast block anns to full nodes.
Fast block announcements were added a few years ago as a way to increase the propagation speed of new blocks that extend the main chain through the network to significantly reduce voting latency as well as how quickly proof-of-work miners discover new blocks. This is desirable behavior, however, it should only apply to full nodes since only they are equipped to deal with the fast announcements. As a case in point, header commitments and committed block filters can pose a problem for lightweight clients that rely on them in the case of fast block announcements because lightweight clients tend to request the filters as soon as they learn about the new blocks and those filters have not been created yet when fast block announcements are sent. Since there is network latency involved in the request process, the result is that sometimes the filters are available by the time the requests from lightweight clients are received and sometimes they are not. In order to help prevent the aforementioned case, and other similar ones, this modifies the code that deals with block announcements to only send fast block announcements to peers that advertise themselves as full nodes instead of all nodes and separates out the block announcement logic slightly to make future enhancements easier in the process. It also modifies the filtering of duplicate block announcements to work on a per peer basis since not all peers receive the fast block announcement now.
- Loading branch information
Showing
1 changed file
with
49 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters