Skip to content

fix: move MixPubKeyBook into libp2p_mix and drop stale public pragma#5

Merged
chaitanyaprem merged 4 commits into
chore/rng-explicit-initfrom
chore/move-mix-pub-key-book
May 6, 2026
Merged

fix: move MixPubKeyBook into libp2p_mix and drop stale public pragma#5
chaitanyaprem merged 4 commits into
chore/rng-explicit-initfrom
chore/move-mix-pub-key-book

Conversation

@chaitanyaprem
Copy link
Copy Markdown
Collaborator

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. 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). With this PR libp2p_mix is fully self-contained.

Stacked on chore/rng-explicit-init (PR #4). Merge that one first.

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.
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.
@chaitanyaprem
Copy link
Copy Markdown
Collaborator Author

Merging this as looks like this got missed during repo creation.

@chaitanyaprem chaitanyaprem merged commit 829f190 into chore/rng-explicit-init May 6, 2026
9 checks passed
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.
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