Skip to content

Commit

Permalink
rename threshold for escape hatch lag function to minimize confusion (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alysiahuggins authored Oct 2, 2024
1 parent 8f72370 commit 5a58df9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions contract-bindings/src/light_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ pub mod light_client {
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("threshold"),
name: ::std::borrow::ToOwned::to_owned("blockThreshold"),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
Expand Down Expand Up @@ -1057,10 +1057,10 @@ pub mod light_client {
pub fn lag_over_escape_hatch_threshold(
&self,
block_number: ::ethers::core::types::U256,
threshold: ::ethers::core::types::U256,
block_threshold: ::ethers::core::types::U256,
) -> ::ethers::contract::builders::ContractCall<M, bool> {
self.0
.method_hash([224, 48, 51, 1], (block_number, threshold))
.method_hash([224, 48, 51, 1], (block_number, block_threshold))
.expect("method not found (this should never happen)")
}
///Calls the contract's `newFinalizedState` (0x2063d4f7) function
Expand Down Expand Up @@ -2384,7 +2384,7 @@ pub mod light_client {
)]
pub struct LagOverEscapeHatchThresholdCall {
pub block_number: ::ethers::core::types::U256,
pub threshold: ::ethers::core::types::U256,
pub block_threshold: ::ethers::core::types::U256,
}
///Container type for all input parameters for the `newFinalizedState` function with signature `newFinalizedState((uint64,uint64,uint256),((uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),(uint256,uint256),uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256))` and selector `0x2063d4f7`
#[derive(
Expand Down
11 changes: 6 additions & 5 deletions contracts/src/LightClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -347,12 +347,13 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable {
);
}

/// @notice checks if the state updates lag behind the specified threshold based on the provided
/// @notice checks if the state updates lag behind the specified block threshold based on the
/// provided
/// block number.
/// @param blockNumber The block number to compare against the latest state updates
/// @param threshold The number of blocks updates to this contract is allowed to lag behind
/// @return bool returns true if the lag exceeds the threshold; otherwise, false
function lagOverEscapeHatchThreshold(uint256 blockNumber, uint256 threshold)
/// @param blockThreshold The number of blocks updates this contract is allowed to lag behind
/// @return bool returns true if the lag exceeds the blockThreshold; otherwise, false
function lagOverEscapeHatchThreshold(uint256 blockNumber, uint256 blockThreshold)
public
view
virtual
Expand Down Expand Up @@ -395,7 +396,7 @@ contract LightClient is Initializable, OwnableUpgradeable, UUPSUpgradeable {
revert InsufficientSnapshotHistory();
}

return blockNumber - prevBlock > threshold;
return blockNumber - prevBlock > blockThreshold;
}

/// @notice get the HotShot commitment that represents the Merkle root containing the leaf at
Expand Down

0 comments on commit 5a58df9

Please sign in to comment.