mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-03 09:37:38 +00:00
erigon22: bsc fixes
This commit is contained in:
parent
4f007ae43e
commit
de3a602a24
@ -1251,6 +1251,8 @@ func initConsensusEngine(chainConfig *params.ChainConfig, logger log.Logger, sna
|
||||
consensusConfig := ¶ms.AuRaConfig{DBPath: filepath.Join(datadir, "aura")}
|
||||
engine = ethconsensusconfig.CreateConsensusEngine(chainConfig, logger, consensusConfig, config.Miner.Notify, config.Miner.Noverify, "", true, datadir, snapshots, true /* readonly */)
|
||||
case chainConfig.Parlia != nil:
|
||||
// Apply special hacks for BSC params
|
||||
params.ApplyBinanceSmartChainParams()
|
||||
consensusConfig := ¶ms.ParliaConfig{DBPath: filepath.Join(datadir, "parlia")}
|
||||
engine = ethconsensusconfig.CreateConsensusEngine(chainConfig, logger, consensusConfig, config.Miner.Notify, config.Miner.Noverify, "", true, datadir, snapshots, true /* readonly */)
|
||||
case chainConfig.Bor != nil:
|
||||
|
@ -634,6 +634,8 @@ func initConsensusEngine(chainConfig *params.ChainConfig, logger log.Logger, sna
|
||||
consensusConfig := ¶ms.AuRaConfig{DBPath: filepath.Join(datadir, "aura")}
|
||||
engine = ethconsensusconfig.CreateConsensusEngine(chainConfig, logger, consensusConfig, config.Miner.Notify, config.Miner.Noverify, "", true, datadir, snapshots, true /* readonly */)
|
||||
case chainConfig.Parlia != nil:
|
||||
// Apply special hacks for BSC params
|
||||
params.ApplyBinanceSmartChainParams()
|
||||
consensusConfig := ¶ms.ParliaConfig{DBPath: filepath.Join(datadir, "parlia")}
|
||||
engine = ethconsensusconfig.CreateConsensusEngine(chainConfig, logger, consensusConfig, config.Miner.Notify, config.Miner.Noverify, "", true, datadir, snapshots, true /* readonly */)
|
||||
case chainConfig.Bor != nil:
|
||||
@ -642,5 +644,6 @@ func initConsensusEngine(chainConfig *params.ChainConfig, logger log.Logger, sna
|
||||
default: //ethash
|
||||
engine = ethash.NewFaker()
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
@ -126,8 +126,6 @@ func Erigon22(execCtx context.Context, genesis *core.Genesis, logger log.Logger)
|
||||
defer agg.Close()
|
||||
|
||||
workerCount := workers
|
||||
_ = workerCount
|
||||
|
||||
execCfg := stagedsync.StageExecuteBlocksCfg(db, cfg.Prune, cfg.BatchSize, nil, chainConfig, engine, &vm.Config{}, nil,
|
||||
/*stateStream=*/ false,
|
||||
/*badBlockHalt=*/ false, dirs, blockReader, nil, genesis, workerCount)
|
||||
|
@ -307,21 +307,6 @@ func New(stack *node.Node, config *ethconfig.Config, logger log.Logger) (*Ethere
|
||||
}()
|
||||
}
|
||||
|
||||
var consensusConfig interface{}
|
||||
|
||||
if chainConfig.Clique != nil {
|
||||
consensusConfig = &config.Clique
|
||||
} else if chainConfig.Aura != nil {
|
||||
config.Aura.Etherbase = config.Miner.Etherbase
|
||||
consensusConfig = &config.Aura
|
||||
} else if chainConfig.Parlia != nil {
|
||||
consensusConfig = &config.Parlia
|
||||
} else if chainConfig.Bor != nil {
|
||||
consensusConfig = &config.Bor
|
||||
} else {
|
||||
consensusConfig = &config.Ethash
|
||||
}
|
||||
|
||||
inMemoryExecution := func(batch kv.RwTx, header *types.Header, body *types.RawBody, unwindPoint uint64, headersChain []*types.Header, bodiesChain []*types.RawBody) error {
|
||||
stateSync, err := stages2.NewInMemoryExecution(backend.sentryCtx, backend.log, backend.chainDB, config, backend.sentriesClient, tmpdir, backend.notifications, allSnapshots)
|
||||
if err != nil {
|
||||
@ -338,7 +323,22 @@ func New(stack *node.Node, config *ethconfig.Config, logger log.Logger) (*Ethere
|
||||
if currentBlock != nil {
|
||||
currentBlockNumber = currentBlock.NumberU64()
|
||||
}
|
||||
|
||||
log.Info("Initialising Ethereum protocol", "network", config.NetworkID)
|
||||
var consensusConfig interface{}
|
||||
|
||||
if chainConfig.Clique != nil {
|
||||
consensusConfig = &config.Clique
|
||||
} else if chainConfig.Aura != nil {
|
||||
config.Aura.Etherbase = config.Miner.Etherbase
|
||||
consensusConfig = &config.Aura
|
||||
} else if chainConfig.Parlia != nil {
|
||||
consensusConfig = &config.Parlia
|
||||
} else if chainConfig.Bor != nil {
|
||||
consensusConfig = &config.Bor
|
||||
} else {
|
||||
consensusConfig = &config.Ethash
|
||||
}
|
||||
backend.engine = ethconsensusconfig.CreateConsensusEngine(chainConfig, logger, consensusConfig, config.Miner.Notify, config.Miner.Noverify, config.HeimdallURL, config.WithoutHeimdall, stack.DataDir(), allSnapshots, false /* readonly */)
|
||||
backend.forkValidator = engineapi.NewForkValidator(currentBlockNumber, inMemoryExecution)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user