Skip to content

Commit

Permalink
minor typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RnkSngh committed Sep 17, 2024
1 parent 43a9cfb commit fc09ded
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion contracts/core/Dispatcher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ pragma solidity 0.8.15;
import {UUPSUpgradeable} from "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol";
import {Ownable2StepUpgradeable} from "@openzeppelin-upgradeable/contracts/access/Ownable2StepUpgradeable.sol";
import {IbcChannelReceiver, IbcPacketReceiver} from "../interfaces/IbcReceiver.sol";
import {L1Header, OpL2StateProof, Ics23Proof} from "../interfaces/IProofVerifier.sol";
import {L1Header, Ics23Proof} from "../interfaces/IProofVerifier.sol";
import {ILightClient} from "../interfaces/ILightClient.sol";
import {IDispatcher} from "../interfaces/IDispatcher.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
Expand Down
17 changes: 10 additions & 7 deletions contracts/core/OptimisticLightClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,21 @@ contract OptimisticLightClient is ILightClient {
/**
* @inheritdoc ILightClient
*/
function updateClient(
L1Header calldata l1header,
bytes calldata proof,
uint256 height,
uint256 appHash
) external override returns (uint256 fraudProofEndTime, bool ended) {
function updateClient(L1Header calldata l1header, bytes calldata proof, uint256 height, uint256 appHash)
external
override
returns (uint256 fraudProofEndTime, bool ended)
{
uint256 hash = consensusStates[height];
if (hash == 0) {
// if this is a new apphash we need to verify the provided proof. This method will revert in case
// of invalid proof.
verifier.verifyStateUpdate(
l1header, abi.decode(proof, (OpL2StateProof)), bytes32(appHash), l1BlockProvider.hash(), l1BlockProvider.number()
l1header,
abi.decode(proof, (OpL2StateProof)),
bytes32(appHash),
l1BlockProvider.hash(),
l1BlockProvider.number()
);

// a new appHash
Expand Down
4 changes: 2 additions & 2 deletions contracts/core/OptimisticProofVerifier.sol
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ contract OptimisticProofVerifier is IProofVerifier {
* 4. With the state account root and using the provided storage proof and output proposal key, get the
* vlue stored in the MerkleTrie leaf. This is the output proposal root.
*
* 5. With the provided apphash and L2 Blockc hash, try to compute a new output root and match it against
* 5. With the provided apphash and L2 Block hash, try to compute a new output root and match it against
* the one we just proved to be valid.
*/
function verifyStateUpdate(
Expand All @@ -90,7 +90,7 @@ contract OptimisticProofVerifier is IProofVerifier {

// These two checks are here to verify that the "plain" (i.e. not RLP encoded) values in the l1header are
// the same ones found in l1header.header (i.e. RLP encoded). This is because it is cheaper to RLP
// encode that decode
// encode than decode
if (keccak256(RLPWriter.writeUint(l1header.number)) != keccak256(l1header.header[_L1_NUMBER_INDEX])) {
revert InvalidRLPEncodedL1BlockNumber();
}
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IDispatcher.sol
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pragma solidity ^0.8.0;

import {IbcDispatcher, IbcEventsEmitter} from "./IbcDispatcher.sol";

import {L1Header, OpL2StateProof, Ics23Proof} from "./IProofVerifier.sol";
import {L1Header, Ics23Proof} from "./IProofVerifier.sol";
import {Channel, ChannelEnd, ChannelOrder, IbcPacket} from "../libs/Ibc.sol";
import {ILightClient} from "./ILightClient.sol";
import {IFeeVault} from "./IFeeVault.sol";
Expand Down
17 changes: 7 additions & 10 deletions contracts/interfaces/ILightClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
pragma solidity ^0.8.0;

import {Ics23Proof, L1Header, OpL2StateProof} from "./IProofVerifier.sol";
import {Ics23Proof, L1Header} from "./IProofVerifier.sol";

/**
* @title ILightClient
Expand All @@ -31,20 +31,17 @@ interface ILightClient {
* the fraud proof window has passed according to the block's time stamp.
* @param l1header RLP "encoded" version of the L1 header that matches with the trusted hash and number
* @param proof l2 state proof. It includes the keys, hashes and storage proofs required to verify the app hash
* @param appHash l2 app hash (state root) to be verified
* @param appHash Peptide app hash (state root) to be verified
* @return fraudProofEndTime The fraud proof end time.
* @return ended A boolean indicating if the fraud proof window has passed.
*/
function updateClient(
L1Header calldata l1header,
bytes calldata proof,
uint256 height,
uint256 appHash
) external returns (uint256 fraudProofEndTime, bool ended);
function updateClient(L1Header calldata l1header, bytes calldata proof, uint256 height, uint256 appHash)
external
returns (uint256 fraudProofEndTime, bool ended);

/**
* @dev Returns the fraud proof end time at a giben block
* 0 is returned if there isn't an appHash with the given height.
* @dev Returns the fraud proof end time at a given block
* 0 is returned if there isn't an appHash with the given l2 height.
*/
function getFraudProofEndtime(uint256 height) external returns (uint256 endTime);

Expand Down
2 changes: 1 addition & 1 deletion contracts/utils/DummyLightClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/
pragma solidity ^0.8.0;

import {ILightClient, L1Header, OpL2StateProof, Ics23Proof} from "../interfaces/ILightClient.sol";
import {ILightClient, L1Header, Ics23Proof} from "../interfaces/ILightClient.sol";

/**
* @title DummyLightClient
Expand Down

0 comments on commit fc09ded

Please sign in to comment.