Currently, on a new block we send an inv out with the hash of the new tip (and, after #5307, of all new blocks). With headers-first sync, we could instead just send out the headers immediately (they’re only 2.5 larger, and the peer would likely be fetching those anyway).
To do so, we need several changes:
- Have a means of negotiating that the peer wants headers instead of block invs.
- Modify the code to send out the headers immediately and bypass sending invs.
- Be able to trigger the direct-download fetch strategy based on learned headers. @sdaftuar Are you interested in this? You’ve been doing other block relay improvements.