@@ -62,7 +62,10 @@ import type * as PromClient from 'prom-client'
62
62
import { GossipManager } from './gossip.js'
63
63
64
64
export abstract class BaseNetwork extends EventEmitter {
65
- public capabilities : number [ ] = [ 0 , 1 , 65535 ]
65
+ public capabilities : number [ ] = [
66
+ PingPongPayloadExtensions . CLIENT_INFO_RADIUS_AND_CAPABILITIES ,
67
+ PingPongPayloadExtensions . BASIC_RADIUS_PAYLOAD ,
68
+ ]
66
69
static MAX_CONCURRENT_UTP_STREAMS = 50
67
70
public routingTable : PortalNetworkRoutingTable
68
71
public nodeRadius : bigint
@@ -321,7 +324,9 @@ export abstract class BaseNetwork extends EventEmitter {
321
324
switch ( type ) {
322
325
case PingPongPayloadExtensions . CLIENT_INFO_RADIUS_AND_CAPABILITIES : {
323
326
const { ClientInfo, Capabilities } = ClientInfoAndCapabilities . deserialize ( payload )
324
- this . logger . extend ( 'PONG' ) ( `Client ${ shortId ( enr . nodeId ) } is ${ decodeClientInfo ( ClientInfo ) . clientName } node with capabilities: ${ Capabilities } ` )
327
+ this . logger . extend ( 'PONG' ) (
328
+ `Client ${ shortId ( enr . nodeId ) } is ${ decodeClientInfo ( ClientInfo ) . clientName } node with capabilities: ${ Capabilities } ` ,
329
+ )
325
330
break
326
331
}
327
332
case PingPongPayloadExtensions . BASIC_RADIUS_PAYLOAD : {
@@ -380,17 +385,19 @@ export abstract class BaseNetwork extends EventEmitter {
380
385
pongPayload = this . pingPongPayload ( type )
381
386
break
382
387
}
383
- case PingPongPayloadExtensions . HISTORY_RADIUS_PAYLOAD : {
388
+ case PingPongPayloadExtensions . HISTORY_RADIUS_PAYLOAD : {
384
389
if ( this . networkId !== NetworkId . HistoryNetwork ) {
385
390
pongPayload = ErrorPayload . serialize ( {
386
391
errorCode : 0 ,
387
- message : hexToBytes ( fromAscii ( 'HISTORY_RADIUS extension not supported on this network' ) ) ,
392
+ message : hexToBytes (
393
+ fromAscii ( 'HISTORY_RADIUS extension not supported on this network' ) ,
394
+ ) ,
388
395
} )
389
396
} else {
390
- const { dataRadius } = HistoryRadius . deserialize ( payload )
391
- this . routingTable . updateRadius ( src . nodeId , dataRadius )
392
- pongPayload = this . pingPongPayload ( type )
393
- }
397
+ const { dataRadius } = HistoryRadius . deserialize ( payload )
398
+ this . routingTable . updateRadius ( src . nodeId , dataRadius )
399
+ pongPayload = this . pingPongPayload ( type )
400
+ }
394
401
break
395
402
}
396
403
default : {
0 commit comments