Isolate Connect libp2p runtime from server Netty#37
Merged
Conversation
1cabdf0 to
00da2ce
Compare
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.
Summary
CONNECT_LIBP2P_*env varsWhy
Paper 1.21.6 exposed a runtime ABI failure while starting endpoint libp2p:
NoSuchMethodError: io.netty.channel.SingleThreadEventLoop.<init>(...).Catching
LinkageErrorprotected plugin startup, but only gave fallback. This PR lets the same older Paper server run endpoint libp2p by isolating libp2p dependencies from the server/plugin classpath.The staging validation also found an anycast correctness issue: the endpoint authorized only the first configured edge peer. When the endpoint registered through one Fly machine and a player landed on another, the second proxy's libp2p session could be rejected before
session_ack. The endpoint now accepts all managed edge/relay peers supplied by the server bootstrap.Verification
./gradlew buildon headb792544a4e2e43e12272378831aabb09f9fa1ac5git diff --check./gradlew -q :core:test --tests 'com.minekube.connect.tunnel.p2p.Libp2pEndpointConfigTest'./gradlew -q :core:test --tests 'com.minekube.connect.tunnel.p2p.*'./gradlew -q :core:test --tests '*Libp2pRuntimeBoundaryTest' --tests '*Libp2pRuntimeLoaderTest'./gradlew -q :core:test --tests '*PeerRegistration*' --tests '*SameStream*' --tests '*TunnelHandlerTest' --tests '*Libp2pTunnelTransportTest' --tests '*EndpointLibp2pHostTest' --tests '*Libp2pEndpointTest' --tests '*Libp2pRuntimeBoundaryTest' --tests '*Libp2pRuntimeLoaderTest'./gradlew -q :spigot:shadowJar :bungee:shadowJar :velocity:shadowJar :spigot:verifyLibp2pRuntimeIsolation :bungee:verifyLibp2pRuntimeIsolation :velocity:verifyLibp2pRuntimeIsolationLocal E2E evidence
localhost:25566.connect-spigot.jarregistered endpointcraftless-localwith peer12D3KooWKGABHVz3McHdC3dbVFw9v9VYyd1azUsfQxUz6vah8rXaand no longer failed on the oldSingleThreadEventLoopNetty constructor.d8vsemehs1b4ja7qhlcgforPlayer26withselectedTransport=direct,selectedAddr=/ip4/127.0.0.1/tcp/49238,warmPath=warm, andconnectionStatus=successafter298.4095ms.Connect tunneled player logged in as Player26,Player26 joined the game, and accepted chathello from Craftless Fabric smoke. The later disconnect was the smoke client exiting intentionally.Fly staging evidence
Validated previous fixed head
a6e0011763b352c56af91d5a5cae6975dc80cc20against Fly staging with an offline-mode Paper 1.21.6 endpoint. The later headb792544a4e2e43e12272378831aabb09f9fa1ac5adds managed bootstrap/no-env-var wiring and passed./gradlew buildlocally.Player432,Player198,Player51,Player59). Public routing hit machine287e6d1ae36e48; Moxy loggedlibp2p session acceptedwithselectedTransport=direct,warmPath=warm, andconnectionStatus=success.Player141, sessiond90coiri940s21t52kq0, machine6832e0da270568,selectedTransport=direct,warmPath=warm,connectionStatus=success, duration1.34243085s.Player213, sessiond90cov2cinjc207c1en0, machine287e6d1ae36e48,selectedTransport=direct,warmPath=warm,connectionStatus=success, duration926.957364ms.Player327at2026-06-28T08:09:16Z, sent marker chatcraftless public 31min supervised smoke 080854, held until2026-06-28T08:40:18Z, and Gradle exited0withBUILD SUCCESSFUL in 31m 14s.d90ddari940s21t52kugon machine6832e0da270568;libp2p session acceptedloggedselectedTransport=direct, selected address/ip6/fdaa:1:71d4:a7b:35b:4321:3084:7100/tcp/62140,warmPath=warm, request kindjoin, protocoljava;player joined endpointcompleted withconnectionStatus=successin974.490113ms.Connect tunneled player logged in as Player327,Player327 joined the game, marker chat at10:09:17Europe/Berlin, then the only disconnect at10:40:18after the configured hold ended. NoTimed out,Read timed out,Internal server connection error, or unexpected Moxyfailed before acceptoccurred for that final session.Artifacts are recorded in the Moxy readiness plan at
docs/superpowers/plans/2026-06-18-connect-libp2p-pr265-readiness.md.Related
Review follow-up on head
c64ada287c952ef3572dbaac2a3560b9068efd44:com.minekube.connect.tunnel.p2pimplementation classes while keeping parent-facing API wrappers on the plugin classpath.verifyLibp2pRuntimeIsolationintocheckand made it skip artifacts that intentionally do not contain the libp2p runtime wrappers../gradlew -q :core:test --tests 'com.minekube.connect.tunnel.p2p.Libp2pRuntimeLoaderTest' :spigot:verifyLibp2pRuntimeIsolation :bungee:verifyLibp2pRuntimeIsolation :velocity:verifyLibp2pRuntimeIsolationand./gradlew build.