AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 18 Bitcoin

multi: switch from btcsuite/websocket to gorilla/websocket

Public commit record

What the developer wrote

Authored by Boris Nagaev

83/100 · Strong
multi: switch from btcsuite/websocket to gorilla/websocket

btcsuite/websocket is a copy of gorilla/websocket. gorilla/websocket is
maintained and already a test dependency.

The one difference btcd depends on: when the peer sends a normal close
frame, the old code returned io.EOF from ReadMessage, while gorilla
returns a *CloseError. Treat that like io.EOF in the read loops of the
RPC server and rpcclient, so clean disconnects aren't logged as errors.

Add a websocket test server for the RPC server that runs without a
chain, and use it to test that a normal close isn't logged.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Mentions testing or verification
The short version

What changed, and why it matters

This commit swaps btcd's websocket library from an old, unmaintained in-house copy to the actively maintained gorilla/websocket. The only behavior change is that the new library reports a normal peer disconnect differently, so the code now treats a normal close frame like a clean disconnect instead of logging it as an error. There is no direct security vulnerability being fixed; it is primarily a maintenance and noise-reduction change.

Recommended action

Treat as routine maintenance. Reviewers should verify that all websocket close paths (normal, going away, abnormal) are handled consistently and that no other behavioral differences between btcsuite/websocket and gorilla/websocket affect production logic.

Security signals we found

01

Dependency switched from unmaintained fork to maintained upstream websocket library

02

Behavior change only in error classification for clean disconnects

03

No memory corruption, authentication bypass, or cryptographic weakness visible in diff

04

Added tests confirm normal close frames are not logged as errors

Risk score

Why this scored 18/100

Our methodology →
Potential impact 2/30
Exploitability 0/25
Stealth signal 1/15
Affected reach 3/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.