Unpredictable Behavior Due to Admin Front Running or General Bad Timing
In a number of cases, administrators of contracts can update or upgrade things in the system without warning. This has the potential to violate a security goal of the system.\\nSpecifically, privileged roles could use front running to make malicious changes just ahead of incoming transactions, or purely accidental negative effects could occur due to the unfortunate timing of changes.\\nSome instances of this are more important than others, but in general, users of the system should have assurances about the behavior of the action they're about to take.\\nUpgradeable TU proxy\\nFee changes take effect immediately\\n```\\n/// @notice Change the Operator fee\\n/// @param \\_operatorFee Fee in Basis Point\\nfunction setOperatorFee(uint256 \\_operatorFee) external onlyAdmin {\\n if (\\_operatorFee > StakingContractStorageLib.getOperatorCommissionLimit()) {\\n revert InvalidFee();\\n }\\n StakingContractStorageLib.setOperatorFee(\\_operatorFee);\\n emit ChangedOperatorFee(\\_operatorFee);\\n}\\n```\\n\\n```\\n/// @notice Change the Global fee\\n/// @param \\_globalFee Fee in Basis Point\\nfunction setGlobalFee(uint256 \\_globalFee) external onlyAdmin {\\n if (\\_globalFee > StakingContractStorageLib.getGlobalCommissionLimit()) {\\n revert InvalidFee();\\n }\\n StakingContractStorageLib.setGlobalFee(\\_globalFee);\\n emit ChangedGlobalFee(\\_globalFee);\\n}\\n```\\n
The underlying issue is that users of the system can't be sure what the behavior of a function call will be, and this is because the behavior can change at any time.\\nWe recommend giving the user advance notice of changes with a time lock. For example, make all upgrades require two steps with a mandatory time window between them. The first step merely broadcasts to users that a particular change is coming, and the second step commits that change after a suitable waiting period.
```\\n/// @notice Change the Operator fee\\n/// @param \\_operatorFee Fee in Basis Point\\nfunction setOperatorFee(uint256 \\_operatorFee) external onlyAdmin {\\n if (\\_operatorFee > StakingContractStorageLib.getOperatorCommissionLimit()) {\\n revert InvalidFee();\\n }\\n StakingContractStorageLib.setOperatorFee(\\_operatorFee);\\n emit ChangedOperatorFee(\\_operatorFee);\\n}\\n```\\n