From 095b1dc4958b1f75ece33aba9c7fbee1c72b34f3 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Tue, 25 Jul 2023 14:20:12 -0400 Subject: [PATCH] Revert comment change --- vms/platformvm/validators/manager.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/vms/platformvm/validators/manager.go b/vms/platformvm/validators/manager.go index 5dbe121660c..4d8eabae8ef 100644 --- a/vms/platformvm/validators/manager.go +++ b/vms/platformvm/validators/manager.go @@ -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, @@ -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,