aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/oracle_contracts.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/oracle_contracts.go')
-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 90cef5def..4434dcf5c 100644
--- a/core/vm/oracle_contracts.go
+++ b/core/vm/oracle_contracts.go
@@ -1706,6 +1706,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()