From b81f831d66886157f9ca8c3f3457579f4bec92ae Mon Sep 17 00:00:00 2001 From: IronGauntlets Date: Thu, 9 Nov 2023 21:06:05 +0000 Subject: [PATCH] Add `CurrentBlockHeaderRequest{}` The response to `CurrentBlockHeaderRequest{}` is the peer's local current header. This can be used to get a rough idea of what the latest block is as viewed by other peers on the network. The header can be compared with a subset of peers to determine an efficient way of pulling blocks from the network while syncing. Initially, we modified the iteration message to include a `latest` option, however, since the iteration message is shared by multiple requests it didn't make sense for each of the messages to have access to it. --- p2p/proto/block.proto | 2 ++ 1 file changed, 2 insertions(+) diff --git a/p2p/proto/block.proto b/p2p/proto/block.proto index d8e30dd..ef521dd 100644 --- a/p2p/proto/block.proto +++ b/p2p/proto/block.proto @@ -45,6 +45,8 @@ message NewBlock { } } +// Requests a peer's CurrentBlockHeader +message CurrentBlockHeaderRequest {} // result is (BlockHeader, Signature?)* in order of creation (incr/dec) message BlockHeadersRequest {