Repository navigation
Continue Bedrock compatibility improvements #25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
fcb23c5
fix(replay): retain staged artifact hashes before cleanup
AlexProgrammerDE 509896d
fix(replay): start proxy scene timing after initialized input
AlexProgrammerDE 283f094
fix(viaproxy): prevent native callback deadlocks at JVM exit
AlexProgrammerDE 447546d
fix(replay): publish complete artifact receipts exclusively
AlexProgrammerDE a1c5b77
fix(replay): reject captures without admitted gameplay
AlexProgrammerDE File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
40 changes: 40 additions & 0 deletions
40
patches/viaproxy/upstreamable/0002-update-native-binding-to-avoid-exit-deadlocks.patch
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| From 17d2f70292d506882755f3799a1d1fa9e8ac9527 Mon Sep 17 00:00:00 2001 | ||
| From: AlexProgrammerDE <40795980+AlexProgrammerDE@users.noreply.github.com> | ||
| Date: Mon, 2 Nov 2026 23:40:42 +0100 | ||
| Subject: [PATCH] fix(nethernet): update native binding to avoid exit deadlocks | ||
|
|
||
| The September libdatachannel bundle can deadlock when the JVM exits during a data-channel callback. C++ static registry destruction waits for a callback mutex after Java callbacks have stopped. | ||
|
|
||
| Use the October 29 bundle already consumed by the Bedrock add-on. Its C API registries have process lifetime and retain explicit rtcCleanup support, so process exit does not destroy active channels on the halted VM thread. | ||
|
|
||
| The published Java and native artifacts match their advertised SHA-256 checksums. Their source chain is libdatachannel-java 6be4ad71e1f10dc56a09af6daeac0e1122e23e7a, libdatachannel 3db103e248d7aeb2d7c48da29f0c0f82efd2cadd, and libjuice 67bfe8903b8d6a5dcf8d731271aec68257cb2872. | ||
|
|
||
| A real loopback callback-overlap probe hangs with the previous bundle and exits normally with the new bundle on Linux with JDK 17 and 25. Explicit peer-close and awaited-close controls still pass. Other native platforms require their own runtime verification. | ||
|
|
||
| Pin the Java facade and native bundle to the same immutable Maven publication. Exclude the facade from NetherNet using its group and module separately, and from the bundle before adding the explicit matching facade. The previous colon-delimited exclusion did not remove NetherNet's older facade, which could be packaged beside newer JNI binaries. | ||
| --- | ||
| build.gradle | 8 ++++++-- | ||
| 1 file changed, 6 insertions(+), 2 deletions(-) | ||
|
|
||
| diff --git a/build.gradle b/build.gradle | ||
| index 43f58fd..c8caaf0 100644 | ||
| --- a/build.gradle | ||
| +++ b/build.gradle | ||
| @@ -119,9 +119,13 @@ dependencies { | ||
| includeInJar("org.cloudburstmc.netty:netty-transport-nethernet:2.0.0.CR4-20261001.235918-13") { | ||
| exclude group: "io.netty" | ||
| exclude group: "org.bouncycastle" | ||
| - exclude group: "dev.opencollab:libdatachannel-java" | ||
| + exclude group: "dev.opencollab", module: "libdatachannel-java" | ||
| + } | ||
| + def libDataChannelVersion = "0.24.6.0-20261029.091642-10" | ||
| + includeInJar "dev.opencollab:libdatachannel-java:$libDataChannelVersion" | ||
| + includeInJar("dev.opencollab:libdatachannel-java-arch-detect:$libDataChannelVersion") { | ||
| + exclude group: "dev.opencollab", module: "libdatachannel-java" | ||
| } | ||
| - includeInJar "dev.opencollab:libdatachannel-java-arch-detect:0.24.6.0-20260930.214316-2" | ||
| includeInJar "gs.mclo:api:6.2.1" | ||
| includeInJar "net.lenni0451:optconfig:1.1.1" | ||
|
|
||
| -- | ||
| 2.56.0 |
24 changes: 24 additions & 0 deletions
24
.../viaproxy/upstreamable/0002-update-native-binding-to-avoid-exit-deadlocks.pr.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| Update the libdatachannel bundle to the version already used by the Bedrock add-on. | ||
| The owning patch records the native registry lifetime change and exact source revisions. | ||
|
|
||
| The published Java API and native bundle match their advertised Maven SHA-256 checksums. | ||
| Callback-overlap, explicit-close, and awaited-close controls pass on Linux with JDK 17 and 25. | ||
| The previous bundle hangs during the same callback-overlap control. | ||
|
|
||
| The [process regression](../../../src/replay/java/net/pistonmaster/stackanvil/replay/NativeShutdownSelfTest.java) opens a real loopback data channel and exits its JVM while the native callback remains active. | ||
| The parent requires a normal exit and verifies that callback overlap occurred. | ||
| The full proxy stack and standalone upstream patch build pass. | ||
| Transport self-tests and the native process regression pass with the rebuilt proxy. | ||
| Its Java API classes and all eight native binaries match the verified Maven artifacts. | ||
|
|
||
| An installed Lifeboat attempt stopped before gameplay after an HTTP 503 response. | ||
| Cancellation stopped all owned processes normally and retained the artifact receipts. | ||
| A retry recorded 20.65 seconds after gameplay readiness with matching staged artifact hashes. | ||
| The journal contains 3,755 complete frames, and normal cleanup retained both artifact receipts. | ||
| Cancellation before gameplay readiness also stopped all owned processes after the native backend connected. | ||
|
|
||
| The saved Lifeboat view remains obscured by large geometry. | ||
| These checks establish recording and shutdown behavior; visual spawn compatibility remains open. | ||
|
|
||
| These checks establish selected Linux lifecycle behavior. | ||
| Windows, macOS, and broader networking and native gameplay parity require separate validation. |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { createHash } from "node:crypto"; | ||
| import { createReadStream } from "node:fs"; | ||
| import { link, mkdtemp, rm, writeFile } from "node:fs/promises"; | ||
| import { basename, dirname, join } from "node:path"; | ||
|
|
||
| interface ReplayArtifact { | ||
| role: "client-mod" | "transport" | "proxy-recorder"; | ||
| path: string; | ||
| } | ||
|
|
||
| /** Retain the staged bytes' identity before launch and private dependency cleanup. */ | ||
| export async function writeReplayArtifactEvidence( | ||
| output: string, | ||
| files: readonly ReplayArtifact[], | ||
| ): Promise<void> { | ||
| const artifacts = []; | ||
| for (const file of files) { | ||
| const hash = createHash("sha256"); | ||
| let bytes = 0; | ||
| for await (const chunk of createReadStream(file.path)) { | ||
| hash.update(chunk); | ||
| bytes += chunk.length; | ||
| } | ||
| artifacts.push({ | ||
| role: file.role, | ||
| file: basename(file.path), | ||
| bytes, | ||
| sha256: hash.digest("hex"), | ||
| }); | ||
| } | ||
| const staging = await mkdtemp(join(dirname(output), ".artifact-evidence-")); | ||
| try { | ||
| const temporary = join(staging, "receipt.json"); | ||
| await writeFile(temporary, `${JSON.stringify({ schema: 1, artifacts }, null, 2)}\n`, { | ||
| mode: 0o600, | ||
| flag: "wx", | ||
| }); | ||
| // Publish complete bytes without replacing evidence from another attempt. | ||
| await link(temporary, output); | ||
| } finally { | ||
| await rm(staging, { recursive: true, force: true }); | ||
| } | ||
| } |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.