diff --git a/avalanchego/vms/platformvm/service.go b/avalanchego/vms/platformvm/service.go index bd9e0d3e..d09bb822 100644 --- a/avalanchego/vms/platformvm/service.go +++ b/avalanchego/vms/platformvm/service.go @@ -2145,8 +2145,8 @@ type GetMinStakeReply struct { // GetMinStake returns the minimum staking amount in nAVAX. func (service *Service) GetMinStake(_ *http.Request, _ *struct{}, reply *GetMinStakeReply) error { - now := service.vm.clock.Time() - minValidatorStake, _, minDelegatorStake, _, _, _, _, _, _, _ := executor.GetCurrentInflationSettings(now, service.vm.ctx.NetworkID, &service.vm.Config) + timestamp := service.vm.state.GetTimestamp() + minValidatorStake, _, minDelegatorStake, _, _, _, _, _, _, _ := executor.GetCurrentInflationSettings(timestamp, service.vm.ctx.NetworkID, &service.vm.Config) reply.MinValidatorStake = json.Uint64(minValidatorStake) reply.MinDelegatorStake = json.Uint64(minDelegatorStake) return nil diff --git a/avalanchego/vms/platformvm/txs/executor/proposal_tx_executor.go b/avalanchego/vms/platformvm/txs/executor/proposal_tx_executor.go index 9922cb60..dfec5efd 100644 --- a/avalanchego/vms/platformvm/txs/executor/proposal_tx_executor.go +++ b/avalanchego/vms/platformvm/txs/executor/proposal_tx_executor.go @@ -78,9 +78,8 @@ func (e *ProposalTxExecutor) AddValidatorTx(tx *txs.AddValidatorTx) error { return state.ErrMissingParentState } currentTimestamp := parentState.GetTimestamp() - now := e.Clk.Time() - minValidatorStake, maxValidatorStake, _, minDelegationFee, minStakeDuration, _, maxStakeDuration, minFutureStartTimeOffset, _, minStakeStartTime := GetCurrentInflationSettings(now, e.Backend.Ctx.NetworkID, e.Config) + minValidatorStake, maxValidatorStake, _, minDelegationFee, minStakeDuration, _, maxStakeDuration, minFutureStartTimeOffset, _, minStakeStartTime := GetCurrentInflationSettings(currentTimestamp, e.Backend.Ctx.NetworkID, e.Config) switch { case tx.Validator.Wght < minValidatorStake: // Ensure validator is staking at least the minimum amount @@ -381,9 +380,8 @@ func (e *ProposalTxExecutor) AddDelegatorTx(tx *txs.AddDelegatorTx) error { return state.ErrMissingParentState } currentTimestamp := parentState.GetTimestamp() - now := e.Clk.Time() - _, maxValidatorStake, minDelegatorStake, _, _, minDelegateDuration, maxStakeDuration, minFutureStartTimeOffset, maxValidatorWeightFactor, _ := GetCurrentInflationSettings(now, e.Backend.Ctx.NetworkID, e.Config) + _, maxValidatorStake, minDelegatorStake, _, _, minDelegateDuration, maxStakeDuration, minFutureStartTimeOffset, maxValidatorWeightFactor, _ := GetCurrentInflationSettings(currentTimestamp, e.Backend.Ctx.NetworkID, e.Config) duration := tx.Validator.Duration() switch {