Skip to content

Commit

Permalink
update the comments to reflect when the permissionedProver is utilized
Browse files Browse the repository at this point in the history
  • Loading branch information
alysiahuggins committed Oct 2, 2024
1 parent b0604bb commit d65be89
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions contracts/src/LightClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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 ===
Expand All @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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();
Expand All @@ -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);
Expand Down

0 comments on commit d65be89

Please sign in to comment.