mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 01:27:38 +00:00
bor: fix for TestMiningBenchmark (#9182)
integration test TestMiningBenchmark is failing the CI on devel - this PR aims to fix it
This commit is contained in:
parent
fec0c9eef5
commit
af913fdeeb
@ -780,7 +780,7 @@ func New(ctx context.Context, stack *node.Node, config *ethconfig.Config, logger
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
if err := backend.StartMining(context.Background(), backend.chainDB, mining, backend.config.Miner, backend.gasPrice, backend.sentriesClient.Hd.QuitPoWMining, tmpdir, logger); err != nil {
|
if err := backend.StartMining(context.Background(), backend.chainDB, mining, backend.config.Miner, backend.sentriesClient.Hd.QuitPoWMining, tmpdir, logger); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1010,8 +1010,7 @@ func (s *Ethereum) shouldPreserve(block *types.Block) bool { //nolint
|
|||||||
// StartMining starts the miner with the given number of CPU threads. If mining
|
// StartMining starts the miner with the given number of CPU threads. If mining
|
||||||
// is already running, this method adjust the number of threads allowed to use
|
// is already running, this method adjust the number of threads allowed to use
|
||||||
// and updates the minimum price required by the transaction pool.
|
// and updates the minimum price required by the transaction pool.
|
||||||
func (s *Ethereum) StartMining(ctx context.Context, db kv.RwDB, mining *stagedsync.Sync, cfg params.MiningConfig, gasPrice *uint256.Int, quitCh chan struct{}, tmpDir string, logger log.Logger) error {
|
func (s *Ethereum) StartMining(ctx context.Context, db kv.RwDB, mining *stagedsync.Sync, cfg params.MiningConfig, quitCh chan struct{}, tmpDir string, logger log.Logger) error {
|
||||||
|
|
||||||
var borcfg *bor.Bor
|
var borcfg *bor.Bor
|
||||||
if b, ok := s.engine.(*bor.Bor); ok {
|
if b, ok := s.engine.(*bor.Bor); ok {
|
||||||
borcfg = b
|
borcfg = b
|
||||||
@ -1047,9 +1046,17 @@ func (s *Ethereum) StartMining(ctx context.Context, db kv.RwDB, mining *stagedsy
|
|||||||
return crypto.Sign(crypto.Keccak256(message), cfg.SigKey)
|
return crypto.Sign(crypto.Keccak256(message), cfg.SigKey)
|
||||||
})
|
})
|
||||||
|
|
||||||
err := stagedsync.FetchSpanZeroForMiningIfNeeded(ctx, s.chainDB, s.blockReader, borcfg.HeimdallClient, logger)
|
if !s.config.WithoutHeimdall {
|
||||||
if err != nil {
|
err := stagedsync.FetchSpanZeroForMiningIfNeeded(
|
||||||
return err
|
ctx,
|
||||||
|
s.chainDB,
|
||||||
|
s.blockReader,
|
||||||
|
borcfg.HeimdallClient,
|
||||||
|
logger,
|
||||||
|
)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// for the bor dev network without heimdall we need the authorizer to be set otherwise there is no
|
// for the bor dev network without heimdall we need the authorizer to be set otherwise there is no
|
||||||
|
Loading…
Reference in New Issue
Block a user