forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
backport: merge bitcoin#20233, #22627, #22725, #22697, #22740, #22849, #22791, #22848, #22915, #22911, #22974, #20234 (addrman backports) #6040
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
Merged
Conversation
This file contains hidden or 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
UdjinM6
requested changes
Jun 2, 2024
5 tasks
|
This pull request has conflicts, please rebase. |
UdjinM6
approved these changes
Jun 4, 2024
UdjinM6
left a comment
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.
utACK
PastaPastaPasta
approved these changes
Jun 7, 2024
Member
PastaPastaPasta
left a comment
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.
utACK f619f8f
PastaPastaPasta
added a commit
that referenced
this pull request
Jun 11, 2024
, bitcoin#22734, bitcoin#22950, bitcoin#23053, bitcoin#22839, bitcoin#23140, bitcoin#23306, bitcoin#23354, bitcoin#23380 (addrman backports: part 2) a93fec6 merge bitcoin#23380: Fix AddrMan::Add() return semantics and logging (Kittywhiskers Van Gogh) d1a4b14 merge bitcoin#23354: Introduce new V4 format addrman (Kittywhiskers Van Gogh) 7a97aab test: restore pre-bitcoin#23306 tests to validate port distinguishment (Kittywhiskers Van Gogh) 1a050d6 merge bitcoin#23306: Make AddrMan support multiple ports per IP (Kittywhiskers Van Gogh) d56702a merge bitcoin#23140: Make CAddrman::Select_ select buckets, not positions, first (Kittywhiskers Van Gogh) 19b0145 merge bitcoin#22839: improve addrman logging (Kittywhiskers Van Gogh) 3910c68 merge bitcoin#23053: Use public methods in addrman fuzz tests (Kittywhiskers Van Gogh) b6ec8ab merge bitcoin#22950: Pimpl AddrMan to abstract implementation details (Kittywhiskers Van Gogh) 236cf36 merge bitcoin#22734: Avoid crash on corrupt data, Force Check after deserialize (Kittywhiskers Van Gogh) 2420ac9 merge bitcoin#23041: Add addrman deserialization error tests (Kittywhiskers Van Gogh) 8aefa9b merge bitcoin#22762: Raise InitError when peers.dat is invalid or corrupted (Kittywhiskers Van Gogh) c9a645f merge bitcoin#22879: Fix format string in deserialize error (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * Dependent on #6040. * Dash already introduced support for storage of address-port pairs (referred to as "port discrimination") and allowed the usage of non-default ports in P2P with [dash#2168](#2168). * Albeit this was only permitted for networks with `fAllowMultiplePorts` enabled (which at the time was `devnet` and as it stands currently, on every network except `mainnet`). * Keeping in line with the above policy (discussion on lifting such restrictions on `mainnet` is outside the scope of this PR), when backporting [bitcoin#23306](bitcoin#23306), changes have been made to retain the effects of `discriminate_ports`. * This involves appending placing a `!m_discriminate_ports` condition to behaviour that otherwise would be _removed_ entirely. * Additionally, in line with upstream backports, changes have been made that render port distinguishment _enabled_ as the new default in `addrman_tests` (the old default was to keep it _disabled_, to mirror `mainnet` and pre-change upstream behaviour). * To ensure distinguishment _disabled_ works as expected, affected pre-backport tests were reintroduced with the `_nondiscriminate` suffix. --- I would propose at some point to rename the flag to `ignore_port`/`suppress_port` (if not remove it altogether should the `mainnet` restriction be lifted) as discriminate (or distinguish) isn't immediately clear with if address entries will be discriminated/distinguished _using_ ports (i.e. considered) or ports will be discriminated _against_ (i.e. ignored). ## Breaking Changes It's unclear if these backports result in serialization issues for older versions, as Dash Core technically supported address-port pairs since 0.12 and suppressed it on `mainnet` by setting zero-ing out the port ([source](https://github.com/dashpay/dash/blob/19512988c6e6e8641245bd9c5fab21dd737561f0/src/addrman.cpp#L135-L138)), meaning even with port discrimination _disabled_, the serialization format should remain the same. Regardless, following upstream backports, a new version has been introduced (v4) that marks the AddrMan format incompatible with older versions of Dash Core. ## Checklist: _Go over all the following points, and put an `x` in all the boxes that apply._ - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas **(note: N/A)** - [x] I have added or updated relevant unit/integration/functional/e2e tests - [x] I have made corresponding changes to the documentation **(note: N/A)** - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: utACK a93fec6 PastaPastaPasta: utACK a93fec6 Tree-SHA512: 49b35af3e4eb660249ce9a65d5a539205d852e9c728da22dc88779f6b3b15c13cf91522896a313bfe2a91889fedf3b6b2cebdea12cc2bbe865ec3b85b6a5dfa8
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.
Additional Information
Dump,Read}PeerAddressestakes in anconst ArgsManager&but doesn't do anything with it.Breaking Changes
None expected. No changes to serialization format.
Checklist:
Go over all the following points, and put an
xin all the boxes that apply.