Skip to content

Commit

Permalink
feat(ibc-union): implement QueryResponses and cw-orch function genera…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
adairrr committed Feb 20, 2025
1 parent 2b7e377 commit a6ce83b
Show file tree
Hide file tree
Showing 293 changed files with 60,063 additions and 1,986 deletions.
4,641 changes: 2,945 additions & 1,696 deletions Cargo.lock

Large diffs are not rendered by default.

64 changes: 45 additions & 19 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ members = [

"lib/beacon-api",
"lib/cometbft-rpc",
"lib/cosmos-client",
"lib/cometbft-types",

"lib/chain-utils",
Expand Down Expand Up @@ -53,6 +54,7 @@ members = [
"lib/voyager-core",
"lib/galois-rpc",
"lib/cosmos-sdk-event",
"lib/unionlabs-cosmwasm-upgradable",

# "lib/near/near-ibc",
# "lib/near/near-light-client",
Expand All @@ -68,36 +70,41 @@ members = [
"lib/scroll-verifier",
"lib/tendermint-verifier",

"lib/ethereum-light-client-types",
"lib/arbitrum-light-client-types",
"lib/berachain-light-client-types",
"lib/cometbls-light-client-types",
"lib/scroll-light-client-types",
"lib/tendermint-light-client-types",
"lib/linea-light-client-types",
"lib/ethereum-light-client-types",
"lib/ethermint-light-client-types",
"lib/movement-light-client-types",
"lib/linea-light-client-types",
"lib/scroll-light-client-types",
"lib/state-lens-ics23-mpt-light-client-types",
"lib/state-lens-ics23-mpt-light-client-types",
"lib/state-lens-ics23-ics23-light-client-types",
"lib/state-lens-ics23-smt-light-client-types",

# these will all be re enabled and updated once ethereum-light-client is updated
"cosmwasm/deployer",

"cosmwasm/ibc-union/light-clients/ethereum",
"cosmwasm/ibc-union/light-clients/arbitrum",
"cosmwasm/ibc-union/light-clients/berachain",
"cosmwasm/ibc-union/light-clients/cometbls",
"cosmwasm/ibc-union/light-clients/state-lens-ics23-mpt",
# "cosmwasm/ibc-union/light-clients/scroll",
"cosmwasm/ibc-union/light-clients/tendermint",
# "cosmwasm/ibc-union/light-clients/linea",
"cosmwasm/ibc-union/lightclient/arbitrum",
"cosmwasm/ibc-union/lightclient/berachain",
"cosmwasm/ibc-union/lightclient/cometbls",
"cosmwasm/ibc-union/lightclient/ethereum",
"cosmwasm/ibc-union/lightclient/ethermint",
"cosmwasm/ibc-union/lightclient/tendermint",
"cosmwasm/ibc-union/lightclient/movement",
"cosmwasm/ibc-union/lightclient/state-lens-ics23-mpt",
"cosmwasm/ibc-union/lightclient/state-lens-ics23-smt",

"cosmwasm/ibc-union/light-clients/movement",
# these will all be re enabled and updated once ethereum-light-client is updated
# "cosmwasm/ibc-union/lightclient/scroll",
# "cosmwasm/ibc-union/lightclient/linea",

"tools/devnet-utils",
"tools/parse-wasm-client-type",
"tools/tidy",
"tools/move-bindgen",

"lib/move-bindgen-derive",

"unionvisor",
Expand All @@ -111,13 +118,15 @@ members = [

"voyager/modules/proof/cosmos-sdk",
"voyager/modules/proof/cosmos-sdk-union",
"voyager/modules/proof/ethermint",
"voyager/modules/proof/ethereum",
"voyager/modules/proof/movement",

"voyager/modules/client/cometbls",
"voyager/modules/client/ethereum",
"voyager/modules/client/movement",
"voyager/modules/client/tendermint",
"voyager/modules/client/ethermint",
"voyager/modules/client/state-lens/ics23-mpt",
"voyager/modules/client/state-lens/ics23-ics23",
"voyager/modules/client/state-lens/ics23-smt",
Expand All @@ -126,6 +135,7 @@ members = [
"voyager/modules/client-bootstrap/ethereum",
"voyager/modules/client-bootstrap/movement",
"voyager/modules/client-bootstrap/tendermint",
"voyager/modules/client-bootstrap/ethermint",
"voyager/modules/client-bootstrap/state-lens/ics23-mpt",
"voyager/modules/client-bootstrap/state-lens/ics23-smt",
"voyager/modules/client-bootstrap/state-lens/ics23-ics23",
Expand All @@ -141,6 +151,7 @@ members = [
"voyager/plugins/client-update/ethereum",
"voyager/plugins/client-update/movement",
"voyager/plugins/client-update/tendermint",
"voyager/plugins/client-update/ethermint",
"voyager/plugins/client-update/state-lens",

"voyager/plugins/periodic-client-update",
Expand Down Expand Up @@ -176,11 +187,17 @@ members = [
"lib/state-lens-light-client-types",
"lib/create3",
"lib/linea-types",
# "cosmwasm/native-token-minter",
"cosmwasm/cw20-token-minter",
"cosmwasm/ucs03-zkgm-token-minter-api",
"cosmwasm/cw20-base",
]

[workspace.package]
authors = ["Union Labs"]
edition = "2021"
license-file = "LICENSE"
publish = false
repository = "https://github.com/unionlabs/union"

[workspace.lints.clippy]
Expand All @@ -203,19 +220,20 @@ beacon-api-types = { path = "lib/beacon-api-types", default-features = false }
chain-utils = { path = "lib/chain-utils", default-features = false }
cometbft-rpc = { path = "lib/cometbft-rpc", default-features = false }
cometbft-types = { path = "lib/cometbft-types", default-features = false }
cosmos-client = { path = "lib/cosmos-client", default-features = false }

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

arbitrum-light-client-types = { path = "lib/arbitrum-light-client-types", default-features = false }
arbitrum-verifier = { path = "lib/arbitrum-verifier", default-features = false }

cometbls-groth16-verifier = { path = "lib/cometbls-groth16-verifier", default-features = false }
cometbls-light-client = { path = "cosmwasm/ibc-union/light-clients/cometbls", default-features = false }
cometbls-light-client = { path = "cosmwasm/ibc-union/lightclient/cometbls", default-features = false }
cometbls-light-client-types = { path = "lib/cometbls-light-client-types", default-features = false }

scroll-light-client-types = { path = "lib/scroll-light-client-types", default-features = false }

ethereum-light-client = { path = "cosmwasm/ibc-union/light-clients/ethereum", default-features = false }
ethereum-light-client = { path = "cosmwasm/ibc-union/lightclient/ethereum", default-features = false }
ethereum-light-client-types = { path = "lib/ethereum-light-client-types", default-features = false }
ethereum-sync-protocol = { path = "lib/ethereum-sync-protocol", default-features = false }
evm-storage-verifier = { path = "lib/evm-storage-verifier", default-features = false }
Expand All @@ -229,7 +247,8 @@ state-lens-ics23-ics23-light-client-types = { path = "lib/state-lens-ics23-ics23
state-lens-ics23-mpt-light-client-types = { path = "lib/state-lens-ics23-mpt-light-client-types", default-features = false }
state-lens-ics23-smt-light-client-types = { path = "lib/state-lens-ics23-smt-light-client-types", default-features = false }

tendermint-light-client = { path = "cosmwasm/ibc-union/light-clients/tendermint", default-features = false }
ethermint-light-client-types = { path = "lib/ethermint-light-client-types", default-features = false }
tendermint-light-client = { path = "cosmwasm/ibc-union/lightclient/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 All @@ -242,6 +261,11 @@ ibc-union = { path = "cosmwasm/ibc-union/core", default-features =
ibc-union-light-client = { path = "cosmwasm/ibc-union/core/light-client-interface", default-features = false }
ibc-union-msg = { path = "cosmwasm/ibc-union/core/msg", default-features = false }

unionlabs-cosmwasm-upgradable = { path = "lib/unionlabs-cosmwasm-upgradable", default-features = false }

ucs03-zkgm = { path = "cosmwasm/ibc-union/app/ucs03-zkgm", default-features = false }
ucs03-zkgm-token-minter-api = { path = "cosmwasm/ucs03-zkgm-token-minter-api", default-features = false }

gnark-key-parser = { path = "lib/gnark-key-parser", default-features = false }
gnark-mimc = { path = "lib/gnark-mimc", default-features = false }
ics23 = { path = "lib/ics23", default-features = false }
Expand Down Expand Up @@ -282,9 +306,9 @@ voyager-vm = { path = "lib/voyager-vm", default-features = false }
milagro_bls = { git = "https://github.com/Snowfork/milagro_bls", rev = "bc2b5b5e8d48b7e2e1bfaa56dc2d93e13cb32095", default-features = false }
tendermint-rpc = { git = "https://github.com/unionlabs/tendermint-rs", branch = "v0.39.1-bn254", default-features = false }

alloy = { version = "0.6", default-features = false }
alloy-primitives = { version = "0.8.16", default-features = false }
alloy-sol-types = { version = "0.8.12", default-features = true }
alloy = { version = "0.11.1", default-features = false }
alloy-primitives = { version = "0.8.21", default-features = false }
alloy-sol-types = { version = "0.8.21", default-features = true }

# https://github.com/aptos-labs/aptos-core/pull/12636
aptos-crypto = { git = "https://github.com/unionlabs/aptos-core" }
Expand Down Expand Up @@ -342,6 +366,8 @@ tracing = { version = "0.1.40", default-features = false }
tracing-subscriber = { version = "0.3", default-features = false, features = ["fmt", "ansi"] }
typenum = { version = "1.17.0", default-features = false }

cw-orch = "0.27.0"

[patch."crates-io"]
arbitrary = { git = "https://github.com/unionlabs/arbitrary" }
# parity-secp256k1 = { git = "https://github.com/paritytech/rust-secp256k1" }
Expand Down
23 changes: 23 additions & 0 deletions app/patches/@cosmjs+amino+0.33.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
diff --git a/node_modules/@cosmjs/amino/build/pubkeys.js b/node_modules/@cosmjs/amino/build/pubkeys.js
index e9844ef..86101f8 100644
--- a/node_modules/@cosmjs/amino/build/pubkeys.js
+++ b/node_modules/@cosmjs/amino/build/pubkeys.js
@@ -9,6 +9,10 @@ function isSecp256k1Pubkey(pubkey) {
return pubkey.type === "tendermint/PubKeySecp256k1";
}
exports.isSecp256k1Pubkey = isSecp256k1Pubkey;
+function isBn254Pubkey(pubkey) {
+ return pubkey.type === "tendermint/PubKeyBn254";
+}
+exports.isBn254Pubkey = isBn254Pubkey;
exports.pubkeyType = {
/** @see https://github.com/tendermint/tendermint/blob/v0.33.0/crypto/ed25519/ed25519.go#L22 */
secp256k1: "tendermint/PubKeySecp256k1",
@@ -16,6 +20,7 @@ exports.pubkeyType = {
ed25519: "tendermint/PubKeyEd25519",
/** @see https://github.com/tendermint/tendermint/blob/v0.33.0/crypto/sr25519/codec.go#L12 */
sr25519: "tendermint/PubKeySr25519",
+ bn254: "tendermint/PubKeyBn254",
multisigThreshold: "tendermint/PubKeyMultisigThreshold",
};
function isSinglePubkey(pubkey) {
73 changes: 73 additions & 0 deletions app/patches/@cosmjs+tendermint-rpc+0.33.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
diff --git a/node_modules/@cosmjs/tendermint-rpc/build/comet38/adaptor/responses.js b/node_modules/@cosmjs/tendermint-rpc/build/comet38/adaptor/responses.js
index 29ec063..28a5c02 100644
--- a/node_modules/@cosmjs/tendermint-rpc/build/comet38/adaptor/responses.js
+++ b/node_modules/@cosmjs/tendermint-rpc/build/comet38/adaptor/responses.js
@@ -72,7 +72,7 @@ function decodePubkey(data) {
if ("Sum" in data) {
// we don't need to check type because we're checking algorithm
const [[algorithm, value]] = Object.entries(data.Sum.value);
- (0, utils_1.assert)(algorithm === "ed25519" || algorithm === "secp256k1", `unknown pubkey type: ${algorithm}`);
+ (0, utils_1.assert)(algorithm === "ed25519" || algorithm === "secp256k1" || algorithm === "bn254", `unknown pubkey type: ${algorithm}`);
return {
algorithm,
data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(value)),
@@ -91,6 +91,16 @@ function decodePubkey(data) {
algorithm: "secp256k1",
data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)),
};
+ case "tendermint/PubKeyBn254":
+ return {
+ algorithm: "bn254",
+ data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)),
+ };
+ case "cometbft/PubKeyBn254":
+ return {
+ algorithm: "bn254",
+ data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)),
+ };
default:
throw new Error(`unknown pubkey type: ${data.type}`);
}
diff --git a/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/adaptor/responses.js b/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/adaptor/responses.js
index 19df9de..0015044 100644
--- a/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/adaptor/responses.js
+++ b/node_modules/@cosmjs/tendermint-rpc/build/tendermint37/adaptor/responses.js
@@ -72,7 +72,7 @@ function decodePubkey(data) {
if ("Sum" in data) {
// we don't need to check type because we're checking algorithm
const [[algorithm, value]] = Object.entries(data.Sum.value);
- (0, utils_1.assert)(algorithm === "ed25519" || algorithm === "secp256k1", `unknown pubkey type: ${algorithm}`);
+ (0, utils_1.assert)(algorithm === "ed25519" || algorithm === "secp256k1" || algorithm === "bn254", `unknown pubkey type: ${algorithm}`);
return {
algorithm,
data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(value)),
@@ -91,6 +91,16 @@ function decodePubkey(data) {
algorithm: "secp256k1",
data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)),
};
+ case "tendermint/PubKeyBn254":
+ return {
+ algorithm: "bn254",
+ data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)),
+ };
+ case "cometbft/PubKeyBn254":
+ return {
+ algorithm: "bn254",
+ data: (0, encoding_1.fromBase64)((0, encodings_1.assertNotEmpty)(data.value)),
+ };
default:
throw new Error(`unknown pubkey type: ${data.type}`);
}
diff --git a/node_modules/@cosmjs/tendermint-rpc/build/tendermintclient.js b/node_modules/@cosmjs/tendermint-rpc/build/tendermintclient.js
index 257b104..dbf2240 100644
--- a/node_modules/@cosmjs/tendermint-rpc/build/tendermintclient.js
+++ b/node_modules/@cosmjs/tendermint-rpc/build/tendermintclient.js
@@ -28,7 +28,7 @@ async function connectComet(endpoint) {
if (version.startsWith("0.37.")) {
out = tm37Client;
}
- else if (version.startsWith("0.38.")) {
+ else if (version.startsWith("0.38.") || version.startsWith("1.0.")) {
tm37Client.disconnect();
out = await comet38_1.Comet38Client.connect(endpoint);
}
32 changes: 32 additions & 0 deletions app/src/lib/chain-details.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<script lang="ts">
import * as Tooltip from "$lib/components/ui/tooltip"
import type { Chain } from "$lib/types.ts"
// TODO: rename this component
import TokenQualityLevel from "./components/token-quality-level.svelte"
import { highlightItem } from "$lib/stores/highlight"
import { cn } from "$lib/utilities/shadcn"
// you can either pass in Chain or chains = chainId
export let chains: Array<Chain> | null = null
export let chainId: string | null = null
export let chain: Chain | null = null
export let highlightEnabled = true
$: ch = chain ? chain : chains?.find(c => c.chain_id === chainId)
$: chain_id = chain?.chain_id ? chain.chain_id : chainId
</script>

<!-- svelte-ignore a11y-interactive-supports-focus -->
<!-- svelte-ignore a11y-no-static-element-interactions -->
<span class="inline-flex items-center"
on:mouseleave={() => highlightItem.set(null)}
on:mouseenter={() => {
highlightItem.set(chain_id ? { kind: "chain", chainId: chain_id} : null)
}}
>
{#if !ch}
Invalid chain: {#if chain_id}{chain_id}{/if}
{:else}
<div class={cn(highlightEnabled && $highlightItem?.kind === "chain" && $highlightItem.chainId === chain_id ? "bg-union-accent-300 dark:bg-union-accent-950" : "", "text-nowrap")}>{ch.display_name}</div>
{#if ch.relayer_status.status !== "HEALTHY"}<Tooltip.Root><Tooltip.Trigger><TokenQualityLevel level={ch.relayer_status.status === "WARNING" ? "ONCHAIN" : "NONE"}/></Tooltip.Trigger><Tooltip.Content>{ch.relayer_status.message}</Tooltip.Content></Tooltip.Root>{/if}
{/if}
</span>
Loading

0 comments on commit a6ce83b

Please sign in to comment.