fix: null socket on bb process exit/error in native_socket.ts#22309
Merged
Conversation
When the bb helper process crashes, the socket was destroyed but not nulled. This meant subsequent calls to call() would pass the null check and attempt to write to a destroyed socket. While existing error handlers would eventually reject the callbacks, nulling the socket reference makes the guard clause catch dead sockets immediately.
ludamad
approved these changes
Apr 3, 2026
github-merge-queue Bot
pushed a commit
that referenced
this pull request
Apr 4, 2026
BEGIN_COMMIT_OVERRIDE chore: upgrade uintx assert to run in release (#22289) chore: Fix log statement in ECDSA test (#22285) fix: avoid oob access in RAM / ROM and enable soft-fail (#22301) fix: restore test execution in ci-barretenberg CI modes (#22303) fix: minor fixes pt. 5 (#22306) chore: comment about standard behavior for de bruijn (#22310) fix: null socket on bb process exit/error in native_socket.ts (#22309) END_COMMIT_OVERRIDE
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
Defensive hardening of the native socket backend used by
ChonkBatchVerifier.When the bb helper process crashes (e.g. SIGABRT), the socket was destroyed but the reference was not nulled. This meant subsequent calls to
call()would pass theif (!this.socket)guard and attempt to write to a destroyed socket. While the existing socket error/end handlers would eventually reject callbacks via async error events, nulling the socket makes the guard clause reject immediately — fail-fast rather than relying on async error propagation.Changes:
this.socketafterdestroy()in processerrorhandlerthis.socketafterdestroy()in processexithandlerthis.socketafterdestroy()incleanup()methodTest plan
call()now throwSocket not connectedimmediately instead of writing to a destroyed socket and waiting for the async error eventClaudeBox log: https://claudebox.work/s/1164aa0ab601318b?run=5