Skip to content

Commit

Permalink
Revert comment change
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed Jul 25, 2023
1 parent 028ef9a commit 095b1dc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions vms/platformvm/validators/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,8 +264,10 @@ func (m *manager) makePrimaryNetworkValidatorSet(

// Rebuild primary network validators at [targetHeight]
//
// Note: Height h contains the diffs from height h-1 to h. So, to rebuild
// validators state at height h, we apply diffs till height h+1.
// Note: Since we are attempting to generate the validator set at
// [targetHeight], we want to apply the diffs from
// (targetHeight, currentHeight]. Because the state interface is implemented
// to be inclusive, we apply diffs in [targetHeight + 1, currentHeight].
lastDiffHeight := targetHeight + 1
err = m.state.ApplyValidatorWeightDiffs(
ctx,
Expand Down Expand Up @@ -318,8 +320,10 @@ func (m *manager) makeSubnetValidatorSet(

// Rebuild subnet validators at [targetHeight]
//
// Note: Height h contains the diffs from height h-1 to h. So, to rebuild
// validators state at height h, we apply diffs till height h+1.
// Note: Since we are attempting to generate the validator set at
// [targetHeight], we want to apply the diffs from
// (targetHeight, currentHeight]. Because the state interface is implemented
// to be inclusive, we apply diffs in [targetHeight + 1, currentHeight].
lastDiffHeight := targetHeight + 1
err = m.state.ApplyValidatorWeightDiffs(
ctx,
Expand Down

0 comments on commit 095b1dc

Please sign in to comment.