New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sync upstream through Sep 28, 2015. #178
Merged
Merged
Conversation
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
The Bitcoin wire protocol includes several fields with their lengths encoded according to a variable length integer encoding scheme that does not enforce a unique encoding for all numbers. This can lead to a situation where deserializing and re-serializing the same data can result in different bytes. There are no currently known issues due to this, but it is safer to reject such subtle differences as they could potentially lead to exploits. Consequently, this commit modifies the varint decoding function to error when the value is not canonically encoded which effectively means that all messages with varints that are not canonically encoded will now be rejected. This will not cause issues with old client versions in regards to blocks and transactions since the data is deserialized into memory and then reserialized before being relayed thereby effectively erasing any non-canonical encodings. Also, new tests have been added to ensure non-canonical encodings are properly rejected and exercise the new code, and the default user agent version for wire has been bumped to version 0.2.1 to differentiate the new behavior. The equivalent logic was implemented in Bitcoin Core by PR 2884.
This commit modifies the DisasmString function to use a bytes buffer for constructing the disassembled string instead of naive string concatenation. This makes a huge difference when disassembling scripts with large numbers of opcodes.
SFNodeBloom is a new service flag that a node is required to use to indicate that it supports bloom filtering. This includes a protocol version bump to 70011 and a wire version bump to 0.3.0. btcd: The SFNodeBloom flag is set by default. A new configuration option --nopeerbloomfilters has been added to to disable bloom filtering. Any node advertising a version greater than or equal to 70011 that attempts to use bloom filtering will be disconnected if bloom filtering is disabled. This mimics Bitcoin Core commit afb0ccaf9c9e4e8fac7db3564c4e19c9218c6b03
davecgh
force-pushed
the
sync_upstream_through_sep28
branch
3 times, most recently
from
May 17, 2016 18:50
b644b62
to
e3a8335
Compare
OK after update to fix the intrinsic variable bug with miningstate messages |
davecgh
force-pushed
the
sync_upstream_through_sep28
branch
from
May 17, 2016 19:01
e3a8335
to
28f5ce5
Compare
This sync includes a new service flag named SFNodeBloom that a node is required to use to indicate that it supports bloom filtering. This includes a protocol version bump to 2 and a wire version bump to 0.1.0. dcrd: The SFNodeBloom flag is set by default. A new configuration option --nopeerbloomfilters has been added to to disable bloom filtering. Also, it corrects an issue with the mining state message where it was using the network protocol version instead of having its own version.
tack |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This sync includes a new service flag named
SFNodeBloom
that a node is required to use to indicate that it supports bloom filtering. This includes a protocol version bump to2
and a wire version bump to0.1.0
.dcrd:
The
SFNodeBloom
flag is set by default. A new configuration option--nopeerbloomfilters
has been added to to disable bloom filtering.Also, it corrects an issue with the mining state message where it was using the network protocol version instead of having its own version.