From 24fdae2a871a3e56b866aeab7634785b1fffd8c5 Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Fri, 16 Oct 2015 13:12:14 -0400 Subject: [PATCH 1/4] New BIP for "sendheaders" p2p message --- bip-sendheaders.mediawiki | 43 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 bip-sendheaders.mediawiki diff --git a/bip-sendheaders.mediawiki b/bip-sendheaders.mediawiki new file mode 100644 index 00000000..df96f80e --- /dev/null +++ b/bip-sendheaders.mediawiki @@ -0,0 +1,43 @@ +
+  BIP: 
+  Title: sendheaders message
+  Author: Suhas Daftuar 
+  Status: Draft
+  Type: Standards Track
+  Created: 2015-05-08
+
+ +==Abstract== + +Add a new message, "sendheaders", which indicates that a node prefers to receive new block announcements via a "headers" message rather than an "inv". + +==Motivation== + +Since the introduction of "headers-first" downloading of blocks in 0.10, blocks will not be processed unless +they are able to connect to a (valid) headers chain. Consequently, block relay generally works +as follows: +# A node (N) announces the new tip with an "inv" message, containing the block hash +# A peer (P) responds to the "inv" with a "getheaders" message (to request headers up to the new tip) and a "getdata" message for the new tip itself +# N responds with a "headers" message (with the header for the new block along with any preceding headers unknown to P) and a "block" message containing the new block + +However, in the case where a new block is being announced that builds on the tip, it would be generally more efficient if the node N just announced the block header for the new block, rather than just the block hash, and saved the peer from generating and transmitting the getheaders message (and the required block locator). + +In the case of a reorg, where 1 or more blocks are disconnected, nodes currently just send an "inv" for the new tip. Peers currently are able to request the new tip immediately, but wait until the headers for the intermediate blocks are delivered before requesting those blocks. By announcing headers from the last fork point leading up to the new tip in the block announcement, peers are able to request all the intermediate blocks immediately. + +==Specification== + +# The sendheaders message is defined as an empty message where pchCommand == "sendheaders" +# Upon receipt of a "sendheaders" message, the node will be permitted, but not required, to announce new blocks by sending the header of the new block (along with any other blocks that a node believes a peer might need in order for the block to connect). +# Feature discovery is enabled by checking protocol version >= 70012 + +==Backward compatibility== + +Older clients remain fully compatible and interoperable after this change. + +==Implementation== + +https://github.com/bitcoin/bitcoin/pull/6494 + +==Copyright== + +This document is placed in the public domain. From c8c6b251eb709eca652f01e75f93d506ac4cda4c Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Fri, 16 Oct 2015 16:09:28 -0400 Subject: [PATCH 2/4] Add section on additional constraints --- bip-sendheaders.mediawiki | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bip-sendheaders.mediawiki b/bip-sendheaders.mediawiki index df96f80e..b1102b61 100644 --- a/bip-sendheaders.mediawiki +++ b/bip-sendheaders.mediawiki @@ -30,6 +30,10 @@ In the case of a reorg, where 1 or more blocks are disconnected, nodes currently # Upon receipt of a "sendheaders" message, the node will be permitted, but not required, to announce new blocks by sending the header of the new block (along with any other blocks that a node believes a peer might need in order for the block to connect). # Feature discovery is enabled by checking protocol version >= 70012 +==Additional constraints== + +As support for sendheaders is optional, software that implements this may also optionally impose additional constraints, such as only honoring sendheaders messages shortly after a connection is established. + ==Backward compatibility== Older clients remain fully compatible and interoperable after this change. From 6721b0b1cb9ca32c5661f1b75d62eb640a9a8e5d Mon Sep 17 00:00:00 2001 From: Suhas Daftuar Date: Fri, 23 Oct 2015 14:30:43 -0400 Subject: [PATCH 3/4] Update with assigned BIP number (130) --- bip-sendheaders.mediawiki => bip-0130.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename bip-sendheaders.mediawiki => bip-0130.mediawiki (99%) diff --git a/bip-sendheaders.mediawiki b/bip-0130.mediawiki similarity index 99% rename from bip-sendheaders.mediawiki rename to bip-0130.mediawiki index b1102b61..56184e31 100644 --- a/bip-sendheaders.mediawiki +++ b/bip-0130.mediawiki @@ -1,5 +1,5 @@
-  BIP: 
+  BIP: 130
   Title: sendheaders message
   Author: Suhas Daftuar 
   Status: Draft

From 5f056b5b24dc23ac3cd1dbcd2d42ffc4b79e211e Mon Sep 17 00:00:00 2001
From: Suhas Daftuar 
Date: Fri, 23 Oct 2015 14:38:48 -0400
Subject: [PATCH 4/4] Add BIP-130 to README

---
 README.mediawiki | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/README.mediawiki b/README.mediawiki
index 94537b76..5e4fee71 100644
--- a/README.mediawiki
+++ b/README.mediawiki
@@ -361,6 +361,12 @@ Those proposing changes should consider that ultimately consent may rest with th
 | Eric Lombrozo
 | Informational
 | Draft
+|-
+| [[bip-0130.mediawiki|130]]
+| sendheaders message 
+| Suhas Daftuar
+| Standard
+| Draft
 |}