Skip to content

Commit

Permalink
Increase MAX_PROTOCOL_MESSAGE_LENGTH
Browse files Browse the repository at this point in the history
Witness blocks can be greater than 2MiB, but cannot be validly greater
than 4MB.
  • Loading branch information
sdaftuar authored and sipa committed Jan 27, 2016
1 parent 940d74b commit 37973bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ static const int TIMEOUT_INTERVAL = 20 * 60;
static const unsigned int MAX_INV_SZ = 50000;
/** The maximum number of new addresses to accumulate before announcing. */
static const unsigned int MAX_ADDR_TO_SEND = 1000;
/** Maximum length of incoming protocol messages (no message over 2 MiB is currently acceptable). */
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 2 * 1024 * 1024;
/** Maximum length of incoming protocol messages (no message over 4 MB is currently acceptable). */
static const unsigned int MAX_PROTOCOL_MESSAGE_LENGTH = 4 * 1000 * 1000;
/** Maximum length of strSubVer in `version` message */
static const unsigned int MAX_SUBVERSION_LENGTH = 256;
/** -listen default */
Expand Down

4 comments on commit 37973bf

@chriswheeler
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens after SegWit is activated and an older node with a 2MiB MAX_PROTOCOL_MESSAGE_LENGTH receives a >2MiB block?

@sipa
Copy link
Owner

@sipa sipa commented on 37973bf Feb 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Witness data is stripped before relay to old nodes, so that can't happen.

@chriswheeler
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok that makes sense, so is there a service bit for SegWit?

Won't propagation of witness data be slow/unreliable if a large portion of the nodes aren't SegWit compatible after activation?

@sipa
Copy link
Owner

@sipa sipa commented on 37973bf Feb 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is a service bit now, and yes.

Please sign in to comment.