fix: move MixPubKeyBook into libp2p_mix and drop stale public pragma#5
Merged
chaitanyaprem merged 4 commits intoMay 6, 2026
Merged
Conversation
Two follow-ups to the original mix extraction:
1. Move \`MixPubKeyBook\` from libp2p/peerstore into libp2p_mix/pool.
The type is mix-specific (Curve25519 keys per peer), only used
by libp2p_mix's own pool, and shouldn't bleed into core libp2p.
The peer-store extension mechanism makes this trivial:
\`ref object of PeerBook[Curve25519Key]\` defined locally is
indistinguishable from the previous version at the call site.
2. Drop the stale \`{.public.}\` pragma from method overrides in
entry/exit/reply_connection.nim. Upstream nim-libp2p removed the
marker pragma; our overrides referenced it without an importing
module that defined it.
Companion to vacp2p/nim-libp2p#2378 (which removes MixPubKeyBook
from libp2p/peerstore) — once that lands, this PR makes
libp2p_mix self-contained again.
Until the deletion PR in nim-libp2p (vacp2p/nim-libp2p#2378) merges and a new libp2p version is registered, libp2p/peerstore still exports MixPubKeyBook. Combined with our local definition in libp2p_mix/pool, this triggers 'ambiguous identifier' in test files that import both. Use `except MixPubKeyBook` on the libp2p/peerstore import in those tests; the clause becomes a no-op once the deletion PR lands.
This reverts commit 796abe9.
Pin libp2p to the head of vacp2p/nim-libp2p#2378 so libp2p/peerstore no longer ships MixPubKeyBook. With our local definition in libp2p_mix/pool, this avoids the transitional 'ambiguous identifier' errors. Once #2378 merges to master and is published, replace this pin with a version range.
Collaborator
Author
|
Merging this as looks like this got missed during repo creation. |
3 tasks
chaitanyaprem
added a commit
that referenced
this pull request
May 8, 2026
…tion
Three follow-ups to the original mix extraction:
1. Move `MixPubKeyBook` from libp2p/peerstore into libp2p_mix/pool.
The type is mix-specific (Curve25519 keys per peer), only used
by libp2p_mix's own pool, and shouldn't bleed into core libp2p.
The peer-store extension mechanism makes this trivial:
`ref object of PeerBook[Curve25519Key]` defined locally is
indistinguishable from the previous version at the call site.
2. Drop the stale `{.public.}` pragma from method overrides in
entry/exit/reply_connection.nim. Upstream nim-libp2p removed the
marker pragma; our overrides referenced it without an importing
module that defined it.
3. Bump the libp2p git pin to the tip of vacp2p/nim-libp2p#2378
(mix-extraction PR, merged). With our local definition in
libp2p_mix/pool, this avoids ambiguous identifier errors against
the registered libp2p. We pin to the PR-tip rather than the
post-merge master commit because libp2p master picked up an
unrelated boringssl git-pin that nimble's SAT solver can't
currently resolve. Once a release including #2378 is tagged,
replace the pin with `libp2p >= <new-version>`.
This re-lands the work originally merged as #5 — that PR was
mistakenly merged into the (already-merged) PR #4 stacked branch
instead of master, so the changes never reached master.
chaitanyaprem
added a commit
that referenced
this pull request
May 8, 2026
…tion
Three follow-ups to the original mix extraction:
1. Move `MixPubKeyBook` from libp2p/peerstore into libp2p_mix/pool.
The type is mix-specific (Curve25519 keys per peer), only used
by libp2p_mix's own pool, and shouldn't bleed into core libp2p.
The peer-store extension mechanism makes this trivial:
`ref object of PeerBook[Curve25519Key]` defined locally is
indistinguishable from the previous version at the call site.
2. Drop the stale `{.public.}` pragma from method overrides in
entry/exit/reply_connection.nim. Upstream nim-libp2p removed the
marker pragma; our overrides referenced it without an importing
module that defined it.
3. Bump the libp2p git pin to the master commit that merges
vacp2p/nim-libp2p#2378 (mix-extraction PR). With our local
definition in libp2p_mix/pool, this avoids ambiguous identifier
errors against the registered libp2p. The newer libp2p pulls in
a git-pinned boringssl dep that nimble's default SAT solver
can't resolve, so CI now runs `nimble --solver:legacy setup`.
Drop both the legacy flag and the git pin once a release
including #2378 is tagged.
This re-lands the work originally merged as #5 — that PR was
mistakenly merged into the (already-merged) PR #4 stacked branch
instead of master, so the changes never reached master.
chaitanyaprem
added a commit
that referenced
this pull request
May 8, 2026
…tion
Three follow-ups to the original mix extraction:
1. Move `MixPubKeyBook` from libp2p/peerstore into libp2p_mix/pool.
The type is mix-specific (Curve25519 keys per peer), only used
by libp2p_mix's own pool, and shouldn't bleed into core libp2p.
The peer-store extension mechanism makes this trivial:
`ref object of PeerBook[Curve25519Key]` defined locally is
indistinguishable from the previous version at the call site.
2. Drop the stale `{.public.}` pragma from method overrides in
entry/exit/reply_connection.nim. Upstream nim-libp2p removed the
marker pragma; our overrides referenced it without an importing
module that defined it.
3. Bump the libp2p git pin to the master commit that merges
vacp2p/nim-libp2p#2378 (mix-extraction PR). With our local
definition in libp2p_mix/pool, this avoids ambiguous identifier
errors against the registered libp2p. The newer libp2p pulls in
a git-pinned boringssl dep that nimble's default SAT solver
can't resolve, so CI now runs `nimble --solver:legacy setup`.
Drop both the legacy flag and the git pin once a release
including #2378 is tagged.
This re-lands the work originally merged as #5 — that PR was
mistakenly merged into the (already-merged) PR #4 stacked branch
instead of master, so the changes never reached master.
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
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.
Two follow-ups to the original mix extraction:
Move
MixPubKeyBookfromlibp2p/peerstoreintolibp2p_mix/pool. The type is mix-specific (Curve25519 keys per peer), only used by libp2p_mix's own pool, and shouldn't bleed into core libp2p.ref object of PeerBook[Curve25519Key]defined locally is indistinguishable from the previous version at the call site.Drop the stale
{.public.}pragma from method overrides inentry/exit/reply_connection.nim. Upstream nim-libp2p removed the marker pragma; our overrides referenced it without an importing module that defined it.Companion to
vacp2p/nim-libp2p#2378(which removesMixPubKeyBookfromlibp2p/peerstore). With this PR libp2p_mix is fully self-contained.Stacked on
chore/rng-explicit-init(PR #4). Merge that one first.