From 1ac8437877250f5c3c0a6020ecdb5c46bbe6a9ca Mon Sep 17 00:00:00 2001 From: Danil Nemirovsky Date: Thu, 9 Jan 2025 18:28:23 +0000 Subject: [PATCH] fix: Fix certificate issue for Cosmos chains (#5114) ### Description Obsolete version of cosmrs (0.14.0) complains about valid TLS certificates. It makes agents to fail to communicate to Cosmos chains via RPC. cosmrs 0.16.0 fixes the issue. Some other dependencies also were upgraded. ### Related issues - Fixes https://github.com/hyperlane-xyz/hyperlane-monorepo/issues/5113 ### Backward compatibility Yes ### Testing E2E Cosmos tests and E2E Ethereum and Sealevel tests --------- Co-authored-by: Danil Nemirovsky <4614623+ameten@users.noreply.github.com> --- rust/main/Cargo.lock | 708 +++++++++++------- rust/main/Cargo.toml | 27 +- rust/main/chains/hyperlane-cosmos/Cargo.toml | 2 +- .../hyperlane-cosmos/src/interchain_gas.rs | 143 ++-- .../src/mailbox/delivery_indexer.rs | 58 +- .../src/mailbox/dispatch_indexer.rs | 68 +- .../hyperlane-cosmos/src/merkle_tree_hook.rs | 107 +-- .../hyperlane-cosmos/src/payloads/general.rs | 8 +- .../src/providers/cosmos/provider.rs | 8 +- .../hyperlane-cosmos/src/providers/grpc.rs | 13 +- 10 files changed, 660 insertions(+), 482 deletions(-) diff --git a/rust/main/Cargo.lock b/rust/main/Cargo.lock index 9045c44d15..078b19fac9 100644 --- a/rust/main/Cargo.lock +++ b/rust/main/Cargo.lock @@ -464,6 +464,12 @@ dependencies = [ "critical-section", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "atty" version = "0.2.14" @@ -511,13 +517,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", - "axum-core", + "axum-core 0.3.4", "bitflags 1.3.2", "bytes", "futures-util", "http 0.2.12", - "http-body", - "hyper", + "http-body 0.4.6", + "hyper 0.14.30", "itoa", "matchit", "memchr", @@ -529,9 +535,36 @@ dependencies = [ "serde_json", "serde_path_to_error", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "tokio", - "tower", + "tower 0.4.13", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" +dependencies = [ + "async-trait", + "axum-core 0.4.5", + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper 1.0.2", + "tower 0.5.2", "tower-layer", "tower-service", ] @@ -546,13 +579,33 @@ dependencies = [ "bytes", "futures-util", "http 0.2.12", - "http-body", + "http-body 0.4.6", "mime", "rustversion", "tower-layer", "tower-service", ] +[[package]] +name = "axum-core" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "mime", + "pin-project-lite", + "rustversion", + "sync_wrapper 1.0.2", + "tower-layer", + "tower-service", +] + [[package]] name = "backtrace" version = "0.3.71" @@ -1391,7 +1444,7 @@ dependencies = [ "rust-ini", "serde", "serde_json", - "toml", + "toml 0.5.11", "yaml-rust", ] @@ -1536,6 +1589,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1544,30 +1607,30 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cosmos-sdk-proto" -version = "0.19.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73c9d2043a9e617b0d602fbc0a0ecd621568edbf3a9774890a6d562389bd8e1c" +checksum = "8b2f63ab112b8c8e7b8a29c891adc48f43145beb21c0bfbf562957072c1e0beb" dependencies = [ - "prost 0.11.9", - "prost-types 0.11.9", - "tendermint-proto 0.32.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tonic 0.9.2", + "prost 0.13.4", + "prost-types 0.13.4", + "tendermint-proto", + "tonic 0.12.3", ] [[package]] name = "cosmrs" -version = "0.14.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af13955d6f356272e6def9ff5e2450a7650df536d8934f47052a20c76513d2f6" +checksum = "9f21bb63ec6a903510a3d01f44735dd4914724e5eccbe409e6da6833d17c7829" dependencies = [ "cosmos-sdk-proto", "ecdsa 0.16.9", "eyre", - "getrandom 0.2.15", "k256 0.13.4", "rand_core 0.6.4", "serde", "serde_json", + "signature 2.2.0", "subtle-encoding", "tendermint", "tendermint-rpc", @@ -1855,23 +1918,14 @@ dependencies = [ [[package]] name = "crypto-mac" -version = "0.11.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" dependencies = [ "generic-array 0.14.7", "subtle", ] -[[package]] -name = "ct-logs" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" -dependencies = [ - "sct 0.6.1", -] - [[package]] name = "ctr" version = "0.9.2" @@ -2960,7 +3014,7 @@ dependencies = [ "serde", "serde_json", "syn 1.0.109", - "toml", + "toml 0.5.11", "url", "walkdir", ] @@ -3150,9 +3204,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c80c6714d1a380314fcb11a22eeff022e1e1c9642f0bb54e15dc9cb29f37b29" dependencies = [ "futures", - "hyper", - "hyper-rustls 0.24.2", - "hyper-timeout", + "hyper 0.14.30", + "hyper-rustls", + "hyper-timeout 0.4.1", "log", "pin-project", "rand 0.8.5", @@ -3388,7 +3442,7 @@ dependencies = [ "fuel-core-types", "futures", "hex 0.4.3", - "hyper-rustls 0.24.2", + "hyper-rustls", "itertools 0.12.1", "reqwest", "schemafy_lib", @@ -3999,6 +4053,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.2.0", + "indexmap 2.5.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "hash32" version = "0.2.1" @@ -4207,7 +4280,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", "digest 0.9.0", ] @@ -4253,9 +4326,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -4273,6 +4346,29 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.2.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "pin-project-lite", +] + [[package]] name = "httparse" version = "1.9.4" @@ -4311,9 +4407,9 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", - "http-body", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -4326,40 +4422,24 @@ dependencies = [ ] [[package]] -name = "hyper-proxy" -version = "0.9.1" +name = "hyper" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca815a891b24fdfb243fa3239c86154392b0953ee584aa1a2a1f66d20cbe75cc" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", - "futures", - "headers", - "http 0.2.12", - "hyper", - "hyper-rustls 0.22.1", - "rustls-native-certs 0.5.0", - "tokio", - "tokio-rustls 0.22.0", - "tower-service", - "webpki 0.21.4", -] - -[[package]] -name = "hyper-rustls" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" -dependencies = [ - "ct-logs", + "futures-channel", "futures-util", - "hyper", - "log", - "rustls 0.19.1", - "rustls-native-certs 0.5.0", + "h2 0.4.7", + "http 1.2.0", + "http-body 1.0.1", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", "tokio", - "tokio-rustls 0.22.0", - "webpki 0.21.4", - "webpki-roots 0.21.1", + "want", ] [[package]] @@ -4370,7 +4450,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper", + "hyper 0.14.30", "log", "rustls 0.21.12", "rustls-native-certs 0.6.3", @@ -4385,12 +4465,25 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper", + "hyper 0.14.30", "pin-project-lite", "tokio", "tokio-io-timeout", ] +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper 1.5.2", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -4398,19 +4491,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper", + "hyper 0.14.30", "native-tls", "tokio", "tokio-native-tls", ] +[[package]] +name = "hyper-util" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.2.0", + "http-body 1.0.1", + "hyper 1.5.2", + "pin-project-lite", + "socket2 0.5.7", + "tokio", + "tower-service", + "tracing", +] + [[package]] name = "hyperlane-base" version = "0.1.0" dependencies = [ "anyhow", "async-trait", - "axum", + "axum 0.6.20", "backtrace", "backtrace-oneline", "bs58 0.5.1", @@ -4518,8 +4630,8 @@ dependencies = [ "derive-new", "futures", "hex 0.4.3", - "http 0.2.12", - "hyper", + "http 1.2.0", + "hyper 0.14.30", "hyper-tls", "hyperlane-core", "hyperlane-cosmwasm-interface", @@ -4538,7 +4650,7 @@ dependencies = [ "thiserror", "time", "tokio", - "tonic 0.9.2", + "tonic 0.12.3", "tracing", "tracing-futures", "url", @@ -4976,20 +5088,31 @@ dependencies = [ [[package]] name = "injective-std" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7a5b52d19dca05823c7e4b481d41b49c04a0e56f66a5c92396a6fdd3314710" +version = "1.13.2-hyperlane-2025-01-09-11-28" +source = "git+https://github.com/hyperlane-xyz/cw-injective.git?tag=1.13.2-hyperlane-2025-01-09-11-28#d3e5bf33f8374026e696749dd54b041a69887cbd" dependencies = [ "chrono", - "cosmwasm-std 1.5.7", - "osmosis-std-derive", - "prost 0.11.9", - "prost-types 0.11.9", + "cosmwasm-std 2.1.3", + "injective-std-derive", + "prost 0.13.4", + "prost-types 0.13.4", "schemars", "serde", "serde-cw-value", ] +[[package]] +name = "injective-std-derive" +version = "1.13.0" +source = "git+https://github.com/hyperlane-xyz/cw-injective.git?tag=1.13.2-hyperlane-2025-01-09-11-28#d3e5bf33f8374026e696749dd54b041a69887cbd" +dependencies = [ + "cosmwasm-std 2.1.3", + "itertools 0.10.5", + "proc-macro2 1.0.86", + "quote 1.0.37", + "syn 1.0.109", +] + [[package]] name = "inout" version = "0.1.3" @@ -5528,7 +5651,7 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] @@ -5954,18 +6077,6 @@ version = "6.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" -[[package]] -name = "osmosis-std-derive" -version = "0.15.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4d482a16be198ee04e0f94e10dd9b8d02332dcf33bc5ea4b255e7e25eedc5df" -dependencies = [ - "itertools 0.10.5", - "proc-macro2 1.0.86", - "quote 1.0.37", - "syn 1.0.109", -] - [[package]] name = "ouroboros" version = "0.15.6" @@ -6149,9 +6260,9 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" [[package]] name = "peg" -version = "0.7.0" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07c0b841ea54f523f7aa556956fbd293bcbe06f2e67d2eb732b7278aaf1d166a" +checksum = "295283b02df346d1ef66052a757869b2876ac29a6bb0ac3f5f7cd44aebe40e8f" dependencies = [ "peg-macros", "peg-runtime", @@ -6159,9 +6270,9 @@ dependencies = [ [[package]] name = "peg-macros" -version = "0.7.0" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aa52829b8decbef693af90202711348ab001456803ba2a98eb4ec8fb70844c" +checksum = "bdad6a1d9cf116a059582ce415d5f5566aabcd4008646779dab7fdc2a9a9d426" dependencies = [ "peg-runtime", "proc-macro2 1.0.86", @@ -6170,9 +6281,9 @@ dependencies = [ [[package]] name = "peg-runtime" -version = "0.7.0" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c719dcf55f09a3a7e764c6649ab594c18a177e3599c467983cdf644bfc0a4088" +checksum = "e3aeb8f54c078314c2065ee649a7241f46b9d8e418e1a9581ba0546657d7aa3a" [[package]] name = "pem" @@ -6439,7 +6550,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ - "toml", + "toml 0.5.11", ] [[package]] @@ -6450,7 +6561,7 @@ checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ "once_cell", "thiserror", - "toml", + "toml 0.5.11", ] [[package]] @@ -6544,42 +6655,42 @@ dependencies = [ [[package]] name = "prost" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.11.9", + "prost-derive 0.12.6", ] [[package]] name = "prost" -version = "0.12.6" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" +checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec" dependencies = [ "bytes", - "prost-derive 0.12.6", + "prost-derive 0.13.4", ] [[package]] name = "prost-derive" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.10.5", + "itertools 0.12.1", "proc-macro2 1.0.86", "quote 1.0.37", - "syn 1.0.109", + "syn 2.0.77", ] [[package]] name = "prost-derive" -version = "0.12.6" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" +checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" dependencies = [ "anyhow", "itertools 0.12.1", @@ -6590,20 +6701,20 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.11.9" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" dependencies = [ - "prost 0.11.9", + "prost 0.12.6", ] [[package]] name = "prost-types" -version = "0.12.6" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +checksum = "cc2f1e56baa61e93533aebc21af4d2134b70f66275e0fcdf3cbe43d77ff7e8fc" dependencies = [ - "prost 0.12.6", + "prost 0.13.4", ] [[package]] @@ -6695,7 +6806,7 @@ dependencies = [ "thiserror", "tokio", "tracing", - "webpki 0.22.4", + "webpki", ] [[package]] @@ -6715,7 +6826,7 @@ dependencies = [ "thiserror", "tinyvec", "tracing", - "webpki 0.22.4", + "webpki", ] [[package]] @@ -6980,7 +7091,7 @@ name = "relayer" version = "0.1.0" dependencies = [ "async-trait", - "axum", + "axum 0.6.20", "config", "console-subscriber", "convert_case 0.6.0", @@ -7041,11 +7152,11 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", - "http-body", - "hyper", - "hyper-rustls 0.24.2", + "http-body 0.4.6", + "hyper 0.14.30", + "hyper-rustls", "hyper-tls", "ipnet", "js-sys", @@ -7056,11 +7167,12 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls 0.21.12", + "rustls-native-certs 0.6.3", "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", + "sync_wrapper 0.1.2", "system-configuration", "tokio", "tokio-native-tls", @@ -7274,7 +7386,7 @@ dependencies = [ "crc32fast", "futures", "http 0.2.12", - "hyper", + "hyper 0.14.30", "hyper-tls", "lazy_static", "log", @@ -7297,7 +7409,7 @@ dependencies = [ "chrono", "dirs-next", "futures", - "hyper", + "hyper 0.14.30", "serde", "serde_json", "shlex", @@ -7346,7 +7458,7 @@ dependencies = [ "hex 0.4.3", "hmac 0.11.0", "http 0.2.12", - "hyper", + "hyper 0.14.30", "log", "md-5 0.9.1", "percent-encoding", @@ -7450,63 +7562,65 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.1" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ - "base64 0.13.1", "log", "ring 0.16.20", - "sct 0.6.1", - "webpki 0.21.4", + "sct", + "webpki", ] [[package]] name = "rustls" -version = "0.20.9" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", - "ring 0.16.20", - "sct 0.7.1", - "webpki 0.22.4", + "ring 0.17.8", + "rustls-webpki 0.101.7", + "sct", ] [[package]] name = "rustls" -version = "0.21.12" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "log", + "once_cell", "ring 0.17.8", - "rustls-webpki", - "sct 0.7.1", + "rustls-pki-types", + "rustls-webpki 0.102.8", + "subtle", + "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.5.0" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls 0.19.1", + "rustls-pemfile 1.0.4", "schannel", - "security-framework", + "security-framework 2.11.1", ] [[package]] name = "rustls-native-certs" -version = "0.6.3" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.4", + "rustls-pki-types", "schannel", - "security-framework", + "security-framework 3.2.0", ] [[package]] @@ -7527,6 +7641,21 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -7537,6 +7666,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.17" @@ -7704,16 +7844,6 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - [[package]] name = "sct" version = "0.7.1" @@ -7956,7 +8086,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.6.0", - "core-foundation", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.10.0", "core-foundation-sys", "libc", "security-framework-sys", @@ -7964,9 +8107,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -8097,6 +8240,15 @@ dependencies = [ "syn 2.0.77", ] +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -9273,9 +9425,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.4.1" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subtle-encoding" @@ -9343,6 +9495,12 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + [[package]] name = "synstructure" version = "0.12.6" @@ -9373,7 +9531,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -9435,8 +9593,9 @@ dependencies = [ [[package]] name = "tendermint" -version = "0.32.2" -source = "git+https://github.com/hyperlane-xyz/tendermint-rs.git?branch=trevor/0.32.2-fork#feea28d47e73bf7678e1e5cdced0f5ca51b69286" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "505d9d6ffeb83b1de47c307c6e0d2dff56c6256989299010ad03cd80a8491e97" dependencies = [ "bytes", "digest 0.10.7", @@ -9447,8 +9606,8 @@ dependencies = [ "k256 0.13.4", "num-traits", "once_cell", - "prost 0.11.9", - "prost-types 0.11.9", + "prost 0.13.4", + "prost-types 0.13.4", "ripemd", "serde", "serde_bytes", @@ -9458,53 +9617,35 @@ dependencies = [ "signature 2.2.0", "subtle", "subtle-encoding", - "tendermint-proto 0.32.2 (git+https://github.com/hyperlane-xyz/tendermint-rs.git?branch=trevor/0.32.2-fork)", + "tendermint-proto", "time", "zeroize", ] [[package]] name = "tendermint-config" -version = "0.32.2" -source = "git+https://github.com/hyperlane-xyz/tendermint-rs.git?branch=trevor/0.32.2-fork#feea28d47e73bf7678e1e5cdced0f5ca51b69286" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9de111ea653b2adaef627ac2452b463c77aa615c256eaaddf279ec5a1cf9775f" dependencies = [ "flex-error", "serde", "serde_json", "tendermint", - "toml", + "toml 0.8.19", "url", ] [[package]] name = "tendermint-proto" -version = "0.32.2" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0cec054567d16d85e8c3f6a3139963d1a66d9d3051ed545d31562550e9bcc3d" +checksum = "8ed14abe3b0502a3afe21ca74ca5cdd6c7e8d326d982c26f98a394445eb31d6e" dependencies = [ "bytes", "flex-error", - "num-derive 0.3.3", - "num-traits", - "prost 0.11.9", - "prost-types 0.11.9", - "serde", - "serde_bytes", - "subtle-encoding", - "time", -] - -[[package]] -name = "tendermint-proto" -version = "0.32.2" -source = "git+https://github.com/hyperlane-xyz/tendermint-rs.git?branch=trevor/0.32.2-fork#feea28d47e73bf7678e1e5cdced0f5ca51b69286" -dependencies = [ - "bytes", - "flex-error", - "num-derive 0.3.3", - "num-traits", - "prost 0.11.9", - "prost-types 0.11.9", + "prost 0.13.4", + "prost-types 0.13.4", "serde", "serde_bytes", "subtle-encoding", @@ -9513,20 +9654,19 @@ dependencies = [ [[package]] name = "tendermint-rpc" -version = "0.32.2" -source = "git+https://github.com/hyperlane-xyz/tendermint-rs.git?branch=trevor/0.32.2-fork#feea28d47e73bf7678e1e5cdced0f5ca51b69286" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02f96a2b8a0d3d0b59e4024b1a6bdc1589efc6af4709d08a480a20cc4ba90f63" dependencies = [ "async-trait", "bytes", "flex-error", "futures", "getrandom 0.2.15", - "http 0.2.12", - "hyper", - "hyper-proxy", - "hyper-rustls 0.22.1", "peg", "pin-project", + "rand 0.8.5", + "reqwest", "semver", "serde", "serde_bytes", @@ -9535,13 +9675,13 @@ dependencies = [ "subtle-encoding", "tendermint", "tendermint-config", - "tendermint-proto 0.32.2 (git+https://github.com/hyperlane-xyz/tendermint-rs.git?branch=trevor/0.32.2-fork)", + "tendermint-proto", "thiserror", "time", "tokio", "tracing", "url", - "uuid 0.8.2", + "uuid 1.10.0", "walkdir", ] @@ -9698,9 +9838,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -9759,41 +9899,40 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.22.0" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls 0.19.1", + "rustls 0.20.9", "tokio", - "webpki 0.21.4", + "webpki", ] [[package]] name = "tokio-rustls" -version = "0.23.4" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.20.9", + "rustls 0.21.12", "tokio", - "webpki 0.22.4", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.21.12", + "rustls 0.23.20", "tokio", ] [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -9825,7 +9964,7 @@ dependencies = [ "tokio", "tokio-rustls 0.23.4", "tungstenite 0.17.3", - "webpki 0.22.4", + "webpki", "webpki-roots 0.22.6", ] @@ -9863,11 +10002,26 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.22.20", +] + [[package]] name = "toml_datetime" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" @@ -9887,37 +10041,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ "indexmap 2.5.0", + "serde", + "serde_spanned", "toml_datetime", "winnow 0.6.18", ] [[package]] name = "tonic" -version = "0.9.2" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3082666a3a6433f7f511c7192923fa1fe07c69332d3c6a2e6bb040b569199d5a" +checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" dependencies = [ "async-stream", "async-trait", - "axum", + "axum 0.6.20", "base64 0.21.7", "bytes", - "futures-core", - "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", - "http-body", - "hyper", - "hyper-timeout", + "http-body 0.4.6", + "hyper 0.14.30", + "hyper-timeout 0.4.1", "percent-encoding", "pin-project", - "prost 0.11.9", + "prost 0.12.6", + "rustls 0.21.12", "rustls-native-certs 0.6.3", "rustls-pemfile 1.0.4", "tokio", "tokio-rustls 0.24.1", "tokio-stream", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -9925,30 +10080,32 @@ dependencies = [ [[package]] name = "tonic" -version = "0.10.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" dependencies = [ "async-stream", "async-trait", - "axum", - "base64 0.21.7", + "axum 0.7.9", + "base64 0.22.1", "bytes", - "h2", - "http 0.2.12", - "http-body", - "hyper", - "hyper-timeout", + "h2 0.4.7", + "http 1.2.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.5.2", + "hyper-timeout 0.5.2", + "hyper-util", "percent-encoding", "pin-project", - "prost 0.12.6", - "rustls 0.21.12", - "rustls-native-certs 0.6.3", - "rustls-pemfile 1.0.4", + "prost 0.13.4", + "rustls-native-certs 0.8.1", + "rustls-pemfile 2.2.0", + "socket2 0.5.7", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls 0.26.1", "tokio-stream", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -9974,6 +10131,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 1.0.2", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -10126,7 +10297,7 @@ dependencies = [ "thiserror", "url", "utf-8", - "webpki 0.22.4", + "webpki", "webpki-roots 0.22.6", ] @@ -10139,7 +10310,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.1.0", + "http 1.2.0", "httparse", "log", "rand 0.8.5", @@ -10375,7 +10546,7 @@ name = "validator" version = "0.1.0" dependencies = [ "async-trait", - "axum", + "axum 0.6.20", "chrono", "config", "console-subscriber", @@ -10475,7 +10646,7 @@ dependencies = [ "futures-util", "headers", "http 0.2.12", - "hyper", + "hyper 0.14.30", "log", "mime", "mime_guess", @@ -10603,16 +10774,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - [[package]] name = "webpki" version = "0.22.4" @@ -10623,22 +10784,13 @@ dependencies = [ "untrusted 0.9.0", ] -[[package]] -name = "webpki-roots" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" -dependencies = [ - "webpki 0.21.4", -] - [[package]] name = "webpki-roots" version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.4", + "webpki", ] [[package]] @@ -10966,8 +11118,8 @@ dependencies = [ "futures", "http 0.2.12", "humantime-serde", - "hyper", - "hyper-rustls 0.24.2", + "hyper 0.14.30", + "hyper-rustls", "paste", "rand 0.8.5", "rustls 0.21.12", @@ -10977,7 +11129,7 @@ dependencies = [ "thiserror", "tokio", "tonic 0.10.2", - "tower", + "tower 0.4.13", "tracing", "yup-oauth2", ] @@ -11011,8 +11163,8 @@ dependencies = [ "base64 0.13.1", "futures", "http 0.2.12", - "hyper", - "hyper-rustls 0.24.2", + "hyper 0.14.30", + "hyper-rustls", "itertools 0.10.5", "log", "percent-encoding", diff --git a/rust/main/Cargo.toml b/rust/main/Cargo.toml index 8d52325017..db0ddd70ec 100644 --- a/rust/main/Cargo.toml +++ b/rust/main/Cargo.toml @@ -46,7 +46,7 @@ color-eyre = "0.6" config = "0.13.3" console-subscriber = "0.2.0" convert_case = "0.6" -cosmrs = { version = "0.14", default-features = false, features = [ +cosmrs = { version = "0.18.0", default-features = false, features = [ "cosmwasm", "rpc", "tokio", @@ -73,12 +73,12 @@ bech32 = "0.9.1" elliptic-curve = "0.13.8" getrandom = { version = "0.2", features = ["js"] } hex = "0.4.3" -http = "0.2.12" +http = "1.2.0" hyper = "0.14" hyper-tls = "0.5.0" hyperlane-cosmwasm-interface = "=0.0.6-rc6" injective-protobuf = "0.2.2" -injective-std = "=0.1.5" +injective-std = "1.13.2-hyperlane-2025-01-09-11-28" itertools = "*" jobserver = "=0.1.26" jsonrpc-core = "18.0" @@ -134,16 +134,16 @@ static_assertions = "1.1" strum = "0.26.2" strum_macros = "0.26.2" tempfile = "3.3" -tendermint = "0.32.2" -tendermint-rpc = { version = "0.32.0", features = ["http-client", "tokio"] } +tendermint = "0.38.1" +tendermint-rpc = { version = "0.38.1", features = ["http-client", "tokio"] } thiserror = "1.0" time = "0.3" tiny-keccak = "2.0.2" -tokio = { version = "1.4", features = ["parking_lot", "tracing"] } +tokio = { version = "1.42.0", features = ["parking_lot", "tracing"] } tokio-metrics = { version = "0.3.1", default-features = false } tokio-test = "0.4" toml_edit = "0.19.14" -tonic = "0.9.2" +tonic = "0.12.3" tracing = { version = "0.1" } tracing-error = "0.2" tracing-futures = "0.2" @@ -300,12 +300,7 @@ version = "=0.1.0" git = "https://github.com/hyperlane-xyz/solana-program-library.git" branch = "hyperlane" -[patch.crates-io.tendermint] -branch = "trevor/0.32.2-fork" -git = "https://github.com/hyperlane-xyz/tendermint-rs.git" -version = "=0.32.2" - -[patch.crates-io.tendermint-rpc] -branch = "trevor/0.32.2-fork" -git = "https://github.com/hyperlane-xyz/tendermint-rs.git" -version = "=0.32.2" +[patch.crates-io.injective-std] +version = "1.13.2-hyperlane-2025-01-09-11-28" +git = "https://github.com/hyperlane-xyz/cw-injective.git" +tag = "1.13.2-hyperlane-2025-01-09-11-28" diff --git a/rust/main/chains/hyperlane-cosmos/Cargo.toml b/rust/main/chains/hyperlane-cosmos/Cargo.toml index ce936ec1f4..ecfccbcb7d 100644 --- a/rust/main/chains/hyperlane-cosmos/Cargo.toml +++ b/rust/main/chains/hyperlane-cosmos/Cargo.toml @@ -42,7 +42,7 @@ tonic = { workspace = true, features = [ "transport", "tls", "tls-roots", - "tls-roots-common", + "tls-native-roots", ] } tracing = { workspace = true } tracing-futures = { workspace = true } diff --git a/rust/main/chains/hyperlane-cosmos/src/interchain_gas.rs b/rust/main/chains/hyperlane-cosmos/src/interchain_gas.rs index 1e1cb2b328..03b110e81e 100644 --- a/rust/main/chains/hyperlane-cosmos/src/interchain_gas.rs +++ b/rust/main/chains/hyperlane-cosmos/src/interchain_gas.rs @@ -122,76 +122,85 @@ impl CosmosInterchainGasPaymasterIndexer { let mut gas_payment = IncompleteInterchainGasPayment::default(); for attr in attrs { - let key = attr.key.as_str(); - let value = attr.value.as_str(); - - match key { - CONTRACT_ADDRESS_ATTRIBUTE_KEY => { - contract_address = Some(value.to_string()); - } - v if *CONTRACT_ADDRESS_ATTRIBUTE_KEY_BASE64 == v => { - contract_address = Some(String::from_utf8( - BASE64 - .decode(value) - .map_err(Into::::into)?, - )?); + match attr { + EventAttribute::V037(a) => { + let key = a.key.as_str(); + let value = a.value.as_str(); + + match key { + CONTRACT_ADDRESS_ATTRIBUTE_KEY => { + contract_address = Some(value.to_string()); + } + v if *CONTRACT_ADDRESS_ATTRIBUTE_KEY_BASE64 == v => { + contract_address = Some(String::from_utf8( + BASE64 + .decode(value) + .map_err(Into::::into)?, + )?); + } + + MESSAGE_ID_ATTRIBUTE_KEY => { + gas_payment.message_id = + Some(H256::from_slice(hex::decode(value)?.as_slice())); + } + v if *MESSAGE_ID_ATTRIBUTE_KEY_BASE64 == v => { + gas_payment.message_id = Some(H256::from_slice( + hex::decode(String::from_utf8( + BASE64 + .decode(value) + .map_err(Into::::into)?, + )?)? + .as_slice(), + )); + } + + PAYMENT_ATTRIBUTE_KEY => { + gas_payment.payment = Some(U256::from_dec_str(value)?); + } + v if *PAYMENT_ATTRIBUTE_KEY_BASE64 == v => { + let dec_str = String::from_utf8( + BASE64 + .decode(value) + .map_err(Into::::into)?, + )?; + // U256's from_str assumes a radix of 16, so we explicitly use from_dec_str. + gas_payment.payment = Some(U256::from_dec_str(dec_str.as_str())?); + } + + GAS_AMOUNT_ATTRIBUTE_KEY => { + gas_payment.gas_amount = Some(U256::from_dec_str(value)?); + } + v if *GAS_AMOUNT_ATTRIBUTE_KEY_BASE64 == v => { + let dec_str = String::from_utf8( + BASE64 + .decode(value) + .map_err(Into::::into)?, + )?; + // U256's from_str assumes a radix of 16, so we explicitly use from_dec_str. + gas_payment.gas_amount = Some(U256::from_dec_str(dec_str.as_str())?); + } + + DESTINATION_ATTRIBUTE_KEY => { + gas_payment.destination = Some(value.parse::()?); + } + v if *DESTINATION_ATTRIBUTE_KEY_BASE64 == v => { + gas_payment.destination = Some( + String::from_utf8( + BASE64 + .decode(value) + .map_err(Into::::into)?, + )? + .parse()?, + ); + } + + _ => {} + } } - MESSAGE_ID_ATTRIBUTE_KEY => { - gas_payment.message_id = Some(H256::from_slice(hex::decode(value)?.as_slice())); + EventAttribute::V034(a) => { + unimplemented!(); } - v if *MESSAGE_ID_ATTRIBUTE_KEY_BASE64 == v => { - gas_payment.message_id = Some(H256::from_slice( - hex::decode(String::from_utf8( - BASE64 - .decode(value) - .map_err(Into::::into)?, - )?)? - .as_slice(), - )); - } - - PAYMENT_ATTRIBUTE_KEY => { - gas_payment.payment = Some(U256::from_dec_str(value)?); - } - v if *PAYMENT_ATTRIBUTE_KEY_BASE64 == v => { - let dec_str = String::from_utf8( - BASE64 - .decode(value) - .map_err(Into::::into)?, - )?; - // U256's from_str assumes a radix of 16, so we explicitly use from_dec_str. - gas_payment.payment = Some(U256::from_dec_str(dec_str.as_str())?); - } - - GAS_AMOUNT_ATTRIBUTE_KEY => { - gas_payment.gas_amount = Some(U256::from_dec_str(value)?); - } - v if *GAS_AMOUNT_ATTRIBUTE_KEY_BASE64 == v => { - let dec_str = String::from_utf8( - BASE64 - .decode(value) - .map_err(Into::::into)?, - )?; - // U256's from_str assumes a radix of 16, so we explicitly use from_dec_str. - gas_payment.gas_amount = Some(U256::from_dec_str(dec_str.as_str())?); - } - - DESTINATION_ATTRIBUTE_KEY => { - gas_payment.destination = Some(value.parse::()?); - } - v if *DESTINATION_ATTRIBUTE_KEY_BASE64 == v => { - gas_payment.destination = Some( - String::from_utf8( - BASE64 - .decode(value) - .map_err(Into::::into)?, - )? - .parse()?, - ); - } - - _ => {} } } diff --git a/rust/main/chains/hyperlane-cosmos/src/mailbox/delivery_indexer.rs b/rust/main/chains/hyperlane-cosmos/src/mailbox/delivery_indexer.rs index ccc92df707..77ffbb85aa 100644 --- a/rust/main/chains/hyperlane-cosmos/src/mailbox/delivery_indexer.rs +++ b/rust/main/chains/hyperlane-cosmos/src/mailbox/delivery_indexer.rs @@ -60,34 +60,42 @@ impl CosmosMailboxDeliveryIndexer { let mut message_id: Option = None; for attr in attrs { - let key = attr.key.as_str(); - let value = attr.value.as_str(); - - match key { - CONTRACT_ADDRESS_ATTRIBUTE_KEY => { - contract_address = Some(value.to_string()); - } - v if *CONTRACT_ADDRESS_ATTRIBUTE_KEY_BASE64 == v => { - contract_address = Some(String::from_utf8( - BASE64 - .decode(value) - .map_err(Into::::into)?, - )?); + match attr { + EventAttribute::V037(a) => { + let key = a.key.as_str(); + let value = a.value.as_str(); + + match key { + CONTRACT_ADDRESS_ATTRIBUTE_KEY => { + contract_address = Some(value.to_string()); + } + v if *CONTRACT_ADDRESS_ATTRIBUTE_KEY_BASE64 == v => { + contract_address = Some(String::from_utf8( + BASE64 + .decode(value) + .map_err(Into::::into)?, + )?); + } + + MESSAGE_ID_ATTRIBUTE_KEY => { + message_id = Some(value.parse::()?); + } + v if *MESSAGE_ID_ATTRIBUTE_KEY_BASE64 == v => { + let hex = String::from_utf8( + BASE64 + .decode(value) + .map_err(Into::::into)?, + )?; + message_id = Some(hex.parse::()?); + } + + _ => {} + } } - MESSAGE_ID_ATTRIBUTE_KEY => { - message_id = Some(value.parse::()?); + EventAttribute::V034(a) => { + unimplemented!(); } - v if *MESSAGE_ID_ATTRIBUTE_KEY_BASE64 == v => { - let hex = String::from_utf8( - BASE64 - .decode(value) - .map_err(Into::::into)?, - )?; - message_id = Some(hex.parse::()?); - } - - _ => {} } } diff --git a/rust/main/chains/hyperlane-cosmos/src/mailbox/dispatch_indexer.rs b/rust/main/chains/hyperlane-cosmos/src/mailbox/dispatch_indexer.rs index 433ea661ed..75e1feeadf 100644 --- a/rust/main/chains/hyperlane-cosmos/src/mailbox/dispatch_indexer.rs +++ b/rust/main/chains/hyperlane-cosmos/src/mailbox/dispatch_indexer.rs @@ -63,39 +63,47 @@ impl CosmosMailboxDispatchIndexer { let mut message: Option = None; for attr in attrs { - let key = attr.key.as_str(); - let value = attr.value.as_str(); - - match key { - CONTRACT_ADDRESS_ATTRIBUTE_KEY => { - contract_address = Some(value.to_string()); - } - v if *CONTRACT_ADDRESS_ATTRIBUTE_KEY_BASE64 == v => { - contract_address = Some(String::from_utf8( - BASE64 - .decode(value) - .map_err(Into::::into)?, - )?); + match attr { + EventAttribute::V037(a) => { + let key = a.key.as_str(); + let value = a.value.as_str(); + + match key { + CONTRACT_ADDRESS_ATTRIBUTE_KEY => { + contract_address = Some(value.to_string()); + } + v if *CONTRACT_ADDRESS_ATTRIBUTE_KEY_BASE64 == v => { + contract_address = Some(String::from_utf8( + BASE64 + .decode(value) + .map_err(Into::::into)?, + )?); + } + + MESSAGE_ATTRIBUTE_KEY => { + // Intentionally using read_from to get a Result::Err if there's + // an issue with the message. + let mut reader = Cursor::new(hex::decode(value)?); + message = Some(HyperlaneMessage::read_from(&mut reader)?); + } + v if *MESSAGE_ATTRIBUTE_KEY_BASE64 == v => { + // Intentionally using read_from to get a Result::Err if there's + // an issue with the message. + let mut reader = Cursor::new(hex::decode(String::from_utf8( + BASE64 + .decode(value) + .map_err(Into::::into)?, + )?)?); + message = Some(HyperlaneMessage::read_from(&mut reader)?); + } + + _ => {} + } } - MESSAGE_ATTRIBUTE_KEY => { - // Intentionally using read_from to get a Result::Err if there's - // an issue with the message. - let mut reader = Cursor::new(hex::decode(value)?); - message = Some(HyperlaneMessage::read_from(&mut reader)?); + EventAttribute::V034(a) => { + unimplemented!(); } - v if *MESSAGE_ATTRIBUTE_KEY_BASE64 == v => { - // Intentionally using read_from to get a Result::Err if there's - // an issue with the message. - let mut reader = Cursor::new(hex::decode(String::from_utf8( - BASE64 - .decode(value) - .map_err(Into::::into)?, - )?)?); - message = Some(HyperlaneMessage::read_from(&mut reader)?); - } - - _ => {} } } diff --git a/rust/main/chains/hyperlane-cosmos/src/merkle_tree_hook.rs b/rust/main/chains/hyperlane-cosmos/src/merkle_tree_hook.rs index 9c03b824dc..85c2c7adcb 100644 --- a/rust/main/chains/hyperlane-cosmos/src/merkle_tree_hook.rs +++ b/rust/main/chains/hyperlane-cosmos/src/merkle_tree_hook.rs @@ -232,57 +232,66 @@ impl CosmosMerkleTreeHookIndexer { let mut insertion = IncompleteMerkleTreeInsertion::default(); for attr in attrs { - let key = attr.key.as_str(); - let value = attr.value.as_str(); - - match key { - CONTRACT_ADDRESS_ATTRIBUTE_KEY => { - contract_address = Some(value.to_string()); - debug!(?contract_address, "parsed contract address from plain text"); - } - v if *CONTRACT_ADDRESS_ATTRIBUTE_KEY_BASE64 == v => { - contract_address = Some(String::from_utf8( - BASE64 - .decode(value) - .map_err(Into::::into)?, - )?); - debug!(?contract_address, "parsed contract address from base64"); - } - - MESSAGE_ID_ATTRIBUTE_KEY => { - insertion.message_id = Some(H256::from_slice(hex::decode(value)?.as_slice())); - debug!(message_id = ?insertion.message_id, "parsed message_id from plain text"); - } - v if *MESSAGE_ID_ATTRIBUTE_KEY_BASE64 == v => { - insertion.message_id = Some(H256::from_slice( - hex::decode(String::from_utf8( - BASE64 - .decode(value) - .map_err(Into::::into)?, - )?)? - .as_slice(), - )); - debug!(message_id = ?insertion.message_id, "parsed message_id from base64"); - } - - INDEX_ATTRIBUTE_KEY => { - insertion.leaf_index = Some(value.parse::()?); - debug!(leaf_index = ?insertion.leaf_index, "parsed leaf_index from plain text"); - } - v if *INDEX_ATTRIBUTE_KEY_BASE64 == v => { - insertion.leaf_index = Some( - String::from_utf8( - BASE64 - .decode(value) - .map_err(Into::::into)?, - )? - .parse()?, - ); - debug!(leaf_index = ?insertion.leaf_index, "parsed leaf_index from base64"); + match attr { + EventAttribute::V037(a) => { + let key = a.key.as_str(); + let value = a.value.as_str(); + + match key { + CONTRACT_ADDRESS_ATTRIBUTE_KEY => { + contract_address = Some(value.to_string()); + debug!(?contract_address, "parsed contract address from plain text"); + } + v if *CONTRACT_ADDRESS_ATTRIBUTE_KEY_BASE64 == v => { + contract_address = Some(String::from_utf8( + BASE64 + .decode(value) + .map_err(Into::::into)?, + )?); + debug!(?contract_address, "parsed contract address from base64"); + } + + MESSAGE_ID_ATTRIBUTE_KEY => { + insertion.message_id = + Some(H256::from_slice(hex::decode(value)?.as_slice())); + debug!(message_id = ?insertion.message_id, "parsed message_id from plain text"); + } + v if *MESSAGE_ID_ATTRIBUTE_KEY_BASE64 == v => { + insertion.message_id = Some(H256::from_slice( + hex::decode(String::from_utf8( + BASE64 + .decode(value) + .map_err(Into::::into)?, + )?)? + .as_slice(), + )); + debug!(message_id = ?insertion.message_id, "parsed message_id from base64"); + } + + INDEX_ATTRIBUTE_KEY => { + insertion.leaf_index = Some(value.parse::()?); + debug!(leaf_index = ?insertion.leaf_index, "parsed leaf_index from plain text"); + } + v if *INDEX_ATTRIBUTE_KEY_BASE64 == v => { + insertion.leaf_index = Some( + String::from_utf8( + BASE64 + .decode(value) + .map_err(Into::::into)?, + )? + .parse()?, + ); + debug!(leaf_index = ?insertion.leaf_index, "parsed leaf_index from base64"); + } + + unknown => { + debug!(?unknown, "unknown attribute"); + } + } } - unknown => { - debug!(?unknown, "unknown attribute"); + EventAttribute::V034(a) => { + unimplemented!(); } } } diff --git a/rust/main/chains/hyperlane-cosmos/src/payloads/general.rs b/rust/main/chains/hyperlane-cosmos/src/payloads/general.rs index bf0931220d..0652cd0340 100644 --- a/rust/main/chains/hyperlane-cosmos/src/payloads/general.rs +++ b/rust/main/chains/hyperlane-cosmos/src/payloads/general.rs @@ -1,4 +1,6 @@ use serde::{Deserialize, Serialize}; +use tendermint::abci::v0_34; +use tendermint::v0_37; #[derive(Serialize, Deserialize, Debug, Clone)] pub struct EmptyStruct {} @@ -30,10 +32,6 @@ pub struct EventAttribute { impl From for cosmrs::tendermint::abci::EventAttribute { fn from(val: EventAttribute) -> Self { - cosmrs::tendermint::abci::EventAttribute { - key: val.key, - value: val.value, - index: val.index, - } + cosmrs::tendermint::abci::EventAttribute::from((val.key, val.value, val.index)) } } diff --git a/rust/main/chains/hyperlane-cosmos/src/providers/cosmos/provider.rs b/rust/main/chains/hyperlane-cosmos/src/providers/cosmos/provider.rs index e498c22ed9..2ca98e3fb7 100644 --- a/rust/main/chains/hyperlane-cosmos/src/providers/cosmos/provider.rs +++ b/rust/main/chains/hyperlane-cosmos/src/providers/cosmos/provider.rs @@ -156,8 +156,8 @@ impl CosmosProvider { value: pk.value, }; - let proto = proto::cosmos::crypto::secp256k1::PubKey::from_any(&any) - .map_err(Into::::into)?; + let proto: proto::cosmos::crypto::secp256k1::PubKey = + any.to_msg().map_err(Into::::into)?; let decompressed = decompress_public_key(&proto.key) .map_err(|e| HyperlaneCosmosError::PublicKeyError(e.to_string()))?; @@ -250,8 +250,8 @@ impl CosmosProvider { let msg = "could not find contract execution message"; HyperlaneCosmosError::ParsingFailed(msg.to_owned()) })?; - let proto = - ProtoMsgExecuteContract::from_any(any).map_err(Into::::into)?; + let proto: proto::cosmwasm::wasm::v1::MsgExecuteContract = + any.to_msg().map_err(Into::::into)?; let msg = MsgExecuteContract::try_from(proto)?; let contract = H256::try_from(CosmosAccountId::new(&msg.contract))?; diff --git a/rust/main/chains/hyperlane-cosmos/src/providers/grpc.rs b/rust/main/chains/hyperlane-cosmos/src/providers/grpc.rs index c2e05acf45..d9719e942a 100644 --- a/rust/main/chains/hyperlane-cosmos/src/providers/grpc.rs +++ b/rust/main/chains/hyperlane-cosmos/src/providers/grpc.rs @@ -553,14 +553,13 @@ impl WasmProvider for WasmGrpcProvider { { let signer = self.get_signer()?; let contract_address = self.get_contract_address(); - let msgs = vec![MsgExecuteContract { + let msg = MsgExecuteContract { sender: signer.address.clone(), contract: contract_address.address(), msg: serde_json::to_string(&payload)?.as_bytes().to_vec(), funds: vec![], - } - .to_any() - .map_err(ChainCommunicationError::from_other)?]; + }; + let msgs = vec![Any::from_msg(&msg).map_err(ChainCommunicationError::from_other)?]; let gas_limit: Option = gas_limit.and_then(|limit| match limit.try_into() { Ok(limit) => Some(limit), Err(err) => { @@ -629,9 +628,9 @@ impl WasmProvider for WasmGrpcProvider { }; let response = self - .estimate_gas(vec![msg - .to_any() - .map_err(ChainCommunicationError::from_other)?]) + .estimate_gas(vec![ + Any::from_msg(&msg).map_err(ChainCommunicationError::from_other)? + ]) .await?; Ok(response)