Skip to content

Commit

Permalink
make it clear via comments that the min retention period allowed is 1…
Browse files Browse the repository at this point in the history
… hour and update script to perform permissionedProver validation correctly
  • Loading branch information
alysiahuggins committed Oct 2, 2024
1 parent 87fffff commit 58f43df
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion contracts/script/LightClient.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ contract DeployLightClientScript is Script {

// verify post deployment details
require(
lightClientProxy.permissionedProver() == owner,
lightClientProxy.permissionedProver() == permissionedProver,
"Post Deployment Verification: Set permissioned prover failed"
);
require(
Expand Down
14 changes: 6 additions & 8 deletions contracts/src/LightClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable {
/// @notice This contract is called by the proxy when you deploy this contract
/// @param _genesis The initial state of the light client
/// @param _stateHistoryRetentionPeriod The maximum retention period (in seconds) for the state
/// history
/// history. the min retention period allowed is 1 hour
/// @param owner The address of the contract owner
function initialize(
LightClientState memory _genesis,
Expand Down Expand Up @@ -184,19 +184,17 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable {
/// @param _genesis The initial state of the light client
/// @param _genesisStakeTableState The initial stake table state of the light client
/// @param _stateHistoryRetentionPeriod The maximum retention period (in seconds) for the state
/// history
/// history. The min retention period allowed is 1 hour
function _initializeState(
LightClientState memory _genesis,
StakeTableState memory _genesisStakeTableState,
uint32 _stateHistoryRetentionPeriod
) internal {
// The viewNum and blockHeight in the genesis state must be zero to indicate that this is
// the
// initial state. Stake table commitments and threshold cannot be zero, otherwise it's
// impossible to
// generate valid proof to move finalized state forward. The stateHistoryRetentionPeriod
// must be
// at least 1 hour to ensure proper state retention.
// the initial state. Stake table commitments and threshold cannot be zero, otherwise it's
// impossible to generate valid proof to move finalized state forward. The
// stateHistoryRetentionPeriod
// must be at least 1 hour to ensure proper state retention.
if (
_genesis.viewNum != 0 || _genesis.blockHeight != 0
|| BN254.ScalarField.unwrap(_genesisStakeTableState.blsKeyComm) == 0
Expand Down

0 comments on commit 58f43df

Please sign in to comment.