diff options
author | fanquake <fanquake@gmail.com> | 2021-08-03 15:33:51 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-08-03 15:40:32 +0800 |
commit | 5cf28d5203a6203355283ea59f071af6a468d239 (patch) | |
tree | 7eb58aadcfd726058d186449ef62ec5e838a1e30 /test/functional/rpc_blockchain.py | |
parent | 71797beec54d36a055d5e172ecbf2141fa984428 (diff) | |
parent | 65332b1178c75e1f83415bad24918996a1524866 (diff) | |
download | bitcoin-5cf28d5203a6203355283ea59f071af6a468d239.tar.xz |
Merge bitcoin/bitcoin#22496: addrman: Remove addrman hotfixes
65332b1178c75e1f83415bad24918996a1524866 [addrman] Remove RemoveInvalid() (John Newbery)
Pull request description:
PRs #22179 and #22112 (EDIT: later reverted in #22497) added hotfix code to addrman to remove invalid addresses and mutate the ports of I2P entries after entering into addrman. Those hotfixes included at least two addrman data corruption bugs:
- #22467 (Assertion `nRndPos1 < vRandom.size() && nRndPos2 < vRandom.size()' failed)
- #22470 (Changing I2P ports in addrman may wronly skip some entries from "new" buckets)
Hotfixing addrman is inherently dangerous. There are many members that have implicit assumptions on each others' state, and mutating those directly can lead to violating addrman's internal invariants.
Instead of trying to hotfix addrman, just don't insert any invalid addresses. For now, those are addresses which fail `CNetAddr::IsValid()`.
ACKs for top commit:
sipa:
utACK 65332b1178c75e1f83415bad24918996a1524866. I tried to reason through scenarios that could introduce inconsistencies with this code, but can't find any.
fanquake:
ACK 65332b1178c75e1f83415bad24918996a1524866 - Skipping the addition of invalid addresses (this code was initially added for Tor addrs) rather than adding all the invalids then removing them all when finishing unserializing seems like an improvement. Especially if it can be achieved with less code.
Tree-SHA512: 023113764cb475572f15da7bf9824b62b79e10a7e359af2eee59017df354348d2aeed88de0fd4ad7a9f89a0dad10827f99d70af6f1cb20abb0eca2714689c8d7
Diffstat (limited to 'test/functional/rpc_blockchain.py')
0 files changed, 0 insertions, 0 deletions