Skip to content

Commit

Permalink
add NthNextValidatorV2 to decider, fix epoch number for leader rotati…
Browse files Browse the repository at this point in the history
…on version 2
  • Loading branch information
GheisMohammadi committed Nov 20, 2024
1 parent 5253e39 commit d5d8358
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions consensus/quorum/thread_safe_decider.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ func (a threadSafeDeciderImpl) NthNextValidator(slotList shard.SlotList, pubKey
return a.decider.NthNextValidator(slotList, pubKey, next)
}

func (a threadSafeDeciderImpl) NthNextValidatorV2(slotList shard.SlotList, pubKey *bls.PublicKeyWrapper, next int) (bool, *bls.PublicKeyWrapper) {
a.mu.Lock()
defer a.mu.Unlock()
return a.decider.NthNextValidator(slotList, pubKey, next)
}

func (a threadSafeDeciderImpl) NthNextHmy(instance shardingconfig.Instance, pubkey *bls.PublicKeyWrapper, next int) (bool, *bls.PublicKeyWrapper) {
a.mu.Lock()
defer a.mu.Unlock()
Expand Down
2 changes: 2 additions & 0 deletions internal/params/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,7 @@ var (
big.NewInt(0), // AllowlistEpoch
big.NewInt(1), // LeaderRotationExternalNonBeaconLeaders
big.NewInt(1), // LeaderRotationExternalBeaconLeaders
big.NewInt(0), // LeaderRotationV2Epoch
big.NewInt(0), // FeeCollectEpoch
big.NewInt(0), // ValidatorCodeFixEpoch
big.NewInt(0), // BlockGas30M
Expand Down Expand Up @@ -414,6 +415,7 @@ var (
big.NewInt(0), // AllowlistEpoch
big.NewInt(1), // LeaderRotationExternalNonBeaconLeaders
big.NewInt(1), // LeaderRotationExternalBeaconLeaders
big.NewInt(0), // LeaderRotationV2Epoch
big.NewInt(0), // FeeCollectEpoch
big.NewInt(0), // ValidatorCodeFixEpoch
big.NewInt(0), // HIP30Epoch
Expand Down

0 comments on commit d5d8358

Please sign in to comment.