MixinParams.setParams bypasses safety checks made by standard StakingProxy upgrade path.
The staking contracts use a set of configurable parameters to determine the behavior of various parts of the system. The parameters dictate the duration of epochs, the ratio of delegated stake weight vs operator stake, the minimum pool stake, and the Cobb-Douglas numerator and denominator. These parameters can be configured in two ways:\\n```\\n// Call `init()` on the staking contract to initialize storage.\\n(bool didInitSucceed, bytes memory initReturnData) = stakingContract.delegatecall(\\n    abi.encodeWithSelector(IStorageInit(0).init.selector)\\n);\\nif (!didInitSucceed) {\\n    assembly {\\n        revert(add(initReturnData, 0x20), mload(initReturnData))\\n    }\\n}\\n  \\n// Assert initialized storage values are valid\\n\\_assertValidStorageParams();\\n```\\n\\nAn authorized address can call `MixinParams.setParams` at any time and set the contract's parameters to arbitrary values.\\nThe latter method introduces the possibility of setting unsafe or nonsensical values for the contract parameters: `epochDurationInSeconds` can be set to 0, `cobbDouglassAlphaNumerator` can be larger than `cobbDouglassAlphaDenominator`, `rewardDelegatedStakeWeight` can be set to a value over 100% of the staking reward, and more.\\nNote, too, that by using `MixinParams.setParams` to set all parameters to 0, the `Staking` contract can be re-initialized by way of `Staking.init`. Additionally, it can be re-attached by way of `StakingProxy.attachStakingContract`, as the delegatecall to `Staking.init` will succeed.
Resolution\\nThis is fixed in 0xProject/0x-monorepo#2279. Now the parameter validity is asserted in `setParams()`.\\nEnsure that calls to `setParams` check that the provided values are within the same range currently enforced by the proxy.
```\\n// Call `init()` on the staking contract to initialize storage.\\n(bool didInitSucceed, bytes memory initReturnData) = stakingContract.delegatecall(\\n    abi.encodeWithSelector(IStorageInit(0).init.selector)\\n);\\nif (!didInitSucceed) {\\n    assembly {\\n        revert(add(initReturnData, 0x20), mload(initReturnData))\\n    }\\n}\\n  \\n// Assert initialized storage values are valid\\n\\_assertValidStorageParams();\\n```\\n