Skip to content

Commit

Permalink
types.ZeroNonce
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemanja0x committed May 15, 2023
1 parent b91dedc commit 2dbdab2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions consensus/polybft/fsm.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ var (
"is either nil or it does not match the received one")
errValidatorSetDeltaMismatch = errors.New("validator set delta mismatch")
errValidatorsUpdateInNonEpochEnding = errors.New("trying to update validator set in a non epoch ending block")
zeroNonce = types.Nonce{}
)

type fsm struct {
Expand Down Expand Up @@ -646,7 +645,7 @@ func validateHeaderFields(parent *types.Header, header *types.Header) error {
return fmt.Errorf("invalid number")
}
// verify header nonce is zero
if header.Nonce != zeroNonce {
if header.Nonce != types.ZeroNonce {
return fmt.Errorf("invalid nonce")
}
// verify that the gasUsed is <= gasLimit
Expand Down
3 changes: 3 additions & 0 deletions types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ var (
// ZeroHash is the default zero hash
ZeroHash = Hash{}

// ZeroNonce is the default empty nonce
ZeroNonce = Nonce{}

// EmptyRootHash is the root when there are no transactions
EmptyRootHash = StringToHash("0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421")

Expand Down

0 comments on commit 2dbdab2

Please sign in to comment.