Skip to content

Commit 8e4deb1

Browse files
yiweichiranchalp
authored andcommitted
fix: check extra field lens
1 parent b68dcb7 commit 8e4deb1

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

consensus/system_contract/consensus.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func (s *SystemContract) verifyHeader(chain consensus.ChainHeaderReader, header
110110
return errInvalidNonce
111111
}
112112
// Check that the extra-data contains signature
113-
if len(header.Extra) != extraSeal {
113+
if header.Number != big.NewInt(0) && len(header.Extra) != extraSeal {
114114
return errMissingSignature
115115
}
116116
// Ensure that the mix digest is zero
@@ -121,7 +121,7 @@ func (s *SystemContract) verifyHeader(chain consensus.ChainHeaderReader, header
121121
if header.UncleHash != uncleHash {
122122
return errInvalidUncleHash
123123
}
124-
// Ensure that the difficulty is zero
124+
// Ensure that the difficulty is one
125125
if header.Difficulty.Cmp(common.Big0) != 1 {
126126
return errInvalidDifficulty
127127
}

consensus/system_contract/system_contract.go

-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ func (s *SystemContract) Start() {
7878
return
7979
case <-syncTicker.C:
8080
blockNumber := big.NewInt(-1) // todo: get block number from L1BlocksContract (l1 block hash relay) or other source (depending on exact design)
81-
8281
address, err := s.client.StorageAt(s.ctx, s.config.SystemContractAddress, s.config.SystemContractSlot, blockNumber)
8382
if err != nil {
8483
log.Error("failed to get signer address from L1 System Contract", "err", err)

0 commit comments

Comments
 (0)