mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-27 15:16:43 +00:00
dev: fix: CreateConsensusEngine for new ethereum objects
This commit is contained in:
parent
dda0d1163f
commit
df106e64df
2 changed files with 14 additions and 8 deletions
|
|
@ -78,7 +78,7 @@ type EVMInterpreter struct {
|
||||||
returnData []byte // Last CALL's return data for subsequent reuse
|
returnData []byte // Last CALL's return data for subsequent reuse
|
||||||
}
|
}
|
||||||
|
|
||||||
// TxCacher is an wrapper of lru.cache for caching transactions that get interrupted
|
// TxCache is a wrapper of lru.cache for caching transactions that get interrupted
|
||||||
type TxCache struct {
|
type TxCache struct {
|
||||||
Cache *lru.Cache
|
Cache *lru.Cache
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/ethereum/go-ethereum/trie"
|
||||||
"math/big"
|
"math/big"
|
||||||
"runtime"
|
"runtime"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
@ -181,9 +182,19 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
||||||
}
|
}
|
||||||
ethereum.APIBackend.gpo = gasprice.NewOracle(ethereum.APIBackend, gpoParams)
|
ethereum.APIBackend.gpo = gasprice.NewOracle(ethereum.APIBackend, gpoParams)
|
||||||
|
|
||||||
|
// Override the chain config with provided settings.
|
||||||
|
var overrides core.ChainOverrides
|
||||||
|
if config.OverrideShanghai != nil {
|
||||||
|
overrides.OverrideShanghai = config.OverrideShanghai
|
||||||
|
}
|
||||||
|
|
||||||
|
chainConfig, _, genesisErr := core.SetupGenesisBlockWithOverride(chainDb, trie.NewDatabase(chainDb), config.Genesis, &overrides)
|
||||||
|
if _, isCompat := genesisErr.(*params.ConfigCompatError); genesisErr != nil && !isCompat {
|
||||||
|
return nil, genesisErr
|
||||||
|
}
|
||||||
|
|
||||||
blockChainAPI := ethapi.NewBlockChainAPI(ethereum.APIBackend)
|
blockChainAPI := ethapi.NewBlockChainAPI(ethereum.APIBackend)
|
||||||
// TODO marcello fix configs (using nil atm)
|
engine := ethconfig.CreateConsensusEngine(stack, chainConfig, config, ðashConfig, cliqueConfig, config.Miner.Notify, config.Miner.Noverify, chainDb, blockChainAPI)
|
||||||
engine := ethconfig.CreateConsensusEngine(stack, nil, nil, ðashConfig, cliqueConfig, config.Miner.Notify, config.Miner.Noverify, chainDb, nil)
|
|
||||||
ethereum.engine = engine
|
ethereum.engine = engine
|
||||||
// END: Bor changes
|
// END: Bor changes
|
||||||
|
|
||||||
|
|
@ -223,11 +234,6 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
||||||
TriesInMemory: config.TriesInMemory,
|
TriesInMemory: config.TriesInMemory,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
// Override the chain config with provided settings.
|
|
||||||
var overrides core.ChainOverrides
|
|
||||||
if config.OverrideShanghai != nil {
|
|
||||||
overrides.OverrideShanghai = config.OverrideShanghai
|
|
||||||
}
|
|
||||||
|
|
||||||
checker := whitelist.NewService(10)
|
checker := whitelist.NewService(10)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue