Don't run pos downloader or engine api for bor (#9220)

Pos downloader and the engine api code are not necessary for Bor. This
adds code to suppress their start up.
This commit is contained in:
Mark Holt 2024-01-12 16:07:59 +00:00 committed by GitHub
parent a592cbf163
commit 320fe0ab8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -895,7 +895,9 @@ func (s *Ethereum) Init(stack *node.Node, config *ethconfig.Config) error {
chainKv := s.chainDB
var err error
s.sentriesClient.Hd.StartPoSDownloader(s.sentryCtx, s.sentriesClient.SendHeaderRequest, s.sentriesClient.Penalize)
if config.Genesis.Config.Bor == nil {
s.sentriesClient.Hd.StartPoSDownloader(s.sentryCtx, s.sentriesClient.SendHeaderRequest, s.sentriesClient.Penalize)
}
emptyBadHash := config.BadBlockHash == libcommon.Hash{}
if !emptyBadHash {
@ -948,7 +950,9 @@ func (s *Ethereum) Init(stack *node.Node, config *ethconfig.Config) error {
}()
}
go s.engineBackendRPC.Start(&httpRpcCfg, s.chainDB, s.blockReader, ff, stateCache, s.agg, s.engine, ethRpcClient, txPoolRpcClient, miningRpcClient)
if config.Genesis.Config.Bor == nil {
go s.engineBackendRPC.Start(&httpRpcCfg, s.chainDB, s.blockReader, ff, stateCache, s.agg, s.engine, ethRpcClient, txPoolRpcClient, miningRpcClient)
}
// Register the backend on the node
stack.RegisterLifecycle(s)