refactor: Remove nMyStartingHeight from CNode/Connman #20649
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2012-netNoMyHeight changing 12 files +33 −55-
MarcoFalke commented at 11:27 am on December 14, 2020: memberCNode and CConnman keep track of the active chain height when CNodes have been created, but apart from serializing the int once (when sending a version message), it is unused. So it can simply be removed in favor of a single int in PeerMan that can do the same.
-
MarcoFalke added the label Refactoring on Dec 14, 2020
-
MarcoFalke added the label P2P on Dec 14, 2020
-
jnewbery commented at 11:34 am on December 14, 2020: member
Concept ACK. I have a branch that does almost exactly the same as this.
I don’t think we even need to store
m_best_height
inPeerManager
. We can just call::ChainActive().Height()
whenever we want to send aversion
message. -
MarcoFalke commented at 11:47 am on December 14, 2020: member
just call ::ChainActive().Height() whenever we want to send a version message.
I was thinking that it would be nice (in the future) if most message handling could be done without
cs_main
. -
jnewbery commented at 12:51 pm on December 14, 2020: member
I was thinking that it would be nice (in the future) if most message handling could be done without cs_main.
This would definitely be nice! At the moment, both places we send a
version
message require cs_main at some point, so we’re quite far off at the moment.I have a preference for not caching the block height in PeerManager since I think it makes isolating and testing behaviour more difficult, but either way, this is clearly a big improvement over the current code.
-
DrahtBot commented at 8:12 pm on December 14, 2020: member
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Conflicts
Reviewers, this pull request conflicts with the following ones:
- #20811 (refactor: move net_processing implementation details out of header by ajtowns)
- #20789 (fuzz: Rework strong and weak net enum fuzzing by MarcoFalke)
- #20788 (net: add RAII socket and use it instead of bare SOCKET by vasild)
- #20758 (net-processing refactoring – lose globals, move implementation details from .h to .cpp by ajtowns)
- #20685 (Add I2P support using I2P SAM by vasild)
- #20370 (DRAFT fuzz: Permission flags in net_processing fuzzers by MarcoFalke)
- #20228 (addrman: Make addrman a top-level component by jnewbery)
- #18261 (Erlay: bandwidth-efficient transaction relay protocol by naumenkogs)
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.
-
jnewbery commented at 10:54 am on December 15, 2020: memberCode review ACK fa7afc076328ef3fbc56b51f62f7afae24701dae
-
DrahtBot added the label Needs rebase on Dec 15, 2020
-
MarcoFalke force-pushed on Dec 15, 2020
-
DrahtBot removed the label Needs rebase on Dec 15, 2020
-
MarcoFalke commented at 9:36 am on December 16, 2020: memberrebased
-
jnewbery commented at 10:08 am on December 16, 2020: membercode review ACK faf54d4af483a5e107d47b16cfa47cdeb815e723
-
MarcoFalke force-pushed on Dec 17, 2020
-
naumenkogs commented at 8:59 am on December 18, 2020: memberConcept ACK
-
jnewbery commented at 10:33 am on December 18, 2020: memberCode review ACK fa8a96a914639ecda7f5d8c522dc0339815efef5
-
theStack approved
-
theStack commented at 2:34 pm on December 28, 2020: memberNice cleanup! Code review ACK fa8a96a914639ecda7f5d8c522dc0339815efef5 ☃️
-
DrahtBot added the label Needs rebase on Jan 2, 2021
-
refactor: Remove nMyStartingHeight from CNode/Connman faaa4f2b6a
-
MarcoFalke force-pushed on Jan 2, 2021
-
MarcoFalke commented at 9:42 am on January 2, 2021: memberRebased due to trivial conflict in adjacent line
-
jnewbery commented at 9:44 am on January 2, 2021: memberutACK faaa4f2b6af4ce249fc4809a030240afa45b1a33
-
theStack approved
-
theStack commented at 11:01 am on January 2, 2021: memberre-ACK faaa4f2b6af4ce249fc4809a030240afa45b1a33 ⚓ Checked that the changes since my previous cr ACK were only rebase-related via
$ git range-diff fa8a96a9146...faaa4f2b6af
, also compiled and ran the tests. -
DrahtBot removed the label Needs rebase on Jan 2, 2021
-
MarcoFalke merged this on Jan 2, 2021
-
MarcoFalke closed this on Jan 2, 2021
-
MarcoFalke deleted the branch on Jan 2, 2021
-
sidhujag referenced this in commit 2c8996ffbb on Jan 2, 2021
-
Fabcien referenced this in commit 21ae0d505a on Jan 25, 2022
-
DrahtBot locked this on Aug 16, 2022
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-19 00:12 UTC
More mirrored repositories can be found on mirror.b10c.me