libp2p / libp2p/go-libp2p

peerstore: Peer record handling is not atomic in the on-disk peerstore

Open
#1,701 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug
Dominant language
Go
Stars
6.9k
Forks
1.3k
Avg merge
13d 21h
Merged PRs (30d)
1

Description

We need to take a lock somewhere to ensure that multiple concurrent calls to `ConsumePeerRecord` don't interleave, leaving us with addresses from one, and the record from the other.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the on-disk peerstore implementation of ConsumePeerRecord and trace how concurrent calls update peer addresses and records. Determine where the operation can be serialized, then verify that concurrent calls cannot leave addresses from one record paired with the other record.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.