|
|
@ -302,9 +302,22 @@ func (c *Clique) verifyHeader(chain consensus.ChainHeaderReader, header *types.H |
|
|
|
if chain.Config().IsShanghai(header.Number, header.Time) { |
|
|
|
if chain.Config().IsShanghai(header.Number, header.Time) { |
|
|
|
return errors.New("clique does not support shanghai fork") |
|
|
|
return errors.New("clique does not support shanghai fork") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Verify the non-existence of withdrawalsHash.
|
|
|
|
|
|
|
|
if header.WithdrawalsHash != nil { |
|
|
|
|
|
|
|
return fmt.Errorf("invalid withdrawalsHash: have %x, expected nil", header.WithdrawalsHash) |
|
|
|
|
|
|
|
} |
|
|
|
if chain.Config().IsCancun(header.Number, header.Time) { |
|
|
|
if chain.Config().IsCancun(header.Number, header.Time) { |
|
|
|
return errors.New("clique does not support cancun fork") |
|
|
|
return errors.New("clique does not support cancun fork") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// Verify the non-existence of cancun-specific header fields
|
|
|
|
|
|
|
|
switch { |
|
|
|
|
|
|
|
case header.ExcessBlobGas != nil: |
|
|
|
|
|
|
|
return fmt.Errorf("invalid excessBlobGas: have %d, expected nil", header.ExcessBlobGas) |
|
|
|
|
|
|
|
case header.BlobGasUsed != nil: |
|
|
|
|
|
|
|
return fmt.Errorf("invalid blobGasUsed: have %d, expected nil", header.BlobGasUsed) |
|
|
|
|
|
|
|
case header.ParentBeaconRoot != nil: |
|
|
|
|
|
|
|
return fmt.Errorf("invalid parentBeaconRoot, have %#x, expected nil", header.ParentBeaconRoot) |
|
|
|
|
|
|
|
} |
|
|
|
// All basic checks passed, verify cascading fields
|
|
|
|
// All basic checks passed, verify cascading fields
|
|
|
|
return c.verifyCascadingFields(chain, header, parents) |
|
|
|
return c.verifyCascadingFields(chain, header, parents) |
|
|
|
} |
|
|
|
} |
|
|
@ -753,6 +766,15 @@ func encodeSigHeader(w io.Writer, header *types.Header) { |
|
|
|
if header.WithdrawalsHash != nil { |
|
|
|
if header.WithdrawalsHash != nil { |
|
|
|
panic("unexpected withdrawal hash value in clique") |
|
|
|
panic("unexpected withdrawal hash value in clique") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if header.ExcessBlobGas != nil { |
|
|
|
|
|
|
|
panic("unexpected excess blob gas value in clique") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if header.BlobGasUsed != nil { |
|
|
|
|
|
|
|
panic("unexpected blob gas used value in clique") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if header.ParentBeaconRoot != nil { |
|
|
|
|
|
|
|
panic("unexpected parent beacon root value in clique") |
|
|
|
|
|
|
|
} |
|
|
|
if err := rlp.Encode(w, enc); err != nil { |
|
|
|
if err := rlp.Encode(w, enc); err != nil { |
|
|
|
panic("can't encode: " + err.Error()) |
|
|
|
panic("can't encode: " + err.Error()) |
|
|
|
} |
|
|
|
} |
|
|
|