Skip to content

Commit 0f30e74

Browse files
committed
consensus: fail if running shanghai on clique or ethash
1 parent 798a3e4 commit 0f30e74

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

consensus/clique/clique.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ func (c *Clique) verifyHeader(chain consensus.ChainHeaderReader, header *types.H
298298
if header.GasLimit > params.MaxGasLimit {
299299
return fmt.Errorf("invalid gasLimit: have %v, max %v", header.GasLimit, params.MaxGasLimit)
300300
}
301+
if chain.Config().IsShanghai(new(big.Int).SetUint64(header.Time)) {
302+
return fmt.Errorf("clique does not support shanghai fork")
303+
}
301304
// If all checks passed, validate any special fields for hard forks
302305
if err := misc.VerifyForkHashes(chain.Config(), header, false); err != nil {
303306
return err

consensus/ethash/consensus.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,9 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, pa
310310
if diff := new(big.Int).Sub(header.Number, parent.Number); diff.Cmp(big.NewInt(1)) != 0 {
311311
return consensus.ErrInvalidNumber
312312
}
313+
if chain.Config().IsShanghai(new(big.Int).SetUint64(header.Time)) {
314+
return fmt.Errorf("ethash does not support shanghai fork")
315+
}
313316
// Verify the engine specific seal securing the block
314317
if seal {
315318
if err := ethash.verifySeal(chain, header, false); err != nil {

0 commit comments

Comments
 (0)