aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/vm/oracle_contracts.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/core/vm/oracle_contracts.go b/core/vm/oracle_contracts.go
index 2dc1ce54f..35a9e5861 100644
--- a/core/vm/oracle_contracts.go
+++ b/core/vm/oracle_contracts.go
@@ -1708,6 +1708,18 @@ func (g *GovernanceContract) updateConfiguration(cfg *rawConfigStruct) ([]byte,
return nil, errExecutionReverted
}
+ // Sanity checks.
+ if cfg.MinStake.Cmp(big.NewInt(0)) <= 0 ||
+ cfg.LockupPeriod.Cmp(big.NewInt(0)) <= 0 ||
+ cfg.BlockGasLimit.Cmp(big.NewInt(0)) <= 0 ||
+ cfg.MinGasPrice.Cmp(big.NewInt(0)) <= 0 ||
+ cfg.LambdaBA.Cmp(big.NewInt(0)) <= 0 ||
+ cfg.LambdaDKG.Cmp(big.NewInt(0)) <= 0 ||
+ cfg.RoundLength.Cmp(big.NewInt(0)) <= 0 ||
+ cfg.MinBlockInterval.Cmp(big.NewInt(0)) <= 0 {
+ return nil, errExecutionReverted
+ }
+
g.state.UpdateConfigurationRaw(cfg)
g.state.emitConfigurationChangedEvent()