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
Rename network
module and move/clean up types
#1854
Conversation
And BTW @apoelstra, epic win on the recent fuzzing changes, I was able to catch required changes to the fuzzing code during my normal dev workflow instead of getting a red CI job. |
Network
and ChainHash
to lib.rs
Network
, ChainHash
, and Magic
to lib.rs
Network
, ChainHash
, and Magic
to lib.rs
chain
module
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.
Concept ACK, bikeshedding:
- Is
chain
the best name? A newbie might get it confused withblockdata
. - Rename
Network
toChain
? - If we're keeping
chain
, renameChainHash
tochain::Hash
?
Fair points re naming, I would have used Agree module name |
I am tempted actually to pull these things into the existing |
chain
modulenetwork
module and move/clean up types
@tcharding how about if we add a This PR seems like a good test case for this workflow. But concept ACK everything here. |
Sounds good, I'll have a play with it. |
Check out #1880, thanks for prodding me to do that, it was actually very enjoyable and got me a bit excited that we can actually have a stable API and not mess it up accidentally. |
So lets wait for #1880 to merge then I'll rebase this one and we can see how the review process goes. |
If we decide to leave #1880 open for a while I'd pref to let this in, there will be plenty of chance to see how 1880 effects workflow, we change the API daily. |
If we're still debating #1880 by end of Monday then sure, let's start pushing forward on this. But I think it's in good shape other than the warning thing which is a pretty minor issue. |
Changes in force push:
|
Changes in force push, fix sloppy work in
|
In light of recent discussion I broke the code move patch up into a whole bunch of patches so that the review is easier. |
Just some quick 2 cents:
|
Thanks man, I'll go back over the types and process your message when I'm thinking clearly. |
My bad, the PR description was stale, this PR does not touch
Yes, good point. I will remove any changes to
I'm going to put
Cool, so I'm going to add a Thanks man! |
I think it can just be defined directly in |
WTF |
You sure? It clutters the |
Changes in force push: Fix the no-std build errors after learning how to actually build the code. |
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.
ACK fd36a6b
Cheers bro |
Friendly bump, I believe all review suggestions have been addressed. Thanks |
Rebased on master (to pick up #1927). No other changes. |
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.
ACK a14ad88
We already have `Borrow`, add `BorrowMut`.
The `network` module deals with data types and logic related to internetworking bitcoind nodes, this is commonly referred to as the p2p layer. Rename the `network` module to `p2p` and fix all the paths.
The `PROTOCOL_VERSION` const is a p2p layer constant. It can live in the `mod.rs` file of the `p2p` module. This is a straight code move, the `PROTOCOL_VERSION` replaces the current re-export.
The `ServiceFlags` type is used by the p2p layer. It can live in the `mod.rs` file of the `p2p` module. Done in preparation for removing the `p2p::constants` module. This is a straight code move, the `ServiceFlags` replaces the current re-export.
In preparation for removing the `p2p::constants` module; move the `p2p::constants::Magic` type to the `p2p` module.
The `Network` type is not a p2p construct, it is more general, used throughout the codebase to define _which_ Bitcoin network we are operating on.
a14ad88
to
d4e8f49
Compare
Rebased, no other changes. |
55be538 policy: Add refactor carve out (Tobin C. Harding) Pull request description: I have managed to burn out or bore our reviewers/maintainers. Getting two acks is becoming increasingly difficult. I've pestered everyone to the limit that I feel socially comfortable doing so, and as such, am requesting a carve out to the 2-ACK before merge rule. The primary justification is that I feel we should have a bit more of BDFL and a bit less total consensus if we are to push forwards. ### Example PRs where this change would apply - #1925 - #1854 - #1862 ACKs for top commit: elichai: I agree this makes sense for refactors ACK 55be538 apoelstra: ACK 55be538 sanket1729: ACK 55be538. Same reasons as apoelstra. And this is only for re-factors that are not adding any new features. RCasatta: ACK 55be538 Tree-SHA512: a5e206252015f49245ed282a3be7a35760d16f94dc6e60f31edf589a41ef642eba52a3bd7d1375b6033f3cf0128f47beee4f03e59cad151c64eedd71ac98baac
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.
ACK d4e8f49
Merging based on new one-ack-2-weeks policy in #1945 |
This PR has grown.
network
module top2p
(fix:network
module could be more descriptively named #1855)BorrowMut
to preludeNetwork
,ChainHash
, andMagic
structs to a newly createp2p::network
module