refactor: Move sock from util to common #27989
pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:230628-sock changing 14 files +21 −20-
hebasto commented at 10:24 am on June 28, 2023: memberNetworking code should not be required by the kernel.
-
refactor: Move sock from util to common
Networking code should not be required by the kernel.
-
DrahtBot commented at 10:24 am on June 28, 2023: contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviews
See the guideline for information on the review process. A summary of reviews will appear here.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #27861 (kernel: Rm ShutdownRequested and AbortNode from validation code. by TheCharlatan)
- #27534 (rpc: add ‘getnetmsgstats’, new rpc to view network message statistics by satsie)
- #27385 (net, refactor: extract Network and BIP155Network logic to node/network by jonatack)
- #26812 (test: add end-to-end tests for CConnman and PeerManager by vasild)
- #25572 (refactor: Introduce EvictionManager and use it for the inbound eviction logic by dergoegge)
- #25268 (refactor: Introduce EvictionManager by dergoegge)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
-
DrahtBot added the label Refactoring on Jun 28, 2023
-
TheCharlatan commented at 2:46 pm on June 28, 2023: contributorWhat about all the other networking and wallet related files in
/util
? E.g. we should probably also moveasmap.cpp
,bip32.cpp
,bytevectorhash.cpp
,error.cpp
,fees.cpp
,syserror.cpp
,message.cpp
, andreadwritefile.cpp
out of/util
. These pure moves of entire files are very straight forward, so I feel like when we do this, we should do all of them at once as part of integrating the kernel library into the internal compilation units. My fear is that this will otherwise create too much rebase churn for the open PRs if it is done piecemeal. -
ryanofsky commented at 0:47 am on June 30, 2023: contributor
Concept -0. I don’t think it’s a good thing to remove everything from util that isn’t used by the kernel. I think util/ is a good home for general purpose code providing basic data structures and cross platform capabilities, and I think common/ is good home for project-specific code that needs to be shared between bitcoind, bitcoin-cli, and bitcoin-wallet.
It can make sense to move code from util/ to common/ if the code relies on an external dependency, or has global variables, or something else we don’t want in the kernel. It might also make sense to move code to common/ if it is very specific to our own applications and doesn’t belong in a library accessible to other applications.
But this networking code doesn’t seem much different than the filesystem code in
util/fs_helpers.cpp
or pipe code added inutil/signalinterrupt.cpp
from #27861 so I think it fits better in util/ than common/ organizationally. There may be other reasons to move things, but I don’t think “not currently required by kernel code” is enough reason by itself. -
hebasto closed this on Jun 30, 2023
-
bitcoin locked this on Jun 29, 2024
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-22 09:12 UTC
More mirrored repositories can be found on mirror.b10c.me