Skip to content

Forward-port #923 (getrawaddrman keeps a colliding address in its bucket) to master - #925

Merged
bkeroack merged 1 commit into
masterfrom
fix/fwdport-addrman-bucket-spread
Oct 7, 2026
Merged

bkeroack merged 1 commit into
masterfrom
fix/fwdport-addrman-bucket-spread

Conversation

@bkeroack

@bkeroack bkeroack commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Brings #923 (e63aa210), merged into release/0.6 for 0.6.1, back to master, cherry-picked with -x.

getrawaddrman moved an address whose derived slot was taken to the next free slot of the whole table. From a bucket's last position, that put it in a bucket Core's formulas never give it. One /16 could then show 9 tried buckets where Core allows 8, which made net::addrman::tests::one_group_still_spans_several_tried_buckets fail intermittently. A colliding address now stays in its own bucket. Only a full bucket sends it on.

node/src/net/addrman.rs is identical on master and release/0.6, so the change applies unchanged: the patch's git patch-id equals that of #923's code change.

Release notes

The CHANGELOG.md bullet and the docs/release-notes/0.6.1-pre.md section stay on release/0.6. They come to master with the 0.6.1 cut, as with #910 and #921.

Verified

Ran locally on this branch:

  • cargo clippy --all-targets --all-features --locked -- -D warnings;
  • cargo test --test e2e --no-run --locked --features e2e;
  • the node lib suite (2133 passed, including the 23 net::addrman tests);
  • the regtest addrman_rpcs_report_a_hand_added_address_everywhere.

On release/0.6, #923 passed CI and a Devin review before merging.

🤖 Generated with Claude Code

…n, test flake) (#923)

* addrman: keep a colliding entry in its derived bucket

positions() derives each entry's getrawaddrman slot with Core's
formulas and moved a collision to the next free slot of the flat table.
From a bucket's last position that is the next bucket's first, so a
/16's tried entries could be reported in nine buckets where Core's
formula allows eight. one_group_still_spans_several_tried_buckets
caught it about once in a hundred runs (random slot key).

A taken slot now moves to the next free position in its own bucket,
wrapping within it, as Core keeps every entry in its formula's bucket.
Only a full bucket spills into the next one with room. One u64 mask
per bucket replaces the union-find.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

* docs: note the getrawaddrman bucket fix for 0.6.1

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
(cherry picked from commit e63aa21)
@bkeroack
bkeroack merged commit d52db07 into master Oct 7, 2026
37 checks passed
@bkeroack
bkeroack deleted the fix/fwdport-addrman-bucket-spread branch October 7, 2026 01:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant