From 948c94763cea784e5f809f87f410f05168e43a5a Mon Sep 17 00:00:00 2001 From: andri lim Date: Sat, 9 Sep 2023 13:54:58 +0700 Subject: [PATCH] Bump nim-eth: Add closeWait to EthereumNode (#1742) --- hive_integration/nodocker/engine/engine_env.nim | 8 ++------ nimbus/sync/handlers/setup.nim | 10 +++++----- vendor/nim-eth | 2 +- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/hive_integration/nodocker/engine/engine_env.nim b/hive_integration/nodocker/engine/engine_env.nim index 44e8b9bcb..89660bcfc 100644 --- a/hive_integration/nodocker/engine/engine_env.nim +++ b/hive_integration/nodocker/engine/engine_env.nim @@ -91,7 +91,7 @@ proc newEngineEnv*(conf: var NimbusConf, chainFile: string, enableAuth: bool): E echo error quit(QuitFailure) - var + let node = setupEthNode(conf, ctx) com = makeCom(conf) chain = newChain(com) @@ -152,13 +152,9 @@ proc newEngineEnv*(conf: var NimbusConf, chainFile: string, enableAuth: bool): E client : client, sync : sync ) - -proc close(node: EthereumNode) = - node.stopListening() - waitFor node.listeningServer.closeWait() proc close*(env: EngineEnv) = - env.node.close() + waitFor env.node.closeWait() env.sync.stop() waitFor env.client.close() waitFor env.sealer.stop() diff --git a/nimbus/sync/handlers/setup.nim b/nimbus/sync/handlers/setup.nim index ab6b05162..c2a2eef9b 100644 --- a/nimbus/sync/handlers/setup.nim +++ b/nimbus/sync/handlers/setup.nim @@ -22,7 +22,7 @@ import # ------------------------------------------------------------------------------ proc setEthHandlerNewBlocksAndHashes*( - node: var EthereumNode; + node: EthereumNode; blockHandler: NewBlockHandler; hashesHandler: NewBlockHashesHandler; arg: pointer; @@ -32,7 +32,7 @@ proc setEthHandlerNewBlocksAndHashes*( w.setNewBlockHashesHandler(hashesHandler, arg) proc addEthHandlerCapability*( - node: var EthereumNode; + node: EthereumNode; peerPool: PeerPool; chain: ChainRef; txPool = TxPoolRef(nil); @@ -48,11 +48,11 @@ proc addEthHandlerCapability*( # ------------------------------------------------------------------------------ when dbBackend != select_backend.none: - import + import ./snap as handlers_snap - + proc addSnapHandlerCapability*( - node: var EthereumNode; + node: EthereumNode; peerPool: PeerPool; chain = ChainRef(nil); ) = diff --git a/vendor/nim-eth b/vendor/nim-eth index 0d7e7448c..ac680ed79 160000 --- a/vendor/nim-eth +++ b/vendor/nim-eth @@ -1 +1 @@ -Subproject commit 0d7e7448c4a2a50136e726be7d4e4a38e094e8e3 +Subproject commit ac680ed79bf9e4e78ca14a001eb7f78acdf7b07d