This commit is contained in:
alex.sharov 2023-09-06 10:33:18 +07:00
commit e33561e960

View File

@ -835,6 +835,7 @@ func (s *Ethereum) Init(stack *node.Node, config *ethconfig.Config) error {
return
}
}()
go s.engineBackendRPC.Start(httpRpcCfg, s.chainDB, s.blockReader, ff, stateCache, s.agg, s.engine, ethRpcClient, txPoolRpcClient, miningRpcClient)
// Register the backend on the node
@ -1182,8 +1183,8 @@ func (s *Ethereum) Start() error {
}
return currentTD
}
if params.IsChainPoS(s.chainConfig, currentTDProvider) {
s.waitForStageLoopStop = nil // TODO: Ethereum.Stop should wait for execution_server shutdown
go s.eth1ExecutionServer.Start(s.sentryCtx)
} else {
go stages2.StageLoop(s.sentryCtx, s.chainDB, s.stagedSync, s.sentriesClient.Hd, s.waitForStageLoopStop, s.config.Sync.LoopThrottle, s.logger, s.blockReader, hook, s.config.ForcePartialCommit)
@ -1216,9 +1217,10 @@ func (s *Ethereum) Stop() error {
}
}
libcommon.SafeClose(s.sentriesClient.Hd.QuitPoWMining)
_ = s.engine.Close()
<-s.waitForStageLoopStop
if s.waitForStageLoopStop != nil {
<-s.waitForStageLoopStop
}
if s.config.Miner.Enabled {
<-s.waitForMiningStop
}