Skip to content

feat: bump nim-libp2p to v2.0.0#3929

Draft
fcecin wants to merge 5 commits into
masterfrom
feat/libp2p-bump-release-v2.0.0
Draft

feat: bump nim-libp2p to v2.0.0#3929
fcecin wants to merge 5 commits into
masterfrom
feat/libp2p-bump-release-v2.0.0

Conversation

@fcecin
Copy link
Copy Markdown
Contributor

@fcecin fcecin commented Jun 3, 2026

Description

NOTE: There is another libp2p v2.0.0 bump PR ongoing which we may prefer over this one (if so, we can close this one)

NOTE: This PR is WIP; do not merge:

  • Must revert json_rpc + web3 pointing at a temp fork after we fix json_rpc websock semver constraint upstream;
  • Need actual nim-libp2p v2.0.0 release, not a commit of working 2.0.0 release branch

EDIT: nim-json-rpc bump already on the way status-im/nim-json-rpc#277

This PR bumps nim-libp2p to v2.0.0, which paves the way for adding QUIC support in logos-delivery.

Changes

  • DRAFT: route json_rpc + web3 through websock-relaxed forks (revert on upstream fix)
  • bump nim-libp2p pin to release/v2.0.0 (c43199378)
  • add libp2p_mix dep; repoint libp2p/protocols/mix -> libp2p_mix
  • pin nimble.lock: lsquic / websock / boringssl / protobuf_serialization / npeg / jwt
  • migrate rng ref HmacDrbgContext -> libp2p Rng across prod/channels/noise/tests (interface-only; same DRBG)
  • noise: params take Rng, extract bearSslDrbg internally
  • waku_switch: TransportConfig factory; unified 2.0.0 connection limits (withMaxInOut, withMaxConnections); local MaxConnections
  • waku_relay/rendezvous/discv5/kademlia: v2.0.0 API (rng, config, ServiceDiscovery rename)
  • call Service.setup() on post-build switch services (2.0.0 split setup/start, fixes autonat addressMapper nil-deref segfault)
  • drop libp2p/utils/semaphore -> chronos AsyncSemaphore
  • add waku/compat/option_valueor shim (Option[T] valueOr/withValue, dropped upstream)
  • add std/options where a transitive re-export was removed
  • add newStandardSwitch shim (libp2p removed it in 2.0.0); mounts yamux+mplex to match prod muxer
  • PeerId.random(rng); common.rng()/crypto.newRng(); hoist shared rng (instantiation cleanup)
  • update expectations for 2.0.0 defaults: DEFAULT_PROTOCOLS += /ipfs/id/push/1.0.0; agent "nim-libp2p"
  • drop relay reboot/reconnect test (asserted a Switch restart capability that is simply not supported)

Issue

iterates logos-messaging/pm#404

iterates logos-messaging/pm#324

fcecin added 3 commits June 2, 2026 15:42
* bump libp2p pin to release/v2.0.0 (c43199378)
* pin nimble.lock: lsquic/websock/boringssl/protobuf_serialization/npeg/jwt
* add libp2p_mix dep and point libp2p/protocols/mix -> libp2p_mix
* migrate rng to libp2p Rng type (prod, channels, noise, tests)
* noise: take Rng, extract bearSslDrbg internally
* waku_switch: TransportConfig factory; withMaxInOut; local MaxConnections
* waku_relay/rendezvous/discv5/kademlia: v2.0.0 API (rng, config, ServiceDiscovery)
* tests: newStandardSwitch shim; PeerId.random(rng); common.rng()/crypto.newRng()
* drop libp2p/utils/semaphore (use chronos AsyncSemaphore)
* add waku/compat/option_valueor shim where needed
* add std/options where transitive re-export dropped
* deps: json_rpc + web3 via websock-relaxed forks (WIP: revert on upstream fix)
* fix: setup() post-build switch services (autonat nil segfault)
* fix: unified 2.0.0 connection limits
* test: 2.0.0 defaults (identify-push, agent string)
* test: drop reboot/reconnect (unsupported Switch restart)
* add yamux to our newStandardSwitch to match prod behavior
* test: rng instantiation cleanup
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

This PR may contain changes to database schema of one of the drivers.

If you are introducing any changes to the schema, make sure the upgrade from the latest release to this change passes without any errors/issues.

Please make sure the label release-notes is added to make sure upgrade instructions properly highlight this change.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2026

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3929

Built from 3957229

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