Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(evm): introduce EvmInCosmosClient state lens #3368

Merged
merged 11 commits into from
Dec 31, 2024
90 changes: 88 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ members = [
"lib/tendermint-light-client-types",
"lib/linea-light-client-types",
"lib/movement-light-client-types",
"lib/state-lens/evm-light-client-types",

# these will all be re enabled and updated once ethereum-light-client is updated

Expand Down Expand Up @@ -114,11 +115,13 @@ members = [
"voyager/modules/client/ethereum",
"voyager/modules/client/movement",
"voyager/modules/client/tendermint",
"voyager/modules/client/state-lens/evm",

"voyager/modules/client-bootstrap/cometbls",
"voyager/modules/client-bootstrap/ethereum",
"voyager/modules/client-bootstrap/movement",
"voyager/modules/client-bootstrap/tendermint",
"voyager/modules/client-bootstrap/state-lens/evm",

"voyager/modules/consensus/berachain",
"voyager/modules/consensus/cometbls",
Expand All @@ -131,6 +134,7 @@ members = [
"voyager/plugins/client-update/ethereum",
"voyager/plugins/client-update/movement",
"voyager/plugins/client-update/tendermint",
"voyager/plugins/client-update/state-lens/evm",

"voyager/plugins/periodic-client-update",

Expand Down Expand Up @@ -208,6 +212,8 @@ scroll-api = { path = "lib/scroll-api", default-features = fal
scroll-codec = { path = "lib/scroll-codec", default-features = false }
scroll-rpc = { path = "lib/scroll-rpc", default-features = false }

evm-state-lens-light-client-types = { path = "lib/state-lens/evm-light-client-types", default-features = false }

tendermint-light-client = { path = "cosmwasm/union-ibc/light-clients/tendermint", default-features = false }
tendermint-light-client-types = { path = "lib/tendermint-light-client-types", default-features = false }
tendermint-verifier = { path = "lib/tendermint-verifier", default-features = false }
Expand Down
11 changes: 5 additions & 6 deletions evm/contracts/clients/CometblsClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@ import "@openzeppelin-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import "@openzeppelin-upgradeable/access/OwnableUpgradeable.sol";
import "@openzeppelin-upgradeable/utils/PausableUpgradeable.sol";

import "./ICS23MembershipVerifier.sol";
import "./Verifier.sol";

import "../core/02-client/ILightClient.sol";
import "../core/24-host/IBCStore.sol";
import "../core/24-host/IBCCommitment.sol";
import "../lib/Common.sol";
import "../lib/ICS23.sol";
import "../lib/CometblsZKVerifier.sol";
import "../lib/ICS23Verifier.sol";

struct SignedHeader {
uint64 height;
Expand Down Expand Up @@ -392,7 +391,7 @@ contract CometblsClient is
}
bytes32 contractAddress = clientStates[clientId].contractAddress;
bytes32 appHash = consensusStates[clientId][height].appHash;
return ICS23MembershipVerifier.verifyMembership(
return ICS23Verifier.verifyMembership(
appHash,
proof,
abi.encodePacked(IBCStoreLib.COMMITMENT_PREFIX),
Expand All @@ -414,7 +413,7 @@ contract CometblsClient is
}
bytes32 contractAddress = clientStates[clientId].contractAddress;
bytes32 appHash = consensusStates[clientId][height].appHash;
return ICS23MembershipVerifier.verifyNonMembership(
return ICS23Verifier.verifyNonMembership(
appHash,
proof,
abi.encodePacked(IBCStoreLib.COMMITMENT_PREFIX),
Expand Down Expand Up @@ -540,7 +539,7 @@ contract CometblsClient is
commitmentHash
];

return Verifier.verifyProof(
return CometblsZKVerifier.verifyProof(
zkp.proof, zkp.proofCommitment, zkp.proofCommitmentPOK, publicInputs
);
}
Expand Down
7 changes: 3 additions & 4 deletions evm/contracts/clients/CosmosInCosmosClient.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ import "../core/24-host/IBCStore.sol";
import "../core/24-host/IBCCommitment.sol";
import "../lib/ICS23.sol";
import "../lib/Common.sol";

import "./ICS23MembershipVerifier.sol";
import "../lib/ICS23Verifier.sol";

struct TendermintConsensusState {
uint64 timestamp;
Expand Down Expand Up @@ -216,7 +215,7 @@ contract CosmosInCosmosClient is
revert CosmosInCosmosLib.ErrClientFrozen();
}
bytes32 appHash = consensusStates[clientId][height].appHash;
return ICS23MembershipVerifier.verifyMembership(
return ICS23Verifier.verifyMembership(
appHash,
proof,
abi.encodePacked(IBCStoreLib.COMMITMENT_PREFIX),
Expand All @@ -235,7 +234,7 @@ contract CosmosInCosmosClient is
revert CosmosInCosmosLib.ErrClientFrozen();
}
bytes32 appHash = consensusStates[clientId][height].appHash;
return ICS23MembershipVerifier.verifyNonMembership(
return ICS23Verifier.verifyNonMembership(
appHash,
proof,
abi.encodePacked(IBCStoreLib.COMMITMENT_PREFIX),
Expand Down
Loading
Loading