Skip to content

Commit

Permalink
Add capacity check
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph committed Oct 14, 2024
1 parent 9bf4d58 commit e8c8b87
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions vms/platformvm/txs/executor/standard_tx_executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,10 @@ func (e *StandardTxExecutor) IncreaseBalanceTx(tx *txs.IncreaseBalanceTx) error

// If the validator is currently inactive, we are activating it.
if sov.EndAccumulatedFee == 0 {
if gas.Gas(e.State.NumActiveSubnetOnlyValidators()) >= e.Backend.Config.ValidatorFeeConfig.Capacity {
return errMaxNumActiveValidators
}

sov.EndAccumulatedFee = e.State.GetAccruedFees()
}
sov.EndAccumulatedFee, err = safemath.Add(sov.EndAccumulatedFee, tx.Balance)
Expand Down

0 comments on commit e8c8b87

Please sign in to comment.