Skip to content

Commit

Permalink
make state epoch uint16
Browse files Browse the repository at this point in the history
  • Loading branch information
weiihann committed Oct 30, 2024
1 parent cc43672 commit 861826a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions epoch.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/binary"
)

type StateEpoch uint64
type StateEpoch uint16

const (
NumActiveEpochs = 2
Expand All @@ -15,5 +15,5 @@ func IsExpired(prev StateEpoch, cur StateEpoch) bool {
}

func StateEpochFromBytes(b []byte) StateEpoch {
return StateEpoch(binary.BigEndian.Uint64(b))
return StateEpoch(binary.BigEndian.Uint16(b))
}

0 comments on commit 861826a

Please sign in to comment.