Skip to content

fix: move MixPubKeyBook into libp2p_mix and bump libp2p pin past deletion - #7

Merged
chaitanyaprem merged 1 commit into
masterfrom
chore/move-mix-pub-key-book-rebase
May 8, 2026
Merged

fix: move MixPubKeyBook into libp2p_mix and bump libp2p pin past deletion#7
chaitanyaprem merged 1 commit into
masterfrom
chore/move-mix-pub-key-book-rebase

Conversation

@chaitanyaprem

@chaitanyaprem chaitanyaprem commented May 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

Re-lands the work that was originally merged as #5. That PR was mistakenly merged into PR #4's stacked branch after PR #4 had already been merged into master, so the changes never reached master.

Three follow-ups to the original mix extraction:

  1. Move MixPubKeyBook into libp2p_mix/pool — it's a mix-specific peer-store extension (Curve25519 keys per peer), shouldn't live in core libp2p. The peer-store generic mechanism (ref object of PeerBook[Curve25519Key]) makes the local definition behave identically at the call site.
  2. Drop stale {.public.} pragma from method overrides in entry/exit/reply_connection.nim — upstream nim-libp2p removed the marker pragma.
  3. Bump libp2p git pin to 7e72c0d6d — the master commit that merges chore: extract mix to logos-co/nim-libp2p-mix vacp2p/nim-libp2p#2378 (mix-extraction PR). Required so the registered libp2p no longer ships MixPubKeyBook, avoiding ambiguous-identifier errors against our local definition.

Once nim-libp2p tags a release including #2378, swap the pin for libp2p >= <new-version>.

Test plan

  • CI green on linux-amd64, linux-i386, macos-arm64 × Nim 2.0.16 / 2.2.6
  • Build mix_ping example
  • nph formatting + PR title checks

🤖 Generated with Claude Code

@chaitanyaprem
chaitanyaprem force-pushed the chore/move-mix-pub-key-book-rebase branch 2 times, most recently from 290e011 to c8e5999 Compare May 8, 2026 04:56
…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
chaitanyaprem force-pushed the chore/move-mix-pub-key-book-rebase branch from c8e5999 to 161ebb6 Compare May 8, 2026 05:00
@chaitanyaprem

Copy link
Copy Markdown
Collaborator Author

merging eventhough CI fails.

KadDHT.new won't compile due to Opt[T] generic resolution at libp2p builders.nim:503. This is a libp2p master regression introduced between the deletion-PR's base commit and current master. Nim 2.0.16 hits it; the example job (Nim 2.2.6) passed, suggesting Nim 2.2.6 may be fine.

@chaitanyaprem
chaitanyaprem merged commit f24cd25 into master May 8, 2026
8 of 11 checks passed
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