Skip to content

Commit 3fb2e08

Browse files
authored
rm exp_ RPC API infrastructure; had no actual RPC endpoints (#2635)
* rm exp_ RPC API infrastructure; had no actual RPC endpoints * update command-line flag descriptions
1 parent 0ee8e61 commit 3fb2e08

File tree

4 files changed

+7
-55
lines changed

4 files changed

+7
-55
lines changed

nimbus/config.nim

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,6 @@ type
122122
## RPC flags
123123
Eth ## enable eth_ set of RPC API
124124
Debug ## enable debug_ set of RPC API
125-
Exp ## enable exp_ set of RPC API
126125

127126
DiscoveryType* {.pure.} = enum
128127
None
@@ -451,7 +450,7 @@ type
451450
name: "rpc" }: bool
452451

453452
rpcApi {.
454-
desc: "Enable specific set of RPC API (available: eth, debug, exp)"
453+
desc: "Enable specific set of RPC API (available: eth, debug)"
455454
defaultValue: @[]
456455
defaultValueDesc: $RpcFlag.Eth
457456
name: "rpc-api" }: seq[string]
@@ -462,7 +461,7 @@ type
462461
name: "ws" }: bool
463462

464463
wsApi {.
465-
desc: "Enable specific set of Websocket RPC API (available: eth, debug, exp)"
464+
desc: "Enable specific set of Websocket RPC API (available: eth, debug)"
466465
defaultValue: @[]
467466
defaultValueDesc: $RpcFlag.Eth
468467
name: "ws-api" }: seq[string]
@@ -702,7 +701,6 @@ proc getRpcFlags(api: openArray[string]): set[RpcFlag] =
702701
case item.toLowerAscii()
703702
of "eth": result.incl RpcFlag.Eth
704703
of "debug": result.incl RpcFlag.Debug
705-
of "exp": result.incl RpcFlag.Exp
706704
else:
707705
error "Unknown RPC API: ", name=item
708706
quit QuitFailure

nimbus/rpc.nim

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import
1919
./rpc/jwt_auth,
2020
./rpc/cors,
2121
./rpc/rpc_server,
22-
./rpc/experimental,
2322
./rpc/oracle,
2423
./rpc/server_api,
2524
./nimbus_desc,
@@ -33,7 +32,6 @@ export
3332
jwt_auth,
3433
cors,
3534
rpc_server,
36-
experimental,
3735
oracle,
3836
server_api
3937

@@ -49,7 +47,7 @@ func combinedServer(conf: NimbusConf): bool =
4947
conf.httpServerEnabled and
5048
conf.shareServerWithEngineApi
5149

52-
proc installRPC(server: RpcServer,
50+
func installRPC(server: RpcServer,
5351
nimbus: NimbusNode,
5452
conf: NimbusConf,
5553
com: CommonRef,
@@ -65,9 +63,6 @@ proc installRPC(server: RpcServer,
6563
# if RpcFlag.Debug in flags:
6664
# setupDebugRpc(com, nimbus.txPool, server)
6765

68-
if RpcFlag.Exp in flags:
69-
setupExpRpc(com, server)
70-
7166
server.rpc("admin_quit") do() -> string:
7267
{.gcsafe.}:
7368
nimbus.state = NimbusState.Stopping
@@ -79,12 +74,12 @@ proc newRpcWebsocketHandler(): RpcWebSocketHandler =
7974
wsserver: WSServer.new(rng = rng),
8075
)
8176

82-
proc newRpcHttpHandler(): RpcHttpHandler =
77+
func newRpcHttpHandler(): RpcHttpHandler =
8378
RpcHttpHandler(
8479
maxChunkSize: DefaultChunkSize,
8580
)
8681

87-
proc addHandler(handlers: var seq[RpcHandlerProc],
82+
func addHandler(handlers: var seq[RpcHandlerProc],
8883
server: RpcHttpHandler) =
8984

9085
proc handlerProc(request: HttpRequestRef):
@@ -100,7 +95,7 @@ proc addHandler(handlers: var seq[RpcHandlerProc],
10095

10196
handlers.add handlerProc
10297

103-
proc addHandler(handlers: var seq[RpcHandlerProc],
98+
func addHandler(handlers: var seq[RpcHandlerProc],
10499
server: RpcWebSocketHandler) =
105100

106101
proc handlerProc(request: HttpRequestRef):
@@ -130,7 +125,7 @@ proc addHandler(handlers: var seq[RpcHandlerProc],
130125

131126
handlers.add handlerProc
132127

133-
proc addHandler(handlers: var seq[RpcHandlerProc],
128+
func addHandler(handlers: var seq[RpcHandlerProc],
134129
server: GraphqlHttpHandlerRef) =
135130

136131
proc handlerProc(request: HttpRequestRef):

nimbus/rpc/experimental.nim

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/test_configuration.nim

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -111,18 +111,6 @@ proc configurationMain*() =
111111
let cx = cc.getRpcFlags()
112112
check { RpcFlag.Eth, RpcFlag.Debug } == cx
113113

114-
let dd = makeConfig(@["--rpc-api:eth", "--rpc-api:exp"])
115-
let dx = dd.getRpcFlags()
116-
check { RpcFlag.Eth, RpcFlag.Exp } == dx
117-
118-
let ee = makeConfig(@["--rpc-api:eth,exp"])
119-
let ex = ee.getRpcFlags()
120-
check { RpcFlag.Eth, RpcFlag.Exp } == ex
121-
122-
let ff = makeConfig(@["--rpc-api:eth,debug,exp"])
123-
let fx = ff.getRpcFlags()
124-
check { RpcFlag.Eth, RpcFlag.Debug, RpcFlag.Exp } == fx
125-
126114
test "ws-api":
127115
let conf = makeTestConfig()
128116
let flags = conf.getWsFlags()
@@ -140,18 +128,6 @@ proc configurationMain*() =
140128
let cx = cc.getWsFlags()
141129
check { RpcFlag.Eth, RpcFlag.Debug } == cx
142130

143-
let dd = makeConfig(@["--ws-api:eth", "--ws-api:exp"])
144-
let dx = dd.getWsFlags()
145-
check { RpcFlag.Eth, RpcFlag.Exp } == dx
146-
147-
let ee = makeConfig(@["--ws-api:eth,exp"])
148-
let ex = ee.getWsFlags()
149-
check { RpcFlag.Eth, RpcFlag.Exp } == ex
150-
151-
let ff = makeConfig(@["--ws-api:eth,exp,debug"])
152-
let fx = ff.getWsFlags()
153-
check { RpcFlag.Eth, RpcFlag.Debug, RpcFlag.Exp } == fx
154-
155131
test "protocols":
156132
let conf = makeTestConfig()
157133
let flags = conf.getProtocolFlags()

0 commit comments

Comments
 (0)