Set default for externalcl based on whether embedded CL is supported (#6294)

Embedded CL is not supported for Gnosis Chain, so it makes sense to set
`externalcl` to true by default for it.

Also, this PR sets `terminalTotalDifficultyPassed` for Gnosis Chain &
Chiado (see https://docs.gnosischain.com/updates/20221210-merge).
This commit is contained in:
Andrew Ashikhmin 2022-12-13 14:51:13 +01:00 committed by GitHub
parent 5616ec2529
commit 1e206e375b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 19 additions and 7 deletions

View File

@ -142,7 +142,9 @@ How to start Erigon's services as separated processes, see in [docker-compose.ym
### Embedded Consensus Layer
By default the Engine API is disabled in favour of Erigon native Embedded Consensus Layer, if you want to either stake or sync an external Consensus Layer, run Erigon with flag `--externalcl`.
By default, on Ethereum Mainnet, Görli, and Sepolia, the Engine API is disabled in favour of the Erigon native Embedded Consensus Layer.
If you want to use an external Consensus Layer, run Erigon with flag `--externalcl`.
_Warning:_ Staking (block production) is not possible with the embedded CL use `--externalcl` instead.
### Optional stages

View File

@ -713,6 +713,6 @@ func GetCheckpointSyncEndpoint(net NetworkType) string {
// 1 is Ethereum Mainnet
// 5 is Goerli Testnet
// 11155111 is Sepolia Testnet
func Supported(id uint64) bool {
func EmbeddedSupported(id uint64) bool {
return id == 1 || id == 5 || id == 11155111
}

View File

@ -34,6 +34,7 @@ import (
downloadercfg2 "github.com/ledgerwatch/erigon-lib/downloader/downloadercfg"
"github.com/ledgerwatch/erigon-lib/kv"
"github.com/ledgerwatch/erigon-lib/txpool"
"github.com/ledgerwatch/erigon/cl/clparams"
"github.com/ledgerwatch/erigon/cmd/downloader/downloadernat"
"github.com/ledgerwatch/erigon/common"
"github.com/ledgerwatch/erigon/common/paths"
@ -1445,7 +1446,6 @@ func CheckExclusive(ctx *cli.Context, args ...interface{}) {
// SetEthConfig applies eth-related command line flags to the config.
func SetEthConfig(ctx *cli.Context, nodeConfig *nodecfg.Config, cfg *ethconfig.Config) {
cfg.CL = ctx.Bool(ExternalConsensusFlag.Name)
cfg.LightClientDiscoveryAddr = ctx.String(LightClientDiscoveryAddrFlag.Name)
cfg.LightClientDiscoveryPort = ctx.Uint64(LightClientDiscoveryPortFlag.Name)
cfg.LightClientDiscoveryTCPPort = ctx.Uint64(LightClientDiscoveryTCPPortFlag.Name)
@ -1578,6 +1578,13 @@ func SetEthConfig(ctx *cli.Context, nodeConfig *nodecfg.Config, cfg *ethconfig.C
if ctx.IsSet(OverrideMergeNetsplitBlock.Name) {
cfg.OverrideMergeNetsplitBlock = BigFlagValue(ctx, OverrideMergeNetsplitBlock.Name)
}
if ctx.IsSet(ExternalConsensusFlag.Name) {
cfg.ExternalCL = ctx.Bool(ExternalConsensusFlag.Name)
} else {
cfg.ExternalCL = !clparams.EmbeddedSupported(cfg.NetworkID)
}
nodeConfig.Http.InternalCL = !cfg.ExternalCL
}
// SetDNSDiscoveryDefaults configures DNS discovery with the given URL if

View File

@ -205,6 +205,8 @@ func TestEmptyBlock(t *testing.T) {
genesisBlock, _, err := genesis.ToBlock()
require.NoError(err)
genesis.Config.TerminalTotalDifficultyPassed = false
chainConfig := genesis.Config
auraDB := memdb.NewTestDB(t)
engine, err := aura.NewAuRa(chainConfig.Aura, auraDB, chainConfig.Aura.Etherbase, consensusconfig.GetConfigByChain(chainConfig.ChainName))

View File

@ -520,7 +520,7 @@ func New(stack *node.Node, config *ethconfig.Config, logger log.Logger) (*Ethere
}
// If we choose not to run a consensus layer, run our embedded.
if !config.CL && clparams.Supported(config.NetworkID) {
if !config.ExternalCL && clparams.EmbeddedSupported(config.NetworkID) {
genesisCfg, networkCfg, beaconCfg := clparams.GetConfigsByNetwork(clparams.NetworkType(config.NetworkID))
if err != nil {
return nil, err

View File

@ -235,8 +235,8 @@ type Config struct {
WithoutHeimdall bool
// Ethstats service
Ethstats string
// ConsenSUS layer
CL bool
// Consensus layer
ExternalCL bool
LightClientDiscoveryAddr string
LightClientDiscoveryPort uint64
LightClientDiscoveryTCPPort uint64

View File

@ -16,6 +16,7 @@
"eip1559FeeCollectorTransition": 0,
"eip1559FeeCollector": "0x1559000000000000000000000000000000000000",
"terminalTotalDifficulty": 231707791542740786049188744689299064356246512,
"terminalTotalDifficultyPassed": true,
"aura": {
"DBPath": "",
"InMemory": false,

View File

@ -16,6 +16,7 @@
"eip1559FeeCollectorTransition": 19040000,
"eip1559FeeCollector": "0x6BBe78ee9e474842Dbd4AB4987b3CeFE88426A92",
"terminalTotalDifficulty": 8626000000000000000000058750000000000000000000,
"terminalTotalDifficultyPassed": true,
"aura": {
"DBPath": "",
"InMemory": false,

View File

@ -371,7 +371,6 @@ func setEmbeddedRpcDaemon(ctx *cli.Context, cfg *nodecfg.Config) {
TxPoolApiAddr: ctx.String(utils.TxpoolApiAddrFlag.Name),
StateCache: kvcache.DefaultCoherentConfig,
InternalCL: !ctx.Bool(utils.ExternalConsensusFlag.Name),
}
if ctx.IsSet(utils.HttpCompressionFlag.Name) {
c.HttpCompression = ctx.Bool(utils.HttpCompressionFlag.Name)