Skip to content

fix(addressbook): lock remove - #5573

Open
akrem-chabchoub wants to merge 1 commit into
masterfrom
fix/addressbook
Open

fix(addressbook): lock remove#5573
akrem-chabchoub wants to merge 1 commit into
masterfrom
fix/addressbook

Conversation

@akrem-chabchoub

@akrem-chabchoub akrem-chabchoub commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Checklist

  • I have read the coding guide.
  • My change requires a documentation update, and I have done it.
  • I have added tests to cover my changes.
  • I have filled out the description and linked the related issues.

Description

Remove deleted an addressbook entry without holding the lock that Put and Seen both use. This let a concurrent Seen call read the entry, have Remove delete it in between, then write its stale copy back, silently undoing the removal.

In practice: kademlia calls Remove when it evicts a bad peer, but a concurrent hive gossip sighting or kademlia's periodic "seen" sweep on the same peer could bring it right back.

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

AI Disclosure

  • This PR contains code that has been generated by an LLM.
  • I have reviewed the AI generated code thoroughly.
  • I possess the technical expertise to responsibly review the code generated in this PR.

@martinconic

Copy link
Copy Markdown
Contributor

Please add a description

@akrem-chabchoub akrem-chabchoub added this to the 2026 milestone Aug 24, 2026
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.

3 participants