Location
core/src/feeds/binance/binance-feed.ts:153
Code
private establishConnection(): Promise<void> {
return new Promise((resolve, reject) => {
const url = this.apiKey
? `${this.wsUrl}?key=${this.apiKey}`
: this.wsUrl;
const ws = new WebSocket(url);
ws.on('open', () => {
this.ws = ws;
this.connectionPromise = null;
ws.send(JSON.stringify({ op: 'subscribe_all' }));
resolve();
});
Risk
Same pattern as Chainlink feed: the connection promise has no timeout. If the Binance WebSocket endpoint hangs (no open, no error), the promise never settles and all Binance price feed data subscriptions block indefinitely.
Affected Methods
BinanceFeed.connect() → establishConnection()
- All Binance price feed subscriptions and data consumers
Suggested Fix
const timeout = setTimeout(() => {
ws.terminate();
reject(new Error('Binance WebSocket connection timeout'));
}, 15_000);
ws.on('open', () => { clearTimeout(timeout); /* ... */ resolve(); });
ws.on('error', (err) => { clearTimeout(timeout); reject(err); });
Found by automated missing timeout audit
Location
core/src/feeds/binance/binance-feed.ts:153Code
Risk
Same pattern as Chainlink feed: the connection promise has no timeout. If the Binance WebSocket endpoint hangs (no
open, noerror), the promise never settles and all Binance price feed data subscriptions block indefinitely.Affected Methods
BinanceFeed.connect()→establishConnection()Suggested Fix
Found by automated missing timeout audit