mirror of
https://github.com/status-im/op-geth.git
synced 2025-02-12 14:56:23 +00:00
optimism: minor goerli fixes - banner, clique config, networkid (#36)
This commit is contained in:
parent
e2e6188144
commit
8ba567f82b
@ -64,6 +64,9 @@ func ReadChainConfig(db ethdb.KeyValueReader, hash common.Hash) *params.ChainCon
|
||||
log.Error("Invalid chain config JSON", "hash", hash, "err", err)
|
||||
return nil
|
||||
}
|
||||
if config.Optimism != nil {
|
||||
config.Clique = nil // get rid of legacy clique data in chain config (optimism goerli issue)
|
||||
}
|
||||
return &config
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,6 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
||||
if bcVersion != nil {
|
||||
dbVer = fmt.Sprintf("%d", *bcVersion)
|
||||
}
|
||||
log.Info("Initialising Ethereum protocol", "network", config.NetworkId, "dbversion", dbVer)
|
||||
|
||||
if !config.SkipBcVersionCheck {
|
||||
if bcVersion != nil && *bcVersion > core.BlockChainVersion {
|
||||
@ -213,6 +212,12 @@ func New(stack *node.Node, config *ethconfig.Config) (*Ethereum, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if chainConfig := eth.blockchain.Config(); chainConfig.Optimism != nil { // config.Genesis.Config.ChainID cannot be used because it's based on CLI flags only, thus default to mainnet L1
|
||||
config.NetworkId = chainConfig.ChainID.Uint64() // optimism defaults eth network ID to chain ID
|
||||
eth.networkID = config.NetworkId
|
||||
}
|
||||
log.Info("Initialising Ethereum protocol", "network", config.NetworkId, "dbversion", dbVer)
|
||||
|
||||
eth.bloomIndexer.Start(eth.blockchain)
|
||||
|
||||
if config.TxPool.Journal != "" {
|
||||
|
@ -506,6 +506,8 @@ func (c *ChainConfig) Description() string {
|
||||
}
|
||||
banner += fmt.Sprintf("Chain ID: %v (%s)\n", c.ChainID, network)
|
||||
switch {
|
||||
case c.Optimism != nil:
|
||||
banner += "Consensus: Optimism\n"
|
||||
case c.Ethash != nil:
|
||||
if c.TerminalTotalDifficulty == nil {
|
||||
banner += "Consensus: Ethash (proof-of-work)\n"
|
||||
@ -522,8 +524,6 @@ func (c *ChainConfig) Description() string {
|
||||
} else {
|
||||
banner += "Consensus: Beacon (proof-of-stake), merged from Clique (proof-of-authority)\n"
|
||||
}
|
||||
case c.Optimism != nil:
|
||||
banner += "Consensus: Optimism\n"
|
||||
default:
|
||||
banner += "Consensus: unknown\n"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user