Skip to content

Commit

Permalink
Renamed to LeaderRotationV2Epoch.
Browse files Browse the repository at this point in the history
  • Loading branch information
Frozen committed Nov 22, 2024
1 parent b7f8a1f commit 68b404b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion consensus/view_change.go
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ func (consensus *Consensus) startViewChange() {
// Ideally, we shall use another variable to keep track of the
// leader pubkey in viewchange mode
c := consensus.Blockchain().Config()
if c.IsViewChangeSkipValidatorsSameAddressEpoch(currentHeader.Epoch()) {
if c.IsLeaderRotationV2Epoch(currentHeader.Epoch()) {
consensus.setLeaderPubKey(consensus.getNextLeaderKeySkipSameAddress(nextViewID, committee))
} else {
consensus.setLeaderPubKey(consensus.getNextLeaderKey(nextViewID, committee))
Expand Down
6 changes: 3 additions & 3 deletions internal/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ type ChainConfig struct {
// if crosslink are not sent for an entire epoch signed and toSign will be 0 and 0. when that happen, next epoch there will no shard 1 validator elected in the committee.
HIP32Epoch *big.Int `json:"hip32-epoch,omitempty"`

ViewChangeSkipValidatorsSameAddressEpoch *big.Int `json:"view-change-skip-validators-same-address-epoch,omitempty"`
LeaderRotationV2Epoch *big.Int `json:"leader-rotation-v2-epoch,omitempty"`
}

// String implements the fmt.Stringer interface.
Expand Down Expand Up @@ -879,8 +879,8 @@ func (c *ChainConfig) IsTopMaxRate(epoch *big.Int) bool {
return isForked(c.TopMaxRateEpoch, epoch)
}

func (c *ChainConfig) IsViewChangeSkipValidatorsSameAddressEpoch(epoch *big.Int) bool {
return isForked(c.ViewChangeSkipValidatorsSameAddressEpoch, epoch)
func (c *ChainConfig) IsLeaderRotationV2Epoch(epoch *big.Int) bool {
return isForked(c.LeaderRotationV2Epoch, epoch)
}

// During this epoch, shards 2 and 3 will start sending
Expand Down

0 comments on commit 68b404b

Please sign in to comment.