Conversation
- Changed the subgraph client URLs in `client_test.go` to point to the new Graph API endpoint for the Lumerin Futures subgraph. - Ensured that both `TestGetAllPositions` and `TestGetPositionsBySeller` use the updated URL for consistency in testing.
- Changed the subgraph client URLs in `client_test.go` to point to the new Graph API endpoint for the Lumerin Futures subgraph. - Ensured that both `TestGetAllPositions` and `TestGetPositionsBySeller` use the updated URL for consistency in testing.
Fixes crash loop caused by new miners sending mining.extranonce.subscribe messages during handshake phase. Changes: 1. Made logWithContext() defensive against nil destination connections - Prevents panic when logging before connection fully established - Returns "not-connected" instead of crashing on nil pointer dereference 2. Added explicit handling for MiningExtranonceSubscribe messages - Properly forwards extranonce subscription requests to pool - Logs at debug level for visibility - Prevents falling through to unknown message handler Root Cause: New miners added to seller node send mining.extranonce.subscribe during initial handshake. This legitimate Stratum extension message wasn't explicitly handled, causing it to fall through to default case. The logging in default case attempted to access p.dest.conn.conn.LocalAddr() which was nil during early handshake, triggering panic and container restart every 5-6 minutes. Impact: - Resolves continuous crash loop since 2026-02-10 13:16 ET - Enables modern miners with extranonce support to connect properly - Future-proofs logging against similar edge cases Co-authored-by: Cursor <cursoragent@cursor.com>
…#83) ## Summary Fixes crash loop caused by new miners sending `mining.extranonce.subscribe` messages during handshake phase. ## Root Cause New miners added to seller node on 2026-02-10 send the `mining.extranonce.subscribe` Stratum extension message during initial handshake. This legitimate protocol message wasn't explicitly handled in the handshake switch statement, causing it to fall through to the default case. The default case attempted to log a warning, which called `logWithContext()`. This logging function accessed `p.dest.conn.conn.LocalAddr()` which was nil during early handshake, triggering a panic and container restart every 5-6 minutes. ## Changes Made ### 1. Defensive Logging (proxy.go) Made `logWithContext()` nil-safe by checking all pointer levels before accessing: - Checks if `p.dest` is nil - Checks if `p.dest.conn` is nil - Checks if `p.dest.conn.conn` is nil - Returns "not-connected" or "not-initialized" instead of panicking ### 2. Handle mining.extranonce.subscribe (handler_first_connect.go) Added explicit case for `MiningExtranonceSubscribe` messages: - Logs at debug level for visibility - Forwards message transparently to pool - Prevents falling through to unknown message handler ## Impact - ✅ Resolves continuous crash loop since 2026-02-10 13:16 ET - ✅ Enables modern miners with extranonce support to connect properly - ✅ Future-proofs logging against similar edge cases with nil connections - ✅ No performance impact (just pointer checks) ## Testing - Code compiles successfully - Crash pattern analysis confirms this fixes the exact panic location - Logs show the message is a legitimate Stratum extension that should pass through ## CloudWatch Evidence All crashes showed identical stack trace: ``` panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x110 pc=0x90b25f] at proxy.go:453 in logWithContext() ``` Preceded by unknown message logs showing `mining.extranonce.subscribe`. Made with [Cursor](https://cursor.com)
LumerinIO
approved these changes
Feb 10, 2026
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.
No description provided.