-
Notifications
You must be signed in to change notification settings - Fork 291
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
peer: Introduce v2 module. #1834
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
matheusd
approved these changes
Aug 12, 2019
dnldd
reviewed
Aug 12, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commit message has a typo, to remote
should be to remove
.
Looks good besides that.
dajohi
approved these changes
Aug 12, 2019
This freezes the root module usage of the peer module by removing the replacement and bumping the required version. This means building the software will still produce binaries based on the v1 module until the v2 module is fully released. All future releases will be moving to version 2 of the module. Consequently, it bumps the required module versions as follows: - github.com/decred/dcrd/[email protected]
This removes the deprecated ChainParams field from the Config struct and updates the tests accordingly. It also removes the dependency on the chaincfg module since it is no longer required.
This modifies the PushGetBlocksMsg and PushGetHeadersMsg functions to accept a string of block loactors hashes instead of a concrete blockchain.BlockLocator to remove the tight couping between the two packages at the API boundary and allow callers to easily provide custom values if desired. It also removes the dependency on the blockchain module since it is no longer required.
This udpates the peer module to use the latest module major versions. The updated direct dependencies are as follows: - github.com/decred/dcrd/txscript/[email protected]
davecgh
force-pushed
the
peer_introduce_v2
branch
from
August 12, 2019 21:01
0f94a14
to
e523e05
Compare
@dnldd Thanks. Updated typo. |
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 requires #1833.
In order to make use of
chaincfg/v2
andblockchain/v2
, a new major version of thepeer
module is required becausepeer/v1
accepts and returns types from bothchaincfg/v1
andblockchain/v1
in its API.Since a new major version is required, this also takes the opportunity to remove the tight coupling to both
chaincfg
andblockchain
as follows:*chaincfg.Params
from its API.[]chainhash.Hash
for block locators inPushGetBlocksMsg
andPushGetHeadersMsg
instead ofblockchain.BlockLocator
.Consequently, this introduces
peer/v2
. A series of individual commits is provided to make the review process easier. Each commit message more thoroughly describes its purpose, but primarily they consist of the following:peer
module usepeer
override so building the software will still produce binaries based on thev1
module until thev2
module is fully releasedConfig.ChainParams
field[]chainhash.Hash
inPushGetBlocksMsg
andPushGetHeadersMsg
instead ofblockchain.Locator
chaincfg
.blockchain
.v2
Finally, it should also be noted that this only introduces the new module and does not update anything to make use of it yet, so building the software will still produce binaries based on the
v1
module.