mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-26 14:46:42 +00:00
fix: system config consensus (#1180)
* fix: system config to check sign in any case * chore: auto version bump [bot]
This commit is contained in:
parent
a4109fd8a9
commit
7b56ff1d66
2 changed files with 11 additions and 14 deletions
|
|
@ -130,7 +130,7 @@ func (s *SystemContract) verifyHeader(chain consensus.ChainHeaderReader, header
|
|||
return errInvalidNonce
|
||||
}
|
||||
// Check that the BlockSignature contains signature if block is not requested
|
||||
if !header.Requested && header.Number.Cmp(big.NewInt(0)) != 0 && len(header.BlockSignature) != extraSeal {
|
||||
if header.Number.Cmp(big.NewInt(0)) != 0 && len(header.BlockSignature) != extraSeal {
|
||||
return errMissingSignature
|
||||
}
|
||||
// Ensure that the mix digest is zero
|
||||
|
|
@ -197,20 +197,17 @@ func (s *SystemContract) verifyCascadingFields(chain consensus.ChainHeaderReader
|
|||
return err
|
||||
}
|
||||
|
||||
// only if block header has NOT been requested, then verify the signature against the current signer
|
||||
if !header.Requested {
|
||||
signer, err := ecrecover(header)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
signer, err := ecrecover(header)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
s.lock.RLock()
|
||||
defer s.lock.RUnlock()
|
||||
s.lock.RLock()
|
||||
defer s.lock.RUnlock()
|
||||
|
||||
if signer != s.signerAddressL1 {
|
||||
log.Error("Unauthorized signer", "Got", signer, "Expected:", s.signerAddressL1)
|
||||
return ErrUnauthorizedSigner
|
||||
}
|
||||
if signer != s.signerAddressL1 {
|
||||
log.Error("Unauthorized signer", "Got", signer, "Expected:", s.signerAddressL1)
|
||||
return ErrUnauthorizedSigner
|
||||
}
|
||||
|
||||
return nil
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import (
|
|||
const (
|
||||
VersionMajor = 5 // Major version component of the current release
|
||||
VersionMinor = 8 // Minor version component of the current release
|
||||
VersionPatch = 41 // Patch version component of the current release
|
||||
VersionPatch = 42 // Patch version component of the current release
|
||||
VersionMeta = "mainnet" // Version metadata to append to the version string
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue