You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Gather all the running protocol infos (only once per protocol type)
for_, proto:=rangesrv.Protocols {
if_, ok:=info.Protocols[proto.Name]; !ok {
nodeInfo:=interface{}("unknown")
ifquery:=proto.NodeInfo; query!=nil {
nodeInfo=proto.NodeInfo()
}
info.Protocols[proto.Name] =nodeInfo
}
}
returninfo
}
Description: Root cause — adminAPI.NodeInfo simply forwards to Server.NodeInfo(), which builds info.Protocols generically by calling each registered protocol's NodeInfo() callback (proto.NodeInfo()) and storing whatever value that callback returns, or the literal string "unknown" if the protocol registered no callback. Whether an eth protocol handler still reports a difficulty field is entirely up to that handler's own NodeInfo implementation; post-merge chains have no meaningful proof-of-work difficulty to report, so the field is no longer populated, making the documentation's fixed example value (17179869184) unreproducible on current networks.
Method: admin_nodeInfo
2. admin_startWS: admin_startWS uses a *int port decoded from a JSON number, not the documented *rpc.HexNumber quantity
Statement: admin_startWS uses a *int port decoded from a JSON number, not the documented *rpc.HexNumber quantity.
Description: Root cause — adminAPI.StartWS(host *string, port *int, allowedOrigins *string, apis *string) declares port as a plain *int, which the standard JSON-RPC codec decodes from an ordinary JSON number (and defaults to api.node.config.WSPort when omitted); no *rpc.HexNumber type — a hex-string-decoding wrapper used elsewhere in the legacy RPC layer — appears anywhere in this handler's signature or in the wsServerForPort lookup that consumes the resolved port. The documented hex-quantity type therefore describes a decoding rule this parameter does not follow.
Method: admin_startWS
3. admin_stopWS: admin_stopWS returns true after invoking stop routines even when no WebSocket endpoint was actually closed
Statement: admin_stopWS returns true after invoking stop routines even when no WebSocket endpoint was actually closed.
Description: Root cause — adminAPI.StopWS unconditionally calls api.node.http.stopWS() and api.node.ws.stop() and then return true, nil, without inspecting either call's return value or otherwise checking whether a WebSocket listener was actually running and got closed; the underlying stop() implementations themselves treat "not running" as a no-op success (if is.listener == nil { return nil }), so there is no signal anywhere in the chain that would make StopWS report anything other than unconditional success, even when there was nothing to stop.
1.
admin_nodeInfo:admin_nodeInfono longer populatesprotocols.eth.difficulty, leaving the documented fixed difficulty example unproducibleadmin_nodeInfono longer populatesprotocols.eth.difficulty, leaving the documented fixed difficulty example unproducible.node/api.go:312-318—go-ethereum/node/api.go
Lines 312 to 318 in 81ab8b5
p2p/server.go:1046-1063—go-ethereum/p2p/server.go
Lines 1046 to 1063 in 81ab8b5
adminAPI.NodeInfosimply forwards toServer.NodeInfo(), which buildsinfo.Protocolsgenerically by calling each registered protocol'sNodeInfo()callback (proto.NodeInfo()) and storing whatever value that callback returns, or the literal string"unknown"if the protocol registered no callback. Whether anethprotocol handler still reports adifficultyfield is entirely up to that handler's ownNodeInfoimplementation; post-merge chains have no meaningful proof-of-work difficulty to report, so the field is no longer populated, making the documentation's fixed example value (17179869184) unreproducible on current networks.admin_nodeInfo2.
admin_startWS:admin_startWSuses a*intport decoded from a JSON number, not the documented*rpc.HexNumberquantityadmin_startWSuses a*intport decoded from a JSON number, not the documented*rpc.HexNumberquantity.node/api.go:238-255—go-ethereum/node/api.go
Lines 238 to 255 in 81ab8b5
node/node.go:507-516—go-ethereum/node/node.go
Lines 507 to 516 in 81ab8b5
adminAPI.StartWS(host *string, port *int, allowedOrigins *string, apis *string)declaresportas a plain*int, which the standard JSON-RPC codec decodes from an ordinary JSON number (and defaults toapi.node.config.WSPortwhen omitted); no*rpc.HexNumbertype — a hex-string-decoding wrapper used elsewhere in the legacy RPC layer — appears anywhere in this handler's signature or in thewsServerForPortlookup that consumes the resolved port. The documented hex-quantity type therefore describes a decoding rule this parameter does not follow.admin_startWS3.
admin_stopWS:admin_stopWSreturnstrueafter invoking stop routines even when no WebSocket endpoint was actually closedadmin_stopWSreturnstrueafter invoking stop routines even when no WebSocket endpoint was actually closed.node/api.go:294-298—go-ethereum/node/api.go
Lines 294 to 298 in 81ab8b5
node/rpcstack.go:633-645—go-ethereum/node/rpcstack.go
Lines 633 to 645 in 81ab8b5
adminAPI.StopWSunconditionally callsapi.node.http.stopWS()andapi.node.ws.stop()and thenreturn true, nil, without inspecting either call's return value or otherwise checking whether a WebSocket listener was actually running and got closed; the underlyingstop()implementations themselves treat "not running" as a no-op success (if is.listener == nil { return nil }), so there is no signal anywhere in the chain that would makeStopWSreport anything other than unconditional success, even when there was nothing to stop.admin_stopWS