Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add system config consensus to deprecate clique #1102

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from
Prev Previous commit
Next Next commit
fix: check extra field lens
yiweichi authored and ranchalp committed Jan 15, 2025
commit 8e4deb156ae2c87d62463c717f651c4abb329fbb
4 changes: 2 additions & 2 deletions consensus/system_contract/consensus.go
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ func (s *SystemContract) verifyHeader(chain consensus.ChainHeaderReader, header
return errInvalidNonce
}
// Check that the extra-data contains signature
if len(header.Extra) != extraSeal {
if header.Number != big.NewInt(0) && len(header.Extra) != extraSeal {
return errMissingSignature
}
// Ensure that the mix digest is zero
@@ -121,7 +121,7 @@ func (s *SystemContract) verifyHeader(chain consensus.ChainHeaderReader, header
if header.UncleHash != uncleHash {
return errInvalidUncleHash
}
// Ensure that the difficulty is zero
// Ensure that the difficulty is one
if header.Difficulty.Cmp(common.Big0) != 1 {
return errInvalidDifficulty
}
1 change: 0 additions & 1 deletion consensus/system_contract/system_contract.go
Original file line number Diff line number Diff line change
@@ -78,7 +78,6 @@ func (s *SystemContract) Start() {
return
case <-syncTicker.C:
blockNumber := big.NewInt(-1) // todo: get block number from L1BlocksContract (l1 block hash relay) or other source (depending on exact design)

address, err := s.client.StorageAt(s.ctx, s.config.SystemContractAddress, s.config.SystemContractSlot, blockNumber)
if err != nil {
log.Error("failed to get signer address from L1 System Contract", "err", err)