contract BSCValidatorSet {
uint256 public turnLength; // Consecutive number of blocks a validator receives priority for block production
function updateParam(string calldata key, bytes calldata value) external {
if (Memory.compareStrings(key, "turnLength")) {
require(value.length == 32, "length of turnLength mismatch");
uint256 newTurnLength = BytesToTypes.bytesToUint256(32, value);
require(
newTurnLength >= 3 && newTurnLength <= 64 || newTurnLength == 1,
"the turnLength should be in [3,64] or equal to 1"
);
turnLength = newTurnLength;
} else {
require(false, "unknown param");
}
emit paramChange(key, value);
}
}