Skip to content
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 4 commits into from May 17, 2016

Conversation

davecgh
Copy link
Member

@davecgh davecgh commented May 17, 2016

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.

davecgh and others added 3 commits September 26, 2015 16:22
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 davecgh force-pushed the sync_upstream_through_sep28 branch 3 times, most recently from b644b62 to e3a8335 Compare May 17, 2016 18:50
@cjepson
Copy link
Contributor

cjepson commented May 17, 2016

OK after update to fix the intrinsic variable bug with miningstate messages

@davecgh davecgh force-pushed the sync_upstream_through_sep28 branch from e3a8335 to 28f5ce5 Compare May 17, 2016 19:01
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.
@alexlyp
Copy link
Member

alexlyp commented May 17, 2016

tack

@alexlyp alexlyp merged commit 28f5ce5 into decred:master May 17, 2016
@davecgh davecgh deleted the sync_upstream_through_sep28 branch May 17, 2016 19:47
@jcvernaleo jcvernaleo added this to the v0.1.4 milestone May 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants