Ensure that clique still works in Geth

This is going to be opened as an issue as I think it should still work.
This commit is contained in:
Matthieu Vachon 2024-03-13 16:25:03 -04:00
parent 665329d32b
commit 2cc4ef938a

View file

@ -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
}