mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-10 05:53:46 +00:00
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:
parent
665329d32b
commit
2cc4ef938a
1 changed files with 8 additions and 4 deletions
|
|
@ -169,14 +169,18 @@ type Config struct {
|
||||||
// Clique is allowed for now to live standalone, but ethash is forbidden and can
|
// Clique is allowed for now to live standalone, but ethash is forbidden and can
|
||||||
// only exist on already merged networks.
|
// only exist on already merged networks.
|
||||||
func CreateConsensusEngine(config *params.ChainConfig, db ethdb.Database) (consensus.Engine, error) {
|
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
|
// Geth v1.14.0 dropped support for non-merged networks in any consensus
|
||||||
// mode. If such a network is requested, reject startup.
|
// mode. If such a network is requested, reject startup.
|
||||||
if !config.TerminalTotalDifficultyPassed {
|
if !config.TerminalTotalDifficultyPassed {
|
||||||
return nil, errors.New("only PoS networks are supported, please transition old ones with Geth v1.13.x")
|
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
|
return beacon.New(ethash.NewFaker()), nil
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue