Repository navigation
chore(p2p): switch libp2p from the lambdaclass fork to upstream 0.57.1 - #724
Draft
MegaRedHand wants to merge 2 commits into
Draft
MegaRedHand wants to merge 2 commits into
MegaRedHand wants to merge 2 commits into
Conversation
The fork's only change of its own was `send_request_with_protocol`, which nothing calls since req/resp became one `request_response::Behaviour` per protocol. Tracking crates.io releases gets upstream fixes without keeping a fork rebased. Upstream changed two gossipsub behaviours this node depends on: - libp2p-gossipsub 0.50 made `MaxCountSubscriptionFilter` the default (100 topics per peer and per RPC, whole subscription RPC ignored when over). A mainnet peer custodying every column subnet is over that alone, so the `Gossipsub` alias keeps `AllowAllSubscriptionFilter`. - `max_messages_per_rpc` became `max_publish_messages`, and an RPC over the limit now fails to decode and closes the inbound stream instead of being truncated. libp2p-mplex is taken from crates.io at the release libp2p's own dev-dependency names. libp2p-quic 0.14 prefers X25519MLKEM768, which brings aws-lc-rs (a C build) into rustls. libp2p-swarm pins wasm-bindgen-futures, which moves the wasm-bindgen crates back. Every new crate was pinned to its newest release past the 14-day publish-age cooldown, except four with no such release: libp2p 0.57.1, libp2p-peer-store 0.1.0, crypto-bigint 0.7.10 and ctutils 0.4.6. crypto-bigint 0.7.0 to 0.7.8 are yanked, and every libp2p 0.57.x reaches it through libp2p-identity 0.3 and k256 0.14, so no older libp2p avoids it.
…stream-libp2p # Conflicts: # Cargo.lock
This branch has not been deployed
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.
🗒️ Description / Motivation
lambdaclass/rust-libp2pfork (rev2f14d0e) with the crates.io releaselibp2p 0.57.1, and takeslibp2p-mplex 0.44.0from crates.io too.send_request_with_protocol. Nothing calls it since req/resp became onerequest_response::Behaviourper protocol, so the fork now only costs rebasing.What Changed
crates/net/p2p/Cargo.toml:libp2p = "0.57.1"andlibp2p-mplex = "0.44.0"instead of the git dependency.Cargo.lock: re-resolved. Every new crate is pinned to its newest release past the cooldown, except the four listed below.mainis merged in, and chore(deps): bump quinn-proto, h2, rkyv and crossbeam-epoch past RustSec advisories #718'squinn-proto,h2,rkyvandcrossbeam-epochbumps are kept.crates/net/p2p/src/lib.rs: aGossipsubalias that keepsAllowAllSubscriptionFilter, andmax_publish_messages(500)in place of the removedmax_messages_per_rpc(Some(500)).crates/net/p2p/src/beacon/scoring.rs(tests): use the alias.lib.rs,swarm_adapter.rsandreq_resp/behaviour.rsthat pointed at the fork; the libp2p line inCLAUDE.md.Correctness / Behavior Guarantees
MaxCountSubscriptionFilter: 100 topics per peer and per RPC, and a peer over either limit has its whole subscription RPC ignoredGossipsubalias. A mainnet peer custodying every column subnet is over the limit from those subnets alone, and every peer doubles its topic set around a fork-digest rollovermax_messages_per_rpcbecamemax_publish_messagesmax_control_message_size, default 16384 bytes)aws-lc-rs(a C build) into rustls. The Docker builder already has a C toolchainwith_smart_dial)DIAL_ADDRESS_CONCURRENCYis unchangedwasm-bindgen-futures = "=0.4.58"wasm-bindgen,js-sysandweb-sysback in the lockfilePublish-age cooldown
Four crates have no release old enough yet:
libp2p-peer-store 0.1.0libp2p 0.57.1ctutils 0.4.6crypto-bigint 0.7.10No older libp2p avoids the last two. Every
libp2p 0.57.xneedslibp2p-identity ^0.3, which reachescrypto-bigint ^0.7.5throughk256 0.14(our secp256k1 node keys) andelliptic-curve 0.14.1.crypto-bigint0.7.0 to 0.7.8 are all yanked over a breaking fix (RustCrypto/crypto-bigint#1373), so 0.7.9 and 0.7.10 are the only candidates, and both are under two weeks old.The
Dependency cooldownjob will pass with a warning until then: its probe cannot resolvelibp2p ^0.57.1under the cooldown, and a failed probe only warns. While it fails, it checks nothing else in the lockfile. I ran the same probe locally with only these four crates held locked: nothing else in the lockfile is too young.Tests Added / Run
make fmtandmake lint: clean.cargo test --profile release-fast -p ethlambda-p2p --lib: 360 passed.cargo test --profile release-fast -p ethlambda --bins: 261 passed.make test, and a run against mainnet or devnet peers.Open questions
max_control_message_sizebe raised? Upstream rejects an inbound RPC whose subscriptions plus control data exceed it, and does not split its own outgoing IHAVEs to fit.--custody-group-count 128now announces more than 100 topics in one hello RPC. How do peers that cap subscriptions per RPC treat it?features = ["full"]be narrowed to what we use? That dropslibp2p-peer-storeand the unused transports and protocols.Related Issues / PRs
✅ Verification Checklist
make fmt— cleanmake lint(clippy with-D warnings) — cleanmake test(test-consensusplustest-node, atrelease-fast) — onlyethlambda-p2p --libandethlambda --binsso far