From 2cc4ef938a71ae78e4fa809fc0afa9ca0fe4a76a Mon Sep 17 00:00:00 2001 From: Matthieu Vachon Date: Wed, 13 Mar 2024 16:25:03 -0400 Subject: [PATCH] Ensure that clique still works in Geth This is going to be opened as an issue as I think it should still work. --- eth/ethconfig/config.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/eth/ethconfig/config.go b/eth/ethconfig/config.go index fef7f29f4e..c9179e9462 100644 --- a/eth/ethconfig/config.go +++ b/eth/ethconfig/config.go @@ -169,14 +169,18 @@ type Config struct { // Clique is allowed for now to live standalone, but ethash is forbidden and can // only exist on already merged networks. func CreateConsensusEngine(config *params.ChainConfig, db ethdb.Database) (consensus.Engine, error) { + // Wrap previously supported consensus engines into their post-merge counterpart + if config.Clique != nil { + // Enforce? + config.TerminalTotalDifficultyPassed = true + return beacon.New(clique.New(config.Clique, db)), nil + } + // Geth v1.14.0 dropped support for non-merged networks in any consensus // mode. If such a network is requested, reject startup. if !config.TerminalTotalDifficultyPassed { return nil, errors.New("only PoS networks are supported, please transition old ones with Geth v1.13.x") } - // Wrap previously supported consensus engines into their post-merge counterpart - if config.Clique != nil { - return beacon.New(clique.New(config.Clique, db)), nil - } + return beacon.New(ethash.NewFaker()), nil }