Skip to content

Releases: Lumerin-protocol/proxy-router

proxy-router-v3.6.0

10 Feb 21:05
4a1c46d

Choose a tag to compare

fix: add nil check before writing to dest in handshake handle - LMN (…

proxy-router-v3.5.0

10 Feb 20:40
a0a6801

Choose a tag to compare

fix: handle mining.extranonce.subscribe and prevent nil pointer crash…

proxy-router-v3.5.1-stg

10 Feb 21:04
5884308

Choose a tag to compare

Pre-release
fix: add nil check before writing to dest in handshake handle - STG (…

proxy-router-v3.5.1-dev

10 Feb 21:03
fb90d90

Choose a tag to compare

Pre-release
fix: add nil check before writing to dest in handshake handler (#86)

## Summary
Fixes secondary crash discovered after PR #83 deployment. Adds defensive
nil checks before attempting to write to destination during handshake
phase.

## Root Cause
After deploying PR #83 (which fixed the logging crash), a second nil
pointer issue was discovered at 2026-02-10 20:56 UTC:

When miners send unexpected protocol messages before the destination
connection is initialized (e.g., `eth_submitLogin` from Ethereum miners
connecting to Bitcoin proxy), the code attempts to forward the message
via `p.proxy.dest.Write()`. However, `p.proxy.dest` is nil during early
handshake, causing panic at `conn_dest.go:139` via
`handler_first_connect.go:83`.

## Changes Made
Added defensive nil checks in `handler_first_connect.go` before writing
to dest:

1. **MiningExtranonceSubscribe case:**
   - Check if `p.proxy.dest != nil` before forwarding
   - Return nil, nil if dest not ready (safe drop)

2. **Default case (unknown messages):**
   - Check if `p.proxy.dest != nil` before forwarding  
   - Return nil, nil if dest not ready (safe drop)
   - Updated comment to clarify behavior

## Impact
- ✅ Resolves secondary crash pattern at conn_dest.go:139
- ✅ Handles protocol mismatches gracefully (e.g., Ethereum miners on
Bitcoin proxy)
- ✅ Complements PR #83 to fully stabilize handshake phase
- ✅ No performance impact (just pointer checks)

## Evidence
**Crash pattern:**
```
panic: runtime error: invalid memory address or nil pointer dereference  
[signal SIGSEGV: segmentation violation code=0x1 addr=0x110 pc=0x8feae6]
at conn_dest.go:139 via handler_first_connect.go:83
```

**Trigger log (showing PR #83 logging fix working):**
```json
{"level":"warn","logger":"PRX","msg":"unknown handshake message from source: {\"id\":2,\"method\":\"eth_submitLogin\"...}",
"SrcAddr":"188.166.37.58:47284","DstAddr":"not-initialized","DstPort":"not-connected"}
```

The logging successfully showed "not-initialized" and "not-connected"
(PR #83 fix working), but then crashed trying to forward the message.

## Dependencies
- Requires PR #83 to be merged first (already done)
- This is a follow-up fix discovered during production monitoring


Made with [Cursor](https://cursor.com)

proxy-router-v3.4.2-stg

10 Feb 20:32
935cc53

Choose a tag to compare

Pre-release
fix: handle mining.extranonce.subscribe and prevent nil pointer crash…

proxy-router-v3.4.2-dev

10 Feb 20:23
04c4d0a

Choose a tag to compare

Pre-release
fix: handle mining.extranonce.subscribe and prevent nil pointer crash…

proxy-router-v3.4.1-dev

30 Jan 14:45
ddec6a4

Choose a tag to compare

Pre-release
fix: Update subgraph client URLs in tests (#82)

- 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.

proxy-router-v3.4.0

29 Jan 17:10
57bafda

Choose a tag to compare

fix: pass all messages and handle incorrect ordering - MAIN (#81)

proxy-router-v3.3.0

29 Jan 15:46
709f591

Choose a tag to compare

feat: mining-subscribe-extranonce passthrough - MAIN (#78)

proxy-router-v3.3.1-stg

29 Jan 17:07
e199a46

Choose a tag to compare

Pre-release
fix: pass all messages and handle incorrect ordering - STG (#80)