From d65be8945b859e86db6c7e08843dfe31e5392ba0 Mon Sep 17 00:00:00 2001 From: Alysia Huggins Date: Wed, 2 Oct 2024 11:43:45 -0400 Subject: [PATCH] update the comments to reflect when the permissionedProver is utilized --- contracts/src/LightClient.sol | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/contracts/src/LightClient.sol b/contracts/src/LightClient.sol index 2a1a6a693..8540227ca 100644 --- a/contracts/src/LightClient.sol +++ b/contracts/src/LightClient.sol @@ -33,10 +33,10 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable { /// @notice upgrade event when the proxy updates the implementation it's pointing to event Upgrade(address implementation); - /// @notice a permissioned prover is needed to interact `newFinalizedState` + /// @notice when a permissioned prover is set, this event is emitted. event PermissionedProverRequired(address permissionedProver); - /// @notice a permissioned prover is no longer needed to interact `newFinalizedState` + /// @notice when the permissioned prover is unset, this event is emitted. event PermissionedProverNotRequired(); // === System Parameters === @@ -53,9 +53,8 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable { LightClientState public finalizedState; /// @notice the address of the prover that can call the newFinalizedState function when the - /// contract is - /// in permissioned prover mode. This address is address(0) when the contract is not in the - /// permissioned prover mode + /// contract is in permissioned prover mode. This address is address(0) when the contract is + /// not in permissioned prover mode address public permissionedProver; /// @notice Max number of seconds worth of state commitments to record based on this block @@ -219,8 +218,7 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable { /// period has to be submitted /// before any newer state can be accepted since the stake table commitments of that block /// become the snapshots used for vote verifications later on. - /// @dev in this version, only a permissioned prover doing the computations - /// can call this function + /// @dev if the permissionedProver is set, only the permissionedProver can call this function /// @dev the state history for `stateHistoryRetentionPeriod` L1 blocks are also recorded in the /// `stateHistoryCommitments` array /// @notice While `newState.stakeTable*` refers to the (possibly) new stake table states, @@ -279,10 +277,9 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable { } } - /// @notice set the permissionedProverMode to true and set the permissionedProver to the - /// non-zero address provided + /// @notice set the permissionedProver to the non-zero address provided /// @dev this function can also be used to update the permissioned prover once it's a different - /// address + /// address to the current permissioned prover function setPermissionedProver(address prover) public virtual onlyOwner { if (prover == address(0)) { revert InvalidAddress(); @@ -294,8 +291,8 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable { emit PermissionedProverRequired(permissionedProver); } - /// @notice set the permissionedProverMode to false and set the permissionedProver to address(0) - /// @dev if it was already disabled (permissioneProverMode == false), then revert with + /// @notice set the permissionedProver to address(0) + /// @dev if it was already disabled, then revert with the error, NoChangeRequired function disablePermissionedProverMode() public virtual onlyOwner { if (isPermissionedProverEnabled()) { permissionedProver = address(0);