diff --git a/.changeset/breezy-bats-type.md b/.changeset/breezy-bats-type.md deleted file mode 100644 index 4b1dd9ca38..0000000000 --- a/.changeset/breezy-bats-type.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@hyperlane-xyz/sdk': patch ---- - -Granular control of updating predeployed routingIsms based on routing config mismatch -- Add support for routingIsmDelta which filters out the incompatibility between the onchain deployed config and the desired config. -- Based on the above, you either update the deployed Ism with new routes, delete old routes, change owners, etc. -- `moduleMatchesConfig` uses the same diff --git a/.changeset/large-guests-jump.md b/.changeset/large-guests-jump.md deleted file mode 100644 index 6276c4c088..0000000000 --- a/.changeset/large-guests-jump.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@hyperlane-xyz/infra': patch -'@hyperlane-xyz/cli': patch -'@hyperlane-xyz/sdk': patch -'@hyperlane-xyz/core': patch ---- - -Supporting DefaultFallbackRoutingIsm through non-factory deployments diff --git a/.changeset/many-apes-invite.md b/.changeset/many-apes-invite.md new file mode 100644 index 0000000000..ef6ce96c4b --- /dev/null +++ b/.changeset/many-apes-invite.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/sdk': patch +--- + +Remove dead arbitrum goerli explorer link" diff --git a/.changeset/tiny-spiders-argue.md b/.changeset/tiny-spiders-argue.md deleted file mode 100644 index 4662aabfb9..0000000000 --- a/.changeset/tiny-spiders-argue.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@hyperlane-xyz/sdk': minor ---- - -Replace Fallback and Retry Providers with new SmartProvider with more effective fallback/retry logic diff --git a/.changeset/wise-mangos-crash.md b/.changeset/wise-mangos-crash.md deleted file mode 100644 index e46546c5f7..0000000000 --- a/.changeset/wise-mangos-crash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@hyperlane-xyz/sdk': patch ---- - -Remove healthy RPC URLs and remove NeutronTestnet diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..bd0d1d21a4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,28 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' +--- + +## Problem + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Additional context** +Add any other context or screenshots about the feature request here. + +## Solution + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +## Nice to Have + +**Describe non-essential extensions to the solution** +Additional features which should be implemented if they are easy to accommodate but otherwise can be skipped diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ca16cd2edd..d44fc82a5f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -219,7 +219,7 @@ jobs: working-directory: ./rust - name: agent tests with CosmWasm - run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally -- cosmos::test --nocapture + run: RUST_BACKTRACE=1 cargo test --package run-locally --bin run-locally --features cosmos -- cosmos::test --nocapture working-directory: ./rust - name: agent tests excluding CosmWasm diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 74eb64dc77..cd0cef75dc 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -187,9 +187,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -207,30 +207,30 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -279,7 +279,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "726535892e8eae7e70657b4c8ea93d26b8553afb1ce617caee529ef96d7dee6c" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", "synstructure", @@ -291,7 +291,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2777730b2039ac0f95f093556e61b6d26cebed5393ca6f152717777cec3a42ed" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -342,9 +342,9 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -353,9 +353,9 @@ version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -380,9 +380,9 @@ dependencies = [ [[package]] name = "atomic-polyfill" -version = "0.1.11" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ff7eb3f316534d83a8a2c3d1674ace8a5a71198eba31e2e2b597833f699b28" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" dependencies = [ "critical-section", ] @@ -405,7 +405,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7862e21c893d65a1650125d157eaeec691439379a1cee17ee49031b79236ada4" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -417,7 +417,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -508,7 +508,7 @@ checksum = "33b8de67cc41132507eeece2584804efcb15f85ba516e34c944b7667f480397a" dependencies = [ "heck 0.3.3", "proc-macro-error", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -588,6 +588,19 @@ dependencies = [ "num-traits", ] +[[package]] +name = "bigdecimal" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06619be423ea5bb86c95f087d5707942791a08a85530df0db2209a3ecfb8bc9" +dependencies = [ + "autocfg", + "libm", + "num-bigint 0.4.4", + "num-integer", + "num-traits", +] + [[package]] name = "bincode" version = "1.3.3" @@ -610,12 +623,12 @@ dependencies = [ "lazycell", "peeking_take_while", "prettyplease", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "regex", "rustc-hash", "shlex", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -732,9 +745,9 @@ checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" [[package]] name = "bnum" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128a44527fc0d6abf05f9eda748b9027536e12dff93f5acc8449f51583309350" +checksum = "ab9008b6bb9fc80b5277f2fe481c09e828743d9151203e804583eb4c9e15b31d" [[package]] name = "borrown" @@ -754,11 +767,11 @@ dependencies = [ [[package]] name = "borsh" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf617fabf5cdbdc92f774bfe5062d870f228b80056d41180797abf48bed4056e" +checksum = "26d4d6dafc1a3bb54687538972158f07b2c948bc57d5890df22c0739098b3028" dependencies = [ - "borsh-derive 1.2.0", + "borsh-derive 1.3.0", "cfg_aliases", ] @@ -771,21 +784,21 @@ dependencies = [ "borsh-derive-internal", "borsh-schema-derive-internal", "proc-macro-crate 0.1.5", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "syn 1.0.109", ] [[package]] name = "borsh-derive" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f404657a7ea7b5249e36808dff544bc88a28f26e0ac40009f674b7a009d14be3" +checksum = "bf4918709cc4dd777ad2b6303ed03cb37f3ca0ccede8c1b0d28ac6db8f4710e0" dependencies = [ "once_cell", "proc-macro-crate 2.0.0", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", "syn_derive", ] @@ -795,7 +808,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -806,7 +819,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -892,7 +905,7 @@ version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -912,9 +925,9 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -1114,9 +1127,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.8" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" dependencies = [ "clap_builder", "clap_derive 4.4.7", @@ -1124,9 +1137,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" dependencies = [ "anstream", "anstyle", @@ -1142,7 +1155,7 @@ checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ "heck 0.4.1", "proc-macro-error", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -1154,9 +1167,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -1285,9 +1298,9 @@ dependencies = [ [[package]] name = "config" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d379af7f68bfc21714c6c7dea883544201741d2ce8274bb12fa54f89507f52a7" +checksum = "23738e11972c7643e4ec947840fc463b6a571afcd3e735bdfce7d03c7a784aca" dependencies = [ "async-trait", "json5", @@ -1343,9 +1356,9 @@ checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" [[package]] name = "const-oid" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" [[package]] name = "constant_time_eq" @@ -1398,9 +1411,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -1408,9 +1421,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cosmos-sdk-proto" @@ -1487,7 +1500,7 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43609e92ce1b9368aa951b334dd354a2d0dd4d484931a5f83ae10e12a26c8ba9" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -1559,9 +1572,9 @@ checksum = "7059fff8937831a9ae6f0fe4d658ffabf58f2ca96aa9dec1c889f936f705f216" [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5" dependencies = [ "cfg-if", "crossbeam-utils", @@ -1569,9 +1582,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -1580,22 +1593,21 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", "memoffset 0.9.0", - "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "b9bcf5bdbfdd6030fb4a1c497b5d5fc5921aa2f60d359a17e249c0e6df3de153" dependencies = [ "cfg-if", "crossbeam-utils", @@ -1603,9 +1615,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" dependencies = [ "cfg-if", ] @@ -1759,9 +1771,9 @@ dependencies = [ [[package]] name = "cw-utils" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9f351a4e4d81ef7c890e44d903f8c0bdcdc00f094fd3a181eaf70c0eec7a3a" +checksum = "1c4a657e5caacc3a0d00ee96ca8618745d050b8f757c709babafb81208d4239c" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -1774,23 +1786,24 @@ dependencies = [ [[package]] name = "cw2" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9431d14f64f49e41c6ef5561ed11a5391c417d0cb16455dea8cdcb9037a8d197" +checksum = "c6c120b24fbbf5c3bedebb97f2cc85fbfa1c3287e09223428e7e597b5293c1fa" dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", "schemars", + "semver", "serde", "thiserror", ] [[package]] name = "cw20" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786e9da5e937f473cecd2463e81384c1af65d0f6398bbd851be7655487c55492" +checksum = "526e39bb20534e25a1cd0386727f0038f4da294e5e535729ba3ef54055246abd" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -1801,14 +1814,13 @@ dependencies = [ [[package]] name = "cw20-base" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09558f87fd3d5e4a479761051b3f98ee2fa723d9e484b5679b6058ad0eadf8f1" +checksum = "17ad79e86ea3707229bf78df94e08732e8f713207b4a77b2699755596725e7d9" dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", - "cw-utils", "cw2", "cw20", "schemars", @@ -1841,7 +1853,7 @@ dependencies = [ "darling 0.13.4", "graphql-parser", "once_cell", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "strsim 0.10.0", "syn 1.0.109", @@ -1885,7 +1897,7 @@ checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "strsim 0.10.0", "syn 1.0.109", @@ -1899,7 +1911,7 @@ checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" dependencies = [ "fnv", "ident_case", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "strsim 0.10.0", "syn 1.0.109", @@ -1940,9 +1952,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "der" @@ -1959,7 +1971,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" dependencies = [ - "const-oid 0.9.5", + "const-oid 0.9.6", "zeroize", ] @@ -1969,7 +1981,7 @@ version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ - "const-oid 0.9.5", + "const-oid 0.9.6", "zeroize", ] @@ -1989,9 +2001,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" dependencies = [ "powerfmt", "serde", @@ -2009,7 +2021,7 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -2020,7 +2032,7 @@ version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3418329ca0ad70234b9735dc4ceed10af4df60eff9c8e7b06cb5e520d92c3535" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -2041,7 +2053,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" dependencies = [ "darling 0.14.4", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -2063,7 +2075,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case 0.4.0", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "rustc_version", "syn 1.0.109", @@ -2112,7 +2124,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", - "const-oid 0.9.5", + "const-oid 0.9.6", "crypto-common", "subtle", ] @@ -2173,9 +2185,9 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -2260,7 +2272,7 @@ dependencies = [ "elliptic-curve 0.13.8", "rfc6979 0.4.0", "signature 2.2.0", - "spki 0.7.2", + "spki 0.7.3", ] [[package]] @@ -2352,7 +2364,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f0042ff8246a363dbe77d2ceedb073339e85a804b9a47636c6e016a9a32c05f" dependencies = [ "enum-ordinalize", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -2453,7 +2465,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8958699f9359f0b04e691a13850d48b7de329138023876d07cbd024c2c820598" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -2466,9 +2478,9 @@ checksum = "1bf1fa3f06bbff1ea5b1a9c7b14aa992a39657db60a2759457328d7e058f49ee" dependencies = [ "num-bigint 0.4.4", "num-traits", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -2478,9 +2490,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f33313078bb8d4d05a2733a94ac4c2d8a0df9a2b84424ebf4f33bfc224a890e" dependencies = [ "once_cell", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -2517,12 +2529,12 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2672,7 +2684,7 @@ dependencies = [ "eyre", "getrandom 0.2.11", "hex 0.4.3", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "regex", "reqwest", @@ -2692,7 +2704,7 @@ dependencies = [ "ethers-contract-abigen", "ethers-core", "hex 0.4.3", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "serde_json", "syn 1.0.109", @@ -2715,7 +2727,7 @@ dependencies = [ "k256 0.11.6", "once_cell", "open-fastrlp", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "rand 0.8.5", "rlp", "rlp-derive", @@ -2871,9 +2883,9 @@ dependencies = [ [[package]] name = "eyre" -version = "0.6.9" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80f656be11ddf91bd709454d15d5bd896fbaf4cc3314e69349e4d1569f5b46cd" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" dependencies = [ "indenter", "once_cell", @@ -2919,14 +2931,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", ] [[package]] @@ -3010,9 +3022,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -3238,7 +3250,7 @@ dependencies = [ "fuel-abi-types", "itertools 0.10.5", "lazy_static", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "regex", "serde_json", @@ -3271,7 +3283,7 @@ dependencies = [ "fuels-code-gen", "itertools 0.10.5", "lazy_static", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "rand 0.8.5", "regex", @@ -3296,7 +3308,7 @@ dependencies = [ "futures", "hex 0.4.3", "itertools 0.10.5", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "rand 0.8.5", "regex", "serde", @@ -3380,7 +3392,7 @@ dependencies = [ "hex 0.4.3", "itertools 0.10.5", "lazy_static", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "regex", "serde", "serde_json", @@ -3470,9 +3482,9 @@ version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -3579,9 +3591,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "glob" @@ -3689,9 +3701,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash 0.8.6", "allocator-api2", @@ -3712,7 +3724,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.2", + "hashbrown 0.14.3", ] [[package]] @@ -3741,9 +3753,9 @@ dependencies = [ [[package]] name = "heapless" -version = "0.7.16" +version = "0.7.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db04bc24a18b9ea980628ecf00e6c0264f3c1426dac36c00cb49b6fbad8b0743" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" dependencies = [ "atomic-polyfill", "hash32", @@ -3810,9 +3822,9 @@ checksum = "12cb882ccb290b8646e554b157ab0b71e64e8d5bef775cd66b6531e52d302669" [[package]] name = "hkdf" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ "hmac 0.12.1", ] @@ -3859,11 +3871,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3901,9 +3913,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -3930,9 +3942,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -3945,7 +3957,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -3998,7 +4010,7 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.9", + "rustls 0.21.10", "tokio", "tokio-rustls 0.24.1", ] @@ -4089,6 +4101,7 @@ version = "0.1.0" dependencies = [ "async-trait", "auto_impl 1.1.0", + "bigdecimal 0.4.2", "borsh 0.9.3", "bs58 0.5.0", "bytes", @@ -4232,7 +4245,7 @@ dependencies = [ "bincode", "borsh 0.9.3", "bs58 0.5.0", - "clap 4.4.8", + "clap 4.4.11", "hex 0.4.3", "hyperlane-core", "hyperlane-sealevel-connection-client", @@ -4409,6 +4422,7 @@ dependencies = [ "multisig-ism", "num-derive 0.4.1", "num-traits", + "rand 0.8.5", "serializable-account-meta", "solana-program", "solana-program-test", @@ -4658,9 +4672,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -4739,7 +4753,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -4773,7 +4787,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown 0.14.3", ] [[package]] @@ -4844,26 +4858,35 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -4944,9 +4967,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libloading" @@ -4958,6 +4981,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + [[package]] name = "libredox" version = "0.0.1" @@ -5052,9 +5081,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lock_api" @@ -5256,9 +5285,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi 0.11.0+wasi-snapshot-preview1", @@ -5287,7 +5316,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" dependencies = [ "cfg-if", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -5308,7 +5337,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a7d5f7076603ebc68de2dc6a650ec331a062a13abaa346975be747bbfa4b789" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -5499,7 +5528,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -5510,9 +5539,9 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfb77679af88f8b125209d354a202862602672222e7f2313fdd6dc349bad4712" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -5605,7 +5634,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ "proc-macro-crate 1.2.1", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -5617,9 +5646,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro-crate 1.2.1", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -5648,9 +5677,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -5684,16 +5713,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" dependencies = [ "bytes", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] [[package]] name = "openssl" -version = "0.10.59" +version = "0.10.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33" +checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" dependencies = [ "bitflags 2.4.1", "cfg-if", @@ -5710,9 +5739,9 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -5723,9 +5752,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.95" +version = "0.9.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" +checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" dependencies = [ "cc", "libc", @@ -5786,7 +5815,7 @@ checksum = "5f7d21ccd03305a674437ee1248f3ab5d4b1db095cf1caf49f1713ddf61956b7" dependencies = [ "Inflector", "proc-macro-error", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -5805,9 +5834,9 @@ checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "parity-scale-codec" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec", "bitvec 1.0.1", @@ -5819,12 +5848,12 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate 1.2.1", - "proc-macro2 1.0.69", + "proc-macro-crate 2.0.0", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -5968,7 +5997,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5aa52829b8decbef693af90202711348ab001456803ba2a98eb4ec8fb70844c" dependencies = [ "peg-runtime", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", ] @@ -5989,9 +6018,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "percentage" @@ -6031,9 +6060,9 @@ checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227" dependencies = [ "pest", "pest_meta", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -6072,9 +6101,9 @@ version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -6117,7 +6146,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der 0.7.8", - "spki 0.7.2", + "spki 0.7.3", ] [[package]] @@ -6223,8 +6252,8 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ - "proc-macro2 1.0.69", - "syn 2.0.39", + "proc-macro2 1.0.70", + "syn 2.0.41", ] [[package]] @@ -6276,7 +6305,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" dependencies = [ "proc-macro-error-attr", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", "version_check", @@ -6288,7 +6317,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "version_check", ] @@ -6304,9 +6333,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] @@ -6344,7 +6373,7 @@ checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools 0.10.5", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -6385,7 +6414,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -6477,7 +6506,7 @@ version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", ] [[package]] @@ -6613,15 +6642,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.4.1" @@ -6707,6 +6727,7 @@ dependencies = [ "itertools 0.11.0", "num-derive 0.4.1", "num-traits", + "once_cell", "prometheus", "regex", "reqwest", @@ -6731,9 +6752,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "async-compression", "base64 0.21.5", @@ -6757,7 +6778,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.9", + "rustls 0.21.10", "rustls-pemfile 1.0.4", "serde", "serde_json", @@ -6772,7 +6793,7 @@ dependencies = [ "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.25.2", + "webpki-roots 0.25.3", "winreg", ] @@ -6814,9 +6835,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.5" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", "getrandom 0.2.11", @@ -6837,12 +6858,13 @@ dependencies = [ [[package]] name = "rkyv" -version = "0.7.42" +version = "0.7.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" +checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" dependencies = [ "bitvec 1.0.1", "bytecheck", + "bytes", "hashbrown 0.12.3", "ptr_meta", "rend", @@ -6854,11 +6876,11 @@ dependencies = [ [[package]] name = "rkyv_derive" -version = "0.7.42" +version = "0.7.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" +checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -6878,7 +6900,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -6926,6 +6948,8 @@ dependencies = [ "hex 0.4.3", "hpl-interface", "hyperlane-core", + "hyperlane-cosmos", + "jobserver", "k256 0.13.2", "macro_rules_attribute", "maplit", @@ -7069,7 +7093,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" dependencies = [ "arrayvec", - "borsh 1.2.0", + "borsh 1.3.0", "bytes", "num-traits", "rand 0.8.5", @@ -7116,15 +7140,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.25" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -7154,12 +7178,12 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.9" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.17.5", + "ring 0.17.7", "rustls-webpki", "sct 0.7.1", ] @@ -7212,7 +7236,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -7224,9 +7248,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "salsa20" @@ -7274,7 +7298,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" dependencies = [ "proc-macro-crate 1.2.1", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -7306,7 +7330,7 @@ version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c767fd6fa65d9ccf9cf026122c1b555f2ef9a4f0cea69da4d7dbc3e258d30967" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "serde_derive_internals", "syn 1.0.109", @@ -7368,9 +7392,9 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -7415,7 +7439,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -7427,7 +7451,7 @@ checksum = "fade86e8d41fd1a4721f84cb834f4ca2783f973cc30e6212b7fafc134f169214" dependencies = [ "async-stream", "async-trait", - "bigdecimal", + "bigdecimal 0.3.1", "chrono", "futures", "log", @@ -7471,7 +7495,7 @@ checksum = "28936f26d62234ff0be16f80115dbdeb3237fe9c25cf18fbcd1e3b3592360f20" dependencies = [ "bae", "heck 0.3.3", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -7499,7 +7523,7 @@ version = "0.28.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbab99b8cd878ab7786157b7eb8df96333a6807cc6e45e8888c85b51534b401a" dependencies = [ - "bigdecimal", + "bigdecimal 0.3.1", "chrono", "rust_decimal", "sea-query-derive", @@ -7514,7 +7538,7 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cea85029985b40dfbf18318d85fe985c04db7c1b4e5e8e0a0a0cdff5f1e30f9" dependencies = [ - "bigdecimal", + "bigdecimal 0.3.1", "chrono", "rust_decimal", "sea-query", @@ -7531,7 +7555,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63f62030c60f3a691f5fe251713b4e220b306e50a71e1d6f9cce1f24bb781978" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", "thiserror", @@ -7555,7 +7579,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56821b7076f5096b8f726e2791ad255a99c82498e08ec477a65a96c461ff1927" dependencies = [ "heck 0.3.3", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -7576,7 +7600,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69b4397b825df6ccf1e98bcdabef3bbcfc47ff5853983467850eeab878384f21" dependencies = [ "heck 0.3.3", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "rustversion", "syn 1.0.109", @@ -7693,9 +7717,9 @@ dependencies = [ [[package]] name = "serde-aux" -version = "4.2.0" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3dfe1b7eb6f9dcf011bd6fad169cdeaae75eda0d61b1a99a3f015b41b0cae39" +checksum = "184eba62ebddb71658697c8b08822edee89970bf318c5362189f0de27f85b498" dependencies = [ "serde", "serde_json", @@ -7725,9 +7749,9 @@ version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -7736,7 +7760,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -7768,9 +7792,9 @@ version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -7803,7 +7827,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ "darling 0.13.4", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -8311,7 +8335,7 @@ name = "solana-frozen-abi-macro" version = "1.14.13" source = "git+https://github.com/hyperlane-xyz/solana.git?tag=hyperlane-1.14.13-2023-07-04#62a6421cab862c77b9ac7a8d93f54f8b5b223af7" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "rustc_version", "syn 1.0.109", @@ -8637,7 +8661,7 @@ version = "1.14.13" source = "git+https://github.com/hyperlane-xyz/solana.git?tag=hyperlane-1.14.13-2023-07-04#62a6421cab862c77b9ac7a8d93f54f8b5b223af7" dependencies = [ "bs58 0.4.0", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "rustversion", "syn 1.0.109", @@ -8869,9 +8893,9 @@ dependencies = [ [[package]] name = "spki" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", "der 0.7.8", @@ -8964,11 +8988,11 @@ dependencies = [ [[package]] name = "sqlformat" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b7b278788e7be4d0d29c0f39497a0eef3fba6bbc8e70d8bf7fde46edeaa9e85" +checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" dependencies = [ - "itertools 0.11.0", + "itertools 0.12.0", "nom", "unicode_categories", ] @@ -8992,7 +9016,7 @@ dependencies = [ "ahash 0.7.7", "atoi", "base64 0.13.1", - "bigdecimal", + "bigdecimal 0.3.1", "bitflags 1.3.2", "byteorder", "bytes", @@ -9048,7 +9072,7 @@ dependencies = [ "either", "heck 0.4.1", "once_cell", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "serde_json", "sqlx-core", @@ -9135,7 +9159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d06aaeeee809dbc59eb4556183dd927df67db1540de5be8d3ec0b6636358a5ec" dependencies = [ "heck 0.3.3", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -9147,7 +9171,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "rustversion", "syn 1.0.109", @@ -9160,10 +9184,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ "heck 0.4.1", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "rustversion", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -9210,18 +9234,18 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.39" +version = "2.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "unicode-ident", ] @@ -9233,9 +9257,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" dependencies = [ "proc-macro-error", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -9250,7 +9274,7 @@ version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", "unicode-xid 0.2.4", @@ -9333,7 +9357,7 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", "syn 1.0.109", ] @@ -9495,22 +9519,22 @@ checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -9525,9 +9549,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", @@ -9545,9 +9569,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -9597,9 +9621,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" dependencies = [ "backtrace", "bytes", @@ -9630,9 +9654,9 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -9673,7 +9697,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.9", + "rustls 0.21.10", "tokio", ] @@ -9889,9 +9913,9 @@ version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -9968,9 +9992,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tungstenite" @@ -10048,9 +10072,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-ident" @@ -10130,9 +10154,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "ureq" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7830e33f6e25723d41a63f77e434159dad02919f18f55a512b5f16f3b1d77138" +checksum = "f8cdd25c339e200129fe4de81451814e5228c9b771d57378817d6117cc2b3f97" dependencies = [ "base64 0.21.5", "log", @@ -10152,12 +10176,12 @@ dependencies = [ [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna 0.5.0", "percent-encoding", ] @@ -10312,9 +10336,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -10322,24 +10346,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ "cfg-if", "js-sys", @@ -10349,9 +10373,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote 1.0.33", "wasm-bindgen-macro-support", @@ -10359,22 +10383,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "wasm-timer" @@ -10393,9 +10417,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", @@ -10417,7 +10441,7 @@ version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring 0.17.5", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -10441,9 +10465,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "which" @@ -10525,6 +10549,15 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", +] + [[package]] name = "windows-targets" version = "0.42.2" @@ -10555,6 +10588,21 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -10567,6 +10615,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -10579,6 +10633,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -10591,6 +10651,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -10603,6 +10669,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -10615,6 +10687,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -10627,6 +10705,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -10639,11 +10723,17 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5" dependencies = [ "memchr", ] @@ -10706,11 +10796,13 @@ dependencies = [ [[package]] name = "xattr" -version = "1.0.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" +checksum = "a7dae5072fe1f8db8f8d29059189ac175196e410e40ba42d5d4684ae2f750995" dependencies = [ "libc", + "linux-raw-sys", + "rustix", ] [[package]] @@ -10739,22 +10831,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.26" +version = "0.7.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e415490559a91254a2979b4829267a57d2fcd741a98eee8b722fb57289aa0" +checksum = "1c4061bedbb353041c12f413700357bec76df2c7e2ca8e4df8bac24c6bf68e3d" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.26" +version = "0.7.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd7e48ccf166952882ca8bd778a43502c64f33bf94c12ebe2a7f08e5a0f6689f" +checksum = "b3c129550b3e6de3fd0ba67ba5c81818f9805e58b8d7fee80a3a59d2c9fc601a" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] @@ -10772,9 +10864,9 @@ version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2 1.0.70", "quote 1.0.33", - "syn 2.0.39", + "syn 2.0.41", ] [[package]] diff --git a/rust/Cargo.toml b/rust/Cargo.toml index 55b7b34afc..cf59d93baa 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -57,6 +57,7 @@ axum = "0.6.1" # axum-server = "0.5.1" backtrace = "0.3" base64 = "0.21.2" +bigdecimal = "0.4.2" bincode = "1.3" borsh = "0.9" bs58 = "0.5.0" @@ -79,7 +80,7 @@ derive_builder = "0.12" derive_more = "0.99" ed25519-dalek = "~1.0" enum_dispatch = "0.3" -eyre = "0.6" +eyre = "=0.6.8" fixed-hash = "0.8.0" fuels = "0.38" fuels-code-gen = "0.38" @@ -95,6 +96,7 @@ hpl-interface = "=0.0.6-rc3" hyper = "0.14" hyper-tls = "0.5.0" itertools = "0.11.0" +jobserver = "=0.1.26" jsonrpc-core = "18.0" k256 = { version = "0.13.1", features = ["std", "ecdsa"] } log = "0.4" diff --git a/rust/agents/relayer/Cargo.toml b/rust/agents/relayer/Cargo.toml index 7eb5b83fe6..0bd5697971 100644 --- a/rust/agents/relayer/Cargo.toml +++ b/rust/agents/relayer/Cargo.toml @@ -39,6 +39,7 @@ hyperlane-base = { path = "../../hyperlane-base" } hyperlane-ethereum = { path = "../../chains/hyperlane-ethereum" } [dev-dependencies] +once_cell.workspace = true tokio-test.workspace = true hyperlane-test = { path = "../../hyperlane-test" } hyperlane-base = { path = "../../hyperlane-base", features = ["test-utils"] } diff --git a/rust/agents/relayer/src/msg/gas_payment/mod.rs b/rust/agents/relayer/src/msg/gas_payment/mod.rs index 50f010d244..cd9dd61c06 100644 --- a/rust/agents/relayer/src/msg/gas_payment/mod.rs +++ b/rust/agents/relayer/src/msg/gas_payment/mod.rs @@ -4,8 +4,8 @@ use async_trait::async_trait; use eyre::Result; use hyperlane_base::db::HyperlaneRocksDB; use hyperlane_core::{ - GasPaymentKey, HyperlaneMessage, InterchainGasExpenditure, InterchainGasPayment, - TxCostEstimate, TxOutcome, U256, + FixedPointNumber, GasPaymentKey, HyperlaneMessage, InterchainGasExpenditure, + InterchainGasPayment, TxCostEstimate, TxOutcome, U256, }; use tracing::{debug, error, trace}; @@ -135,7 +135,8 @@ impl GasPaymentEnforcer { self.db.process_gas_expenditure(InterchainGasExpenditure { message_id: message.id(), gas_used: outcome.gas_used, - tokens_used: outcome.gas_used * outcome.gas_price, + tokens_used: (FixedPointNumber::try_from(outcome.gas_used)? * outcome.gas_price) + .try_into()?, })?; Ok(()) } diff --git a/rust/agents/relayer/src/msg/gas_payment/policies/minimum.rs b/rust/agents/relayer/src/msg/gas_payment/policies/minimum.rs index 23f329d09a..ea2c4d23d1 100644 --- a/rust/agents/relayer/src/msg/gas_payment/policies/minimum.rs +++ b/rust/agents/relayer/src/msg/gas_payment/policies/minimum.rs @@ -59,7 +59,7 @@ async fn test_gas_payment_policy_minimum() { ¤t_expenditure, &TxCostEstimate { gas_limit: U256::from(100000u32), - gas_price: U256::from(100000u32), + gas_price: U256::from(100000u32).try_into().unwrap(), l2_gas_limit: None, }, ) @@ -83,7 +83,7 @@ async fn test_gas_payment_policy_minimum() { ¤t_expenditure, &TxCostEstimate { gas_limit: U256::from(100000u32), - gas_price: U256::from(100001u32), + gas_price: U256::from(100001u32).try_into().unwrap(), l2_gas_limit: None, }, ) @@ -101,7 +101,7 @@ async fn test_gas_payment_policy_minimum() { ¤t_expenditure, &TxCostEstimate { gas_limit: U256::from(100000u32), - gas_price: U256::from(100001u32), + gas_price: U256::from(100001u32).try_into().unwrap(), l2_gas_limit: Some(U256::from(22222u32)), }, ) diff --git a/rust/agents/relayer/src/msg/gas_payment/policies/none.rs b/rust/agents/relayer/src/msg/gas_payment/policies/none.rs index 9ce88a39c7..4d15359f49 100644 --- a/rust/agents/relayer/src/msg/gas_payment/policies/none.rs +++ b/rust/agents/relayer/src/msg/gas_payment/policies/none.rs @@ -52,7 +52,7 @@ async fn test_gas_payment_policy_none() { ¤t_expenditure, &TxCostEstimate { gas_limit: U256::from(100000u32), - gas_price: U256::from(100001u32), + gas_price: U256::from(100001u32).try_into().unwrap(), l2_gas_limit: None, }, ) @@ -70,7 +70,7 @@ async fn test_gas_payment_policy_none() { ¤t_expenditure, &TxCostEstimate { gas_limit: U256::from(100000u32), - gas_price: U256::from(100001u32), + gas_price: U256::from(100001u32).try_into().unwrap(), l2_gas_limit: Some(U256::from(22222u32)), }, ) diff --git a/rust/agents/relayer/src/msg/gas_payment/policies/on_chain_fee_quoting.rs b/rust/agents/relayer/src/msg/gas_payment/policies/on_chain_fee_quoting.rs index cdc017defa..af71d63306 100644 --- a/rust/agents/relayer/src/msg/gas_payment/policies/on_chain_fee_quoting.rs +++ b/rust/agents/relayer/src/msg/gas_payment/policies/on_chain_fee_quoting.rs @@ -64,6 +64,7 @@ impl GasPaymentPolicy for GasPaymentPolicyOnChainFeeQuoting { #[cfg(test)] mod test { use hyperlane_core::H256; + use once_cell::sync::Lazy; use super::*; @@ -85,11 +86,11 @@ mod test { } const MIN: U256 = U256([1000, 0, 0, 0]); - const COST_ESTIMATE: TxCostEstimate = TxCostEstimate { + static COST_ESTIMATE: Lazy = Lazy::new(|| TxCostEstimate { gas_limit: U256([2000, 0, 0, 0]), // MIN * 2 - gas_price: U256([100001, 0, 0, 0]), + gas_price: U256([100001, 0, 0, 0]).try_into().unwrap(), l2_gas_limit: None, - }; + }); #[test] fn ensure_little_endian() { @@ -203,7 +204,7 @@ mod test { let tx_cost_estimate = TxCostEstimate { gas_limit: MIN * 100, // Large gas limit - gas_price: COST_ESTIMATE.gas_price, + gas_price: COST_ESTIMATE.gas_price.clone().try_into().unwrap(), l2_gas_limit: Some(MIN * 2), }; @@ -217,7 +218,7 @@ mod test { ¤t_expenditure(0), &TxCostEstimate { l2_gas_limit: None, - ..tx_cost_estimate + ..tx_cost_estimate.clone() } ) .await diff --git a/rust/agents/relayer/src/msg/pending_message.rs b/rust/agents/relayer/src/msg/pending_message.rs index 860c1017af..9836a47d78 100644 --- a/rust/agents/relayer/src/msg/pending_message.rs +++ b/rust/agents/relayer/src/msg/pending_message.rs @@ -238,7 +238,7 @@ impl PendingOperation for PendingMessage { "processing message" ); - op_try!(critical: self.ctx.origin_gas_payment_enforcer.record_tx_outcome(&self.message, tx_outcome), "recording tx outcome"); + op_try!(critical: self.ctx.origin_gas_payment_enforcer.record_tx_outcome(&self.message, tx_outcome.clone()), "recording tx outcome"); if tx_outcome.executed { info!( txid=?tx_outcome.transaction_id, diff --git a/rust/agents/scraper/src/db/message.rs b/rust/agents/scraper/src/db/message.rs index ba5b33843e..8dd1a8b52f 100644 --- a/rust/agents/scraper/src/db/message.rs +++ b/rust/agents/scraper/src/db/message.rs @@ -79,7 +79,7 @@ impl ScraperDb { { Ok(Some(HyperlaneMessage { // We do not write version to the DB. - version: 0, + version: 3, origin: message.origin as u32, destination: message.destination as u32, nonce: message.nonce as u32, diff --git a/rust/chains/hyperlane-cosmos/Cargo.toml b/rust/chains/hyperlane-cosmos/Cargo.toml index 12b084ba93..1b30023665 100644 --- a/rust/chains/hyperlane-cosmos/Cargo.toml +++ b/rust/chains/hyperlane-cosmos/Cargo.toml @@ -1,3 +1,5 @@ +cargo-features = ["workspace-inheritance"] + [package] name = "hyperlane-cosmos" documentation = { workspace = true } diff --git a/rust/chains/hyperlane-cosmos/src/libs/address.rs b/rust/chains/hyperlane-cosmos/src/libs/address.rs index 507bd24172..11e15ff9e3 100644 --- a/rust/chains/hyperlane-cosmos/src/libs/address.rs +++ b/rust/chains/hyperlane-cosmos/src/libs/address.rs @@ -22,7 +22,7 @@ pub struct CosmosAddress { impl CosmosAddress { /// Returns a Bitcoin style address: RIPEMD160(SHA256(pubkey)) - /// Source: https://github.com/cosmos/cosmos-sdk/blob/177e7f45959215b0b4e85babb7c8264eaceae052/crypto/keys/secp256k1/secp256k1.go#L154 + /// Source: `` pub fn from_pubkey(pubkey: PublicKey, prefix: &str) -> ChainResult { // Get the inner type let tendermint_pubkey = TendermintPublicKey::from(pubkey); diff --git a/rust/chains/hyperlane-cosmos/src/mailbox.rs b/rust/chains/hyperlane-cosmos/src/mailbox.rs index 4aafd29c87..0b3927cda1 100644 --- a/rust/chains/hyperlane-cosmos/src/mailbox.rs +++ b/rust/chains/hyperlane-cosmos/src/mailbox.rs @@ -215,7 +215,7 @@ impl Mailbox for CosmosMailbox { let result = TxCostEstimate { gas_limit: gas_limit.into(), - gas_price: U256::from(2500), + gas_price: self.provider.grpc().gas_price(), l2_gas_limit: None, }; diff --git a/rust/chains/hyperlane-cosmos/src/providers/grpc.rs b/rust/chains/hyperlane-cosmos/src/providers/grpc.rs index 2a54734b19..9653020ad3 100644 --- a/rust/chains/hyperlane-cosmos/src/providers/grpc.rs +++ b/rust/chains/hyperlane-cosmos/src/providers/grpc.rs @@ -22,19 +22,18 @@ use cosmrs::{ traits::Message, }, tx::{self, Fee, MessageExt, SignDoc, SignerInfo}, - Amount, Coin, + Coin, +}; +use hyperlane_core::{ + ChainCommunicationError, ChainResult, ContractLocator, FixedPointNumber, U256, }; -use hyperlane_core::{ChainCommunicationError, ChainResult, ContractLocator, U256}; use serde::Serialize; use tonic::transport::{Channel, Endpoint}; -use crate::address::CosmosAddress; use crate::HyperlaneCosmosError; +use crate::{address::CosmosAddress, CosmosAmount}; use crate::{signers::Signer, ConnectionConf}; -/// The gas price to use for transactions. -/// TODO: is there a nice way to get a suggested price dynamically? -const DEFAULT_GAS_PRICE: f64 = 0.05; /// A multiplier applied to a simulated transaction's gas usage to /// calculate the estimated gas. const GAS_ESTIMATE_MULTIPLIER: f64 = 1.25; @@ -89,14 +88,16 @@ pub struct WasmGrpcProvider { /// Signer for transactions. signer: Option, /// GRPC Channel that can be cheaply cloned. - /// See https://docs.rs/tonic/latest/tonic/transport/struct.Channel.html#multiplexing-requests + /// See `` channel: Channel, + gas_price: CosmosAmount, } impl WasmGrpcProvider { /// Create new CosmWasm GRPC Provider. pub fn new( conf: ConnectionConf, + gas_price: CosmosAmount, locator: Option, signer: Option, ) -> ChainResult { @@ -112,6 +113,7 @@ impl WasmGrpcProvider { contract_address, signer, channel, + gas_price, }) } @@ -121,9 +123,12 @@ impl WasmGrpcProvider { .as_ref() .ok_or(ChainCommunicationError::SignerUnavailable) } -} -impl WasmGrpcProvider { + /// Get the gas price + pub fn gas_price(&self) -> FixedPointNumber { + self.gas_price.amount.clone() + } + /// Generates an unsigned SignDoc for a transaction. async fn generate_unsigned_sign_doc( &self, @@ -145,9 +150,13 @@ impl WasmGrpcProvider { ); let signer_info = SignerInfo::single_direct(Some(signer.public_key), account_info.sequence); + let amount: u128 = (FixedPointNumber::from(gas_limit) * self.gas_price()) + .ceil_to_integer() + .try_into()?; let auth_info = signer_info.auth_info(Fee::from_amount_and_gas( Coin::new( - Amount::from((gas_limit as f64 * DEFAULT_GAS_PRICE) as u64), + // The fee to pay is the gas limit * the gas price + amount, self.conf.get_canonical_asset().as_str(), ) .map_err(Into::::into)?, diff --git a/rust/chains/hyperlane-cosmos/src/providers/mod.rs b/rust/chains/hyperlane-cosmos/src/providers/mod.rs index 973a886a3c..21216f087c 100644 --- a/rust/chains/hyperlane-cosmos/src/providers/mod.rs +++ b/rust/chains/hyperlane-cosmos/src/providers/mod.rs @@ -5,7 +5,7 @@ use hyperlane_core::{ }; use tendermint_rpc::{client::CompatMode, HttpClient}; -use crate::{ConnectionConf, HyperlaneCosmosError, Signer}; +use crate::{ConnectionConf, CosmosAmount, HyperlaneCosmosError, Signer}; use self::grpc::WasmGrpcProvider; @@ -31,7 +31,8 @@ impl CosmosProvider { locator: Option, signer: Option, ) -> ChainResult { - let grpc_client = WasmGrpcProvider::new(conf.clone(), locator, signer)?; + let gas_price = CosmosAmount::try_from(conf.get_minimum_gas_price().clone())?; + let grpc_client = WasmGrpcProvider::new(conf.clone(), gas_price.clone(), locator, signer)?; let rpc_client = HttpClient::builder( conf.get_rpc_url() .parse() diff --git a/rust/chains/hyperlane-cosmos/src/trait_builder.rs b/rust/chains/hyperlane-cosmos/src/trait_builder.rs index 8629970bd9..81c16b7846 100644 --- a/rust/chains/hyperlane-cosmos/src/trait_builder.rs +++ b/rust/chains/hyperlane-cosmos/src/trait_builder.rs @@ -1,3 +1,8 @@ +use std::str::FromStr; + +use derive_new::new; +use hyperlane_core::{ChainCommunicationError, FixedPointNumber}; + /// Cosmos connection configuration #[derive(Debug, Clone)] pub struct ConnectionConf { @@ -11,6 +16,38 @@ pub struct ConnectionConf { prefix: String, /// Canoncial Assets Denom canonical_asset: String, + /// The gas price set by the cosmos-sdk validator. Note that this represents the + /// minimum price set by the validator. + /// More details here: https://docs.cosmos.network/main/learn/beginner/gas-fees#antehandler + gas_price: RawCosmosAmount, +} + +/// Untyped cosmos amount +#[derive(serde::Serialize, serde::Deserialize, new, Clone, Debug)] +pub struct RawCosmosAmount { + /// Coin denom (e.g. `untrn`) + pub denom: String, + /// Amount in the given denom + pub amount: String, +} + +/// Typed cosmos amount +#[derive(Clone, Debug)] +pub struct CosmosAmount { + /// Coin denom (e.g. `untrn`) + pub denom: String, + /// Amount in the given denom + pub amount: FixedPointNumber, +} + +impl TryFrom for CosmosAmount { + type Error = ChainCommunicationError; + fn try_from(raw: RawCosmosAmount) -> Result { + Ok(Self { + denom: raw.denom, + amount: FixedPointNumber::from_str(&raw.amount)?, + }) + } } /// An error type when parsing a connection configuration. @@ -59,6 +96,11 @@ impl ConnectionConf { self.canonical_asset.clone() } + /// Get the minimum gas price + pub fn get_minimum_gas_price(&self) -> RawCosmosAmount { + self.gas_price.clone() + } + /// Create a new connection configuration pub fn new( grpc_url: String, @@ -66,6 +108,7 @@ impl ConnectionConf { chain_id: String, prefix: String, canonical_asset: String, + minimum_gas_price: RawCosmosAmount, ) -> Self { Self { grpc_url, @@ -73,6 +116,7 @@ impl ConnectionConf { chain_id, prefix, canonical_asset, + gas_price: minimum_gas_price, } } } diff --git a/rust/chains/hyperlane-cosmos/src/types.rs b/rust/chains/hyperlane-cosmos/src/types.rs index 264ae8791e..d7647e7ddf 100644 --- a/rust/chains/hyperlane-cosmos/src/types.rs +++ b/rust/chains/hyperlane-cosmos/src/types.rs @@ -29,6 +29,6 @@ pub fn tx_response_to_outcome(response: TxResponse) -> ChainResult { transaction_id: H256::from_slice(hex::decode(response.txhash)?.as_slice()).into(), executed: response.code == 0, gas_used: U256::from(response.gas_used), - gas_price: U256::one(), + gas_price: U256::one().try_into()?, }) } diff --git a/rust/chains/hyperlane-ethereum/src/mailbox.rs b/rust/chains/hyperlane-ethereum/src/mailbox.rs index 60bf35c9d8..4c566abbdf 100644 --- a/rust/chains/hyperlane-ethereum/src/mailbox.rs +++ b/rust/chains/hyperlane-ethereum/src/mailbox.rs @@ -373,15 +373,16 @@ where None }; - let gas_price = self + let gas_price: U256 = self .provider .get_gas_price() .await - .map_err(ChainCommunicationError::from_other)?; + .map_err(ChainCommunicationError::from_other)? + .into(); Ok(TxCostEstimate { gas_limit: gas_limit.into(), - gas_price: gas_price.into(), + gas_price: gas_price.try_into()?, l2_gas_limit: l2_gas_limit.map(|v| v.into()), }) } @@ -484,7 +485,7 @@ mod test { tx_cost_estimate, TxCostEstimate { gas_limit: estimated_gas_limit, - gas_price, + gas_price: gas_price.try_into().unwrap(), l2_gas_limit: Some(l2_gas_limit), }, ); diff --git a/rust/chains/hyperlane-ethereum/tests/signer_output.rs b/rust/chains/hyperlane-ethereum/tests/signer_output.rs index a69629114b..4284dac70d 100644 --- a/rust/chains/hyperlane-ethereum/tests/signer_output.rs +++ b/rust/chains/hyperlane-ethereum/tests/signer_output.rs @@ -22,7 +22,7 @@ use hyperlane_core::{ pub fn output_message() { let hyperlane_message = HyperlaneMessage { nonce: 0, - version: 0, + version: 3, origin: 1000, sender: H256::from(H160::from_str("0x1111111111111111111111111111111111111111").unwrap()), destination: 2000, diff --git a/rust/chains/hyperlane-sealevel/src/mailbox.rs b/rust/chains/hyperlane-sealevel/src/mailbox.rs index ab72e4b0f2..f7a22d89ed 100644 --- a/rust/chains/hyperlane-sealevel/src/mailbox.rs +++ b/rust/chains/hyperlane-sealevel/src/mailbox.rs @@ -9,9 +9,9 @@ use tracing::{debug, info, instrument, warn}; use hyperlane_core::{ accumulator::incremental::IncrementalMerkle, ChainCommunicationError, ChainResult, Checkpoint, - ContractLocator, Decode as _, Encode as _, HyperlaneAbi, HyperlaneChain, HyperlaneContract, - HyperlaneDomain, HyperlaneMessage, HyperlaneProvider, Indexer, LogMeta, Mailbox, - MerkleTreeHook, SequenceIndexer, TxCostEstimate, TxOutcome, H256, H512, U256, + ContractLocator, Decode as _, Encode as _, FixedPointNumber, HyperlaneAbi, HyperlaneChain, + HyperlaneContract, HyperlaneDomain, HyperlaneMessage, HyperlaneProvider, Indexer, LogMeta, + Mailbox, MerkleTreeHook, SequenceIndexer, TxCostEstimate, TxOutcome, H256, H512, U256, }; use hyperlane_sealevel_interchain_security_module_interface::{ InterchainSecurityModuleInstruction, VerifyInstruction, @@ -470,7 +470,7 @@ impl Mailbox for SealevelMailbox { transaction_id: txid, executed, // TODO use correct data upon integrating IGP support - gas_price: U256::zero(), + gas_price: U256::zero().try_into()?, gas_used: U256::zero(), }) } @@ -484,7 +484,7 @@ impl Mailbox for SealevelMailbox { // TODO use correct data upon integrating IGP support Ok(TxCostEstimate { gas_limit: U256::zero(), - gas_price: U256::zero(), + gas_price: FixedPointNumber::zero(), l2_gas_limit: None, }) } @@ -633,7 +633,7 @@ impl SealevelMailboxIndexer { impl SequenceIndexer for SealevelMailboxIndexer { #[instrument(err, skip(self))] async fn sequence_and_tip(&self) -> ChainResult<(Option, u32)> { - let tip = Indexer::::get_finalized_block_number(self as _).await?; + let tip = Indexer::::get_finalized_block_number(self).await?; // TODO: need to make sure the call and tip are at the same height? let count = Mailbox::count(&self.mailbox, None).await?; Ok((Some(count), tip)) diff --git a/rust/chains/hyperlane-sealevel/src/merkle_tree_hook.rs b/rust/chains/hyperlane-sealevel/src/merkle_tree_hook.rs index e721a82019..b7ed6ba1e2 100644 --- a/rust/chains/hyperlane-sealevel/src/merkle_tree_hook.rs +++ b/rust/chains/hyperlane-sealevel/src/merkle_tree_hook.rs @@ -4,13 +4,14 @@ use async_trait::async_trait; use derive_new::new; use hyperlane_core::{ accumulator::incremental::IncrementalMerkle, ChainCommunicationError, ChainResult, Checkpoint, - HyperlaneChain, Indexer, LogMeta, MerkleTreeHook, MerkleTreeInsertion, SequenceIndexer, + HyperlaneChain, HyperlaneMessage, Indexer, LogMeta, MerkleTreeHook, MerkleTreeInsertion, + SequenceIndexer, }; use hyperlane_sealevel_mailbox::accounts::OutboxAccount; use solana_sdk::commitment_config::CommitmentConfig; use tracing::instrument; -use crate::SealevelMailbox; +use crate::{SealevelMailbox, SealevelMailboxIndexer}; #[async_trait] impl MerkleTreeHook for SealevelMailbox { @@ -76,26 +77,38 @@ impl MerkleTreeHook for SealevelMailbox { } /// Struct that retrieves event data for a Sealevel merkle tree hook contract +/// For now it's just a wrapper around the SealevelMailboxIndexer #[derive(Debug, new)] -pub struct SealevelMerkleTreeHookIndexer {} +pub struct SealevelMerkleTreeHookIndexer(SealevelMailboxIndexer); #[async_trait] impl Indexer for SealevelMerkleTreeHookIndexer { async fn fetch_logs( &self, - _range: RangeInclusive, + range: RangeInclusive, ) -> ChainResult> { - Ok(vec![]) + let messages = Indexer::::fetch_logs(&self.0, range).await?; + let merkle_tree_insertions = messages + .into_iter() + .map(|(m, meta)| (message_to_merkle_tree_insertion(&m), meta)) + .collect(); + Ok(merkle_tree_insertions) } async fn get_finalized_block_number(&self) -> ChainResult { - Ok(0) + Indexer::::get_finalized_block_number(&self.0).await } } #[async_trait] impl SequenceIndexer for SealevelMerkleTreeHookIndexer { async fn sequence_and_tip(&self) -> ChainResult<(Option, u32)> { - Ok((None, 0)) + SequenceIndexer::::sequence_and_tip(&self.0).await } } + +fn message_to_merkle_tree_insertion(message: &HyperlaneMessage) -> MerkleTreeInsertion { + let leaf_index = message.nonce; + let message_id = message.id(); + MerkleTreeInsertion::new(leaf_index, message_id) +} diff --git a/rust/chains/hyperlane-sealevel/src/validator_announce.rs b/rust/chains/hyperlane-sealevel/src/validator_announce.rs index e7fc8dca80..c6ce2233dd 100644 --- a/rust/chains/hyperlane-sealevel/src/validator_announce.rs +++ b/rust/chains/hyperlane-sealevel/src/validator_announce.rs @@ -128,7 +128,7 @@ impl ValidatorAnnounce for SealevelValidatorAnnounce { transaction_id: H512::zero(), executed: false, gas_used: U256::zero(), - gas_price: U256::zero(), + gas_price: U256::zero().try_into()?, }) } } diff --git a/rust/config/mainnet3_config.json b/rust/config/mainnet3_config.json index 70f804cc91..d18839dc81 100644 --- a/rust/config/mainnet3_config.json +++ b/rust/config/mainnet3_config.json @@ -432,6 +432,10 @@ "grpcUrl": "https://grpc-kralum.neutron-1.neutron.org:80", "canonicalAsset": "untrn", "prefix": "neutron", + "gasPrice": { + "amount": "0.5", + "denom": "untrn" + }, "index": { "from": 4000000, "chunk": 100000 diff --git a/rust/config/test-sealevel-keys/test_deployer-account.json b/rust/config/test-sealevel-keys/test_deployer-account.json new file mode 100644 index 0000000000..43e9524005 --- /dev/null +++ b/rust/config/test-sealevel-keys/test_deployer-account.json @@ -0,0 +1,13 @@ +{ + "pubkey": "E9VrvAdGRvCguN2XgXsgu9PNmMM3vZsU8LSUrM68j8ty", + "account": { + "lamports": 500000000000000000, + "data": [ + "", + "base64" + ], + "owner": "11111111111111111111111111111111", + "executable": false, + "rentEpoch": 0 + } + } \ No newline at end of file diff --git a/rust/config/test-sealevel-keys/test_deployer-keypair.json b/rust/config/test-sealevel-keys/test_deployer-keypair.json new file mode 100644 index 0000000000..36e1ec6786 --- /dev/null +++ b/rust/config/test-sealevel-keys/test_deployer-keypair.json @@ -0,0 +1 @@ +[137,43,246,148,154,244,35,62,98,248,84,203,54,24,188,26,62,227,52,29,199,26,218,8,196,213,222,202,35,154,207,79,195,85,53,151,7,182,83,94,59,5,131,252,40,75,87,11,243,118,71,59,195,222,212,148,179,233,253,121,97,210,114,98] \ No newline at end of file diff --git a/rust/config/test_sealevel_config.json b/rust/config/test_sealevel_config.json new file mode 100644 index 0000000000..af814bd460 --- /dev/null +++ b/rust/config/test_sealevel_config.json @@ -0,0 +1,48 @@ +{ + "chains": { + "sealeveltest1": { + "name": "sealeveltest1", + "chainId": 13375, + "domainId": 13375, + "mailbox": "692KZJaoe2KRcD6uhCQDLLXnLNA5ZLnfvdqjE4aX9iu1", + "interchainGasPaymaster": "DrFtxirPPsfdY4HQiNZj2A9o4Ux7JaL3gELANgAoihhp", + "validatorAnnounce": "DH43ae1LwemXAboWwSh8zc9pG8j72gKUEXNi57w8fEnn", + "protocol": "sealevel", + "blocks": { + "reorgPeriod": 0, + "confirmations": 0 + }, + "rpcUrls": [ + { + "http": "http://localhost:8899" + } + ], + "index": { + "from": 1, + "mode": "sequence" + } + }, + "sealeveltest2": { + "name": "sealeveltest2", + "chainId": 13376, + "domainId": 13376, + "mailbox": "9tCUWNjpqcf3NUSrtp7vquYVCwbEByvLjZUrhG5dgvhj", + "interchainGasPaymaster": "G5rGigZBL8NmxCaukK2CAKr9Jq4SUfAhsjzeri7GUraK", + "validatorAnnounce": "3Uo5j2Bti9aZtrDqJmAyuwiFaJFPFoNL5yxTpVCNcUhb", + "protocol": "sealevel", + "blocks": { + "reorgPeriod": 0, + "confirmations": 0 + }, + "rpcUrls": [ + { + "http": "http://localhost:8899" + } + ], + "index": { + "from": 1, + "mode": "sequence" + } + } + } +} \ No newline at end of file diff --git a/rust/config/testnet4_config.json b/rust/config/testnet4_config.json index 12621e6035..d0fbd12598 100644 --- a/rust/config/testnet4_config.json +++ b/rust/config/testnet4_config.json @@ -1007,32 +1007,6 @@ "index": { "from": 4558491 } - }, - "neutrontestnet": { - "name": "neutrontestnet", - "domainId": "33333", - "chainId": "duality-devnet", - "mailbox": "0xdb33c78ca39541dd740659fbfd86fdd601fe7225f10f26e87595c5b8df6bdcda", - "interchainGasPaymaster": "0xae38a168ced2b1cdafd7da5de2fbd22749b1ab52e88cd0b121f750a6c20a2814", - "validatorAnnounce": "0x29d5f702a35d4135d98abf52c62ddc0cfd74001663ec14d284edff7d0419fb58", - "merkleTreeHook": "0xb6aac0c4650129ded8e645e6ef8dcbba710623b826e5a1dae34158a27247c668", - "protocol": "cosmos", - "finalityBlocks": 1, - "rpcUrls": [ - { - "http": "http://54.149.31.83:26657" - } - ], - "grpcUrl": "http://52.43.22.152:9090", - "canonicalAsset": "token", - "prefix": "dual", - "index": { - "from": 1, - "chunk": 100000 - }, - "blocks": { - "reorgPeriod": 1 - } } }, "defaultRpcConsensusType": "fallback" diff --git a/rust/hyperlane-base/src/db/rocks/test_utils.rs b/rust/hyperlane-base/src/db/rocks/test_utils.rs index 5fbeb78df7..3b4639bbd1 100644 --- a/rust/hyperlane-base/src/db/rocks/test_utils.rs +++ b/rust/hyperlane-base/src/db/rocks/test_utils.rs @@ -49,7 +49,7 @@ mod test { let m = HyperlaneMessage { nonce: 100, - version: 0, + version: 3, origin: 10, sender: H256::from_low_u64_be(4), destination: 12, diff --git a/rust/hyperlane-base/src/settings/chains.rs b/rust/hyperlane-base/src/settings/chains.rs index a56ad31afb..46379718c4 100644 --- a/rust/hyperlane-base/src/settings/chains.rs +++ b/rust/hyperlane-base/src/settings/chains.rs @@ -111,16 +111,18 @@ impl ChainConf { metrics: &CoreMetrics, ) -> Result> { let ctx = "Building provider"; + let locator = self.locator(H256::zero()); match &self.connection { ChainConnectionConf::Ethereum(conf) => { - let locator = self.locator(H256::zero()); self.build_ethereum(conf, &locator, metrics, h_eth::HyperlaneProviderBuilder {}) .await } ChainConnectionConf::Fuel(_) => todo!(), - ChainConnectionConf::Sealevel(_) => todo!(), + ChainConnectionConf::Sealevel(conf) => Ok(Box::new(h_sealevel::SealevelProvider::new( + locator.domain.clone(), + conf, + )) as Box), ChainConnectionConf::Cosmos(conf) => { - let locator = self.locator(H256::zero()); let provider = CosmosProvider::new( locator.domain.clone(), conf.clone(), @@ -385,8 +387,12 @@ impl ChainConf { .await } ChainConnectionConf::Fuel(_) => todo!(), - ChainConnectionConf::Sealevel(_) => { - let indexer = Box::new(h_sealevel::SealevelMerkleTreeHookIndexer::new()); + ChainConnectionConf::Sealevel(conf) => { + let mailbox_indexer = + Box::new(h_sealevel::SealevelMailboxIndexer::new(conf, locator)?); + let indexer = Box::new(h_sealevel::SealevelMerkleTreeHookIndexer::new( + *mailbox_indexer, + )); Ok(indexer as Box>) } ChainConnectionConf::Cosmos(conf) => { diff --git a/rust/hyperlane-base/src/settings/mod.rs b/rust/hyperlane-base/src/settings/mod.rs index b999b8a323..e809444328 100644 --- a/rust/hyperlane-base/src/settings/mod.rs +++ b/rust/hyperlane-base/src/settings/mod.rs @@ -14,8 +14,7 @@ //! each configured chain. //! //! All agents share the [`Settings`] struct in this crate, and then define any -//! additional `Settings` in their own crate. By convention this is done in -//! `settings.rs` using the [`decl_settings!`] macro. +//! additional `Settings` in their own crate. //! //! ### Configuration //! diff --git a/rust/hyperlane-base/src/settings/parser/connection_parser.rs b/rust/hyperlane-base/src/settings/parser/connection_parser.rs index b7a0a1244d..55cce2be38 100644 --- a/rust/hyperlane-base/src/settings/parser/connection_parser.rs +++ b/rust/hyperlane-base/src/settings/parser/connection_parser.rs @@ -6,7 +6,7 @@ use url::Url; use crate::settings::envs::*; use crate::settings::ChainConnectionConf; -use super::ValueParser; +use super::{parse_cosmos_gas_price, ValueParser}; pub fn build_ethereum_connection_conf( rpcs: &[Url], @@ -94,6 +94,12 @@ pub fn build_cosmos_connection_conf( None }; + let gas_price = chain + .chain(err) + .get_opt_key("gasPrice") + .and_then(parse_cosmos_gas_price) + .end(); + if !local_err.is_ok() { err.merge(local_err); None @@ -104,6 +110,7 @@ pub fn build_cosmos_connection_conf( chain_id.unwrap().to_string(), prefix.unwrap().to_string(), canonical_asset.unwrap(), + gas_price.unwrap(), ))) } } diff --git a/rust/hyperlane-base/src/settings/parser/mod.rs b/rust/hyperlane-base/src/settings/parser/mod.rs index 76ed1d5944..aad2e87355 100644 --- a/rust/hyperlane-base/src/settings/parser/mod.rs +++ b/rust/hyperlane-base/src/settings/parser/mod.rs @@ -11,6 +11,7 @@ use std::{ use convert_case::{Case, Casing}; use eyre::{eyre, Context}; +use h_cosmos::RawCosmosAmount; use hyperlane_core::{ cfg_unwrap_all, config::*, HyperlaneDomain, HyperlaneDomainProtocol, IndexMode, }; @@ -398,3 +399,22 @@ pub fn recase_json_value(mut val: Value, case: Case) -> Value { } val } + +/// Expects AgentSigner. +fn parse_cosmos_gas_price(gas_price: ValueParser) -> ConfigResult { + let mut err = ConfigParsingError::default(); + + let amount = gas_price + .chain(&mut err) + .get_opt_key("amount") + .parse_string() + .end(); + + let denom = gas_price + .chain(&mut err) + .get_opt_key("denom") + .parse_string() + .end(); + cfg_unwrap_all!(&gas_price.cwp, err: [denom, amount]); + err.into_result(RawCosmosAmount::new(denom.to_owned(), amount.to_owned())) +} diff --git a/rust/hyperlane-core/Cargo.toml b/rust/hyperlane-core/Cargo.toml index bbb0835b8c..d5c93b937a 100644 --- a/rust/hyperlane-core/Cargo.toml +++ b/rust/hyperlane-core/Cargo.toml @@ -12,6 +12,7 @@ version = { workspace = true } [dependencies] async-trait.workspace = true auto_impl.workspace = true +bigdecimal.workspace = true borsh.workspace = true bs58.workspace = true bytes = { workspace = true, features = ["serde"] } diff --git a/rust/hyperlane-core/src/error.rs b/rust/hyperlane-core/src/error.rs index ae7c5f8b54..b3fb6ce356 100644 --- a/rust/hyperlane-core/src/error.rs +++ b/rust/hyperlane-core/src/error.rs @@ -3,6 +3,8 @@ use std::error::Error as StdError; use std::fmt::{Debug, Display, Formatter}; use std::ops::Deref; +use bigdecimal::ParseBigDecimalError; + use crate::config::StrOrIntParseError; use std::string::FromUtf8Error; @@ -123,6 +125,9 @@ pub enum ChainCommunicationError { /// Primitive type error #[error(transparent)] PrimitiveTypeError(#[from] PrimitiveTypeError), + /// Big decimal parsing error + #[error(transparent)] + ParseBigDecimalError(#[from] ParseBigDecimalError), } impl ChainCommunicationError { diff --git a/rust/hyperlane-core/src/metrics/agent.rs b/rust/hyperlane-core/src/metrics/agent.rs index 02c2795e59..c6c138ca33 100644 --- a/rust/hyperlane-core/src/metrics/agent.rs +++ b/rust/hyperlane-core/src/metrics/agent.rs @@ -1,6 +1,7 @@ use crate::HyperlaneDomainProtocol; use std::time::Duration; +#[cfg(feature = "float")] use crate::U256; const ETHEREUM_DECIMALS: u8 = 18; diff --git a/rust/hyperlane-core/src/traits/mod.rs b/rust/hyperlane-core/src/traits/mod.rs index ec2c9e04f4..1b82599895 100644 --- a/rust/hyperlane-core/src/traits/mod.rs +++ b/rust/hyperlane-core/src/traits/mod.rs @@ -15,6 +15,8 @@ pub use routing_ism::*; pub use signing::*; pub use validator_announce::*; +use crate::{FixedPointNumber, U256}; + mod aggregation_ism; mod ccip_read_ism; mod cursor; @@ -33,7 +35,7 @@ mod signing; mod validator_announce; /// The result of a transaction -#[derive(Debug, Clone, Copy)] +#[derive(Debug, Clone)] pub struct TxOutcome { /// The transaction identifier/hash pub transaction_id: crate::H512, @@ -42,7 +44,7 @@ pub struct TxOutcome { /// Amount of gas used on this transaction. pub gas_used: crate::U256, /// Price paid for the gas - pub gas_price: crate::U256, + pub gas_price: FixedPointNumber, // TODO: more? What can be abstracted across all chains? } @@ -55,8 +57,8 @@ impl From for TxOutcome { gas_used: t.gas_used.map(Into::into).unwrap_or(crate::U256::zero()), gas_price: t .effective_gas_price - .map(Into::into) - .unwrap_or(crate::U256::zero()), + .and_then(|price| U256::from(price).try_into().ok()) + .unwrap_or(FixedPointNumber::zero()), } } } diff --git a/rust/hyperlane-core/src/types/message.rs b/rust/hyperlane-core/src/types/message.rs index 0291d33fb2..badabd815c 100644 --- a/rust/hyperlane-core/src/types/message.rs +++ b/rust/hyperlane-core/src/types/message.rs @@ -21,7 +21,7 @@ impl From<&HyperlaneMessage> for RawHyperlaneMessage { } /// A full Hyperlane message between chains -#[derive(Default, Clone, Eq, PartialEq)] +#[derive(Clone, Eq, PartialEq)] pub struct HyperlaneMessage { /// 1 Hyperlane version number pub version: u8, @@ -39,6 +39,21 @@ pub struct HyperlaneMessage { pub body: Vec, } +impl Default for HyperlaneMessage { + fn default() -> Self { + Self { + // Use version 3 now that Hyperlane V3 is the default + version: 3, + nonce: 0, + origin: 0, + sender: H256::zero(), + destination: 0, + recipient: H256::zero(), + body: vec![], + } + } +} + impl Sequenced for HyperlaneMessage { fn sequence(&self) -> u32 { self.nonce diff --git a/rust/hyperlane-core/src/types/mod.rs b/rust/hyperlane-core/src/types/mod.rs index c1e39e491b..58d466abce 100644 --- a/rust/hyperlane-core/src/types/mod.rs +++ b/rust/hyperlane-core/src/types/mod.rs @@ -224,13 +224,13 @@ pub struct TxCostEstimate { /// The gas limit for the transaction. pub gas_limit: U256, /// The gas price for the transaction. - pub gas_price: U256, + pub gas_price: FixedPointNumber, /// The amount of L2 gas for the transaction. /// If Some, `gas_limit` is the sum of the gas limit /// covering L1 costs and the L2 gas limit. /// Only present for Arbitrum Nitro chains, where the gas amount /// is used to cover L1 and L2 costs. For details: - /// https://medium.com/offchainlabs/understanding-arbitrum-2-dimensional-fees-fd1d582596c9 + /// `` pub l2_gas_limit: Option, } diff --git a/rust/hyperlane-core/src/types/primitive_types.rs b/rust/hyperlane-core/src/types/primitive_types.rs index 2b0f5112e6..acc649113b 100644 --- a/rust/hyperlane-core/src/types/primitive_types.rs +++ b/rust/hyperlane-core/src/types/primitive_types.rs @@ -3,11 +3,15 @@ #![allow(clippy::assign_op_pattern)] #![allow(clippy::reversed_empty_ranges)] +use std::{ops::Mul, str::FromStr}; + +use bigdecimal::BigDecimal; use borsh::{BorshDeserialize, BorshSerialize}; use fixed_hash::impl_fixed_hash_conversions; +use num_traits::Zero; use uint::construct_uint; -use crate::types::serialize; +use crate::{types::serialize, ChainCommunicationError}; /// Error type for conversion. #[derive(Debug, PartialEq, Eq, thiserror::Error)] @@ -337,3 +341,90 @@ impl From for H512 { H512(sig.into()) } } + +/// Wrapper type around `BigDecimal` to implement various traits on it +#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] +pub struct FixedPointNumber(BigDecimal); + +impl FixedPointNumber { + /// Zero + pub fn zero() -> Self { + Self(BigDecimal::zero()) + } + + /// Round up to the nearest integer + pub fn ceil_to_integer(&self) -> Self { + Self(self.0.with_scale(0)) + } + + /// Ceil + pub fn ceil(&self, fractional_digit_count: i64) -> Self { + Self( + self.0 + .with_scale_round(fractional_digit_count, bigdecimal::RoundingMode::Ceiling), + ) + } +} + +impl Default for FixedPointNumber { + fn default() -> Self { + Self::zero() + } +} + +impl TryFrom for FixedPointNumber { + type Error = ChainCommunicationError; + fn try_from(val: U256) -> Result { + let u256_string = val.to_string(); + Ok(Self(BigDecimal::from_str(&u256_string)?)) + } +} + +impl TryInto for FixedPointNumber { + type Error = ChainCommunicationError; + + fn try_into(self) -> Result { + // Remove all decimals + let big_integer_string = self.0.with_scale(0).to_string(); + let value = U256::from_dec_str(&big_integer_string)?; + Ok(value) + } +} + +impl TryInto for FixedPointNumber { + type Error = ChainCommunicationError; + + fn try_into(self) -> Result { + let u256: U256 = self.try_into()?; + Ok(u256.as_u128()) + } +} + +impl From for FixedPointNumber +where + T: Into, +{ + fn from(val: T) -> Self { + Self(val.into()) + } +} + +impl Mul for FixedPointNumber +where + T: Into, +{ + type Output = FixedPointNumber; + + fn mul(self, rhs: T) -> Self::Output { + let rhs = rhs.into(); + Self(self.0 * rhs.0) + } +} + +impl FromStr for FixedPointNumber { + type Err = ChainCommunicationError; + + fn from_str(s: &str) -> Result { + Ok(Self(BigDecimal::from_str(s)?)) + } +} diff --git a/rust/sealevel/client/src/main.rs b/rust/sealevel/client/src/main.rs index bef6cc2095..88e75c7f4f 100644 --- a/rust/sealevel/client/src/main.rs +++ b/rust/sealevel/client/src/main.rs @@ -991,23 +991,23 @@ fn process_token_cmd(ctx: Context, cmd: TokenCmd) { // Burns the tokens from the sender's associated token account and // then dispatches a message to the remote recipient. // - // 0. [executable] The system program. - // 1. [executable] The spl_noop program. - // 2. [] The token PDA account. - // 3. [executable] The mailbox program. - // 4. [writeable] The mailbox outbox account. - // 5. [] Message dispatch authority. - // 6. [signer] The token sender and mailbox payer. - // 7. [signer] Unique message / gas payment account. - // 8. [writeable] Message storage PDA. + // 0. `[executable]` The system program. + // 1. `[executable]` The spl_noop program. + // 2. `[]` The token PDA account. + // 3. `[executable]` The mailbox program. + // 4. `[writeable]` The mailbox outbox account. + // 5. `[]` Message dispatch authority. + // 6. `[signer]` The token sender and mailbox payer. + // 7. `[signer]` Unique message / gas payment account. + // 8. `[writeable]` Message storage PDA. // ---- If using an IGP ---- - // 9. [executable] The IGP program. - // 10. [writeable] The IGP program data. - // 11. [writeable] Gas payment PDA. - // 12. [] OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. - // 13. [writeable] The IGP account. + // 9. `[executable]` The IGP program. + // 10. `[writeable]` The IGP program data. + // 11. `[writeable]` Gas payment PDA. + // 12. `[]` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. + // 13. `[writeable]` The IGP account. // ---- End if ---- - // 14..N [??..??] Plugin-specific accounts. + // 14..N `[??..??]` Plugin-specific accounts. let mut accounts = vec![ AccountMeta::new_readonly(system_program::id(), false), AccountMeta::new_readonly(spl_noop::id(), false), @@ -1059,8 +1059,8 @@ fn process_token_cmd(ctx: Context, cmd: TokenCmd) { match xfer.token_type { TokenType::Native => { - // 5. [executable] The system program. - // 6. [writeable] The native token collateral PDA account. + // 5. `[executable]` The system program. + // 6. `[writeable]` The native token collateral PDA account. let (native_collateral_account, _native_collateral_bump) = Pubkey::find_program_address( hyperlane_token_native_collateral_pda_seeds!(), @@ -1072,9 +1072,9 @@ fn process_token_cmd(ctx: Context, cmd: TokenCmd) { ]); } TokenType::Synthetic => { - // 5. [executable] The spl_token_2022 program. - // 6. [writeable] The mint / mint authority PDA account. - // 7. [writeable] The token sender's associated token account, from which tokens will be burned. + // 5. `[executable]` The spl_token_2022 program. + // 6. `[writeable]` The mint / mint authority PDA account. + // 7. `[writeable]` The token sender's associated token account, from which tokens will be burned. let (mint_account, _mint_bump) = Pubkey::find_program_address( hyperlane_token_mint_pda_seeds!(), &xfer.program_id, @@ -1092,10 +1092,10 @@ fn process_token_cmd(ctx: Context, cmd: TokenCmd) { ]); } TokenType::Collateral => { - // 5. [executable] The SPL token program for the mint. - // 6. [writeable] The mint. - // 7. [writeable] The token sender's associated token account, from which tokens will be sent. - // 8. [writeable] The escrow PDA account. + // 5. `[executable]` The SPL token program for the mint. + // 6. `[writeable]` The mint. + // 7. `[writeable]` The token sender's associated token account, from which tokens will be sent. + // 8. `[writeable]` The escrow PDA account. let token = HyperlaneTokenAccount::::fetch( &mut &fetched_token_account.data[..], ) @@ -1266,11 +1266,11 @@ fn process_validator_announce_cmd(ctx: Context, cmd: ValidatorAnnounceCmd) { let ixn = ValidatorAnnounceInstruction::Announce(announce_instruction); // Accounts: - // 0. [signer] The payer. - // 1. [executable] The system program. - // 2. [] The ValidatorAnnounce PDA account. - // 3. [writeable] The validator-specific ValidatorStorageLocationsAccount PDA account. - // 4. [writeable] The ReplayProtection PDA account specific to the announcement being made. + // 0. `[signer]` The payer. + // 1. `[executable]` The system program. + // 2. `[]` The ValidatorAnnounce PDA account. + // 3. `[writeable]` The validator-specific ValidatorStorageLocationsAccount PDA account. + // 4. `[writeable]` The ReplayProtection PDA account specific to the announcement being made. let accounts = vec![ AccountMeta::new_readonly(ctx.payer_pubkey, true), AccountMeta::new_readonly(system_program::id(), false), diff --git a/rust/sealevel/client/src/serde.rs b/rust/sealevel/client/src/serde.rs index b73a25bd59..b4c412f098 100644 --- a/rust/sealevel/client/src/serde.rs +++ b/rust/sealevel/client/src/serde.rs @@ -24,7 +24,7 @@ pub(crate) mod serde_pubkey { } } -/// For serializing and deserializing Option +/// For serializing and deserializing `Option` pub(crate) mod serde_option_pubkey { use borsh::BorshDeserialize; use serde::{Deserialize, Deserializer, Serializer}; diff --git a/rust/sealevel/libraries/account-utils/src/lib.rs b/rust/sealevel/libraries/account-utils/src/lib.rs index aa7fa69744..78af429748 100644 --- a/rust/sealevel/libraries/account-utils/src/lib.rs +++ b/rust/sealevel/libraries/account-utils/src/lib.rs @@ -193,7 +193,7 @@ where /// Creates associated token account using Program Derived Address for the given seeds. /// Required to allow PDAs to be created even if they already have a lamport balance. /// -/// Borrowed from https://github.com/solana-labs/solana-program-library/blob/cf77ed0c187d1becd0db56edff4491c28f18dfc8/associated-token-account/program/src/tools/account.rs#L18 +/// Borrowed from `` pub fn create_pda_account<'a>( payer: &AccountInfo<'a>, rent: &Rent, diff --git a/rust/sealevel/libraries/hyperlane-sealevel-token/src/instruction.rs b/rust/sealevel/libraries/hyperlane-sealevel-token/src/instruction.rs index ae1276a226..2193ea355d 100644 --- a/rust/sealevel/libraries/hyperlane-sealevel-token/src/instruction.rs +++ b/rust/sealevel/libraries/hyperlane-sealevel-token/src/instruction.rs @@ -89,11 +89,11 @@ pub fn init_instruction( let ixn = Instruction::Init(init); // Accounts: - // 0. [executable] The system program. - // 1. [writable] The token PDA account. - // 2. [writable] The dispatch authority PDA account. - // 3. [signer] The payer and access control owner. - // 4..N [??..??] Plugin-specific accounts. + // 0. `[executable]` The system program. + // 1. `[writable]` The token PDA account. + // 2. `[writable]` The dispatch authority PDA account. + // 3. `[signer]` The payer and access control owner. + // 4..N `[??..??]` Plugin-specific accounts. let accounts = vec![ AccountMeta::new_readonly(solana_program::system_program::id(), false), AccountMeta::new(token_key, false), @@ -123,9 +123,9 @@ pub fn enroll_remote_routers_instruction( let ixn = Instruction::EnrollRemoteRouters(configs); // Accounts: - // 0. [executable] The system program. - // 1. [writeable] The token PDA account. - // 2. [signer] The owner. + // 0. `[executable]` The system program. + // 1. `[writeable]` The token PDA account. + // 2. `[signer]` The owner. let accounts = vec![ AccountMeta::new_readonly(solana_program::system_program::id(), false), AccountMeta::new(token_key, false), @@ -154,9 +154,9 @@ pub fn set_destination_gas_configs( let ixn = Instruction::SetDestinationGasConfigs(configs); // Accounts: - // 0. [executable] The system program. - // 1. [writeable] The token PDA account. - // 2. [signer] The owner. + // 0. `[executable]` The system program. + // 1. `[writeable]` The token PDA account. + // 2. `[signer]` The owner. let accounts = vec![ AccountMeta::new_readonly(solana_program::system_program::id(), false), AccountMeta::new(token_key, false), @@ -185,8 +185,8 @@ pub fn transfer_ownership_instruction( let ixn = Instruction::TransferOwnership(new_owner); // Accounts: - // 0. [writeable] The token PDA account. - // 1. [signer] The current owner. + // 0. `[writeable]` The token PDA account. + // 1. `[signer]` The current owner. let accounts = vec![ AccountMeta::new(token_key, false), AccountMeta::new_readonly(owner_payer, true), @@ -214,8 +214,8 @@ pub fn set_interchain_security_module_instruction( let ixn = Instruction::SetInterchainSecurityModule(new_interchain_security_module); // Accounts: - // 0. [writeable] The token PDA account. - // 1. [signer] The current owner. + // 0. `[writeable]` The token PDA account. + // 1. `[signer]` The current owner. let accounts = vec![ AccountMeta::new(token_key, false), AccountMeta::new_readonly(owner_payer, true), @@ -243,8 +243,8 @@ pub fn set_igp_instruction( let ixn = Instruction::SetInterchainGasPaymaster(igp_program_and_account); // Accounts: - // 0. [writeable] The token PDA account. - // 1. [signer] The current owner. + // 0. `[writeable]` The token PDA account. + // 1. `[signer]` The current owner. let accounts = vec![ AccountMeta::new(token_key, false), AccountMeta::new_readonly(owner_payer, true), diff --git a/rust/sealevel/libraries/hyperlane-sealevel-token/src/processor.rs b/rust/sealevel/libraries/hyperlane-sealevel-token/src/processor.rs index c104828572..801f9df4f6 100644 --- a/rust/sealevel/libraries/hyperlane-sealevel-token/src/processor.rs +++ b/rust/sealevel/libraries/hyperlane-sealevel-token/src/processor.rs @@ -138,11 +138,11 @@ where /// Initializes the program. /// /// Accounts: - /// 0. [executable] The system program. - /// 1. [writable] The token PDA account. - /// 2. [writable] The dispatch authority PDA account. - /// 3. [signer] The payer and access control owner. - /// 4..N [??..??] Plugin-specific accounts. + /// 0. `[executable]` The system program. + /// 1. `[writable]` The token PDA account. + /// 2. `[writable]` The dispatch authority PDA account. + /// 3. `[signer]` The payer and access control owner. + /// 4..N `[??..??]` Plugin-specific accounts. pub fn initialize(program_id: &Pubkey, accounts: &[AccountInfo], init: Init) -> ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -255,23 +255,23 @@ where /// then dispatches a message to the remote recipient. /// /// Accounts: - /// 0. [executable] The system program. - /// 1. [executable] The spl_noop program. - /// 2. [] The token PDA account. - /// 3. [executable] The mailbox program. - /// 4. [writeable] The mailbox outbox account. - /// 5. [] Message dispatch authority. - /// 6. [signer] The token sender and mailbox payer. - /// 7. [signer] Unique message / gas payment account. - /// 8. [writeable] Message storage PDA. + /// 0. `[executable]` The system program. + /// 1. `[executable]` The spl_noop program. + /// 2. `[]` The token PDA account. + /// 3. `[executable]` The mailbox program. + /// 4. `[writeable]` The mailbox outbox account. + /// 5. `[]` Message dispatch authority. + /// 6. `[signer]` The token sender and mailbox payer. + /// 7. `[signer]` Unique message / gas payment account. + /// 8. `[writeable]` Message storage PDA. /// ---- If using an IGP ---- - /// 9. [executable] The IGP program. - /// 10. [writeable] The IGP program data. - /// 11. [writeable] Gas payment PDA. - /// 12. [] OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. - /// 13. [writeable] The IGP account. + /// 9. `[executable]` The IGP program. + /// 10. `[writeable]` The IGP program data. + /// 11. `[writeable]` Gas payment PDA. + /// 12. `[]` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. + /// 13. `[writeable]` The IGP account. /// ---- End if ---- - /// 14..N [??..??] Plugin-specific accounts. + /// 14..N `[??..??]` Plugin-specific accounts. pub fn transfer_remote( program_id: &Pubkey, accounts: &[AccountInfo], @@ -362,13 +362,13 @@ where // Accounts expected by the IGP's `PayForGas` instruction: // - // 0. [executable] The system program. - // 1. [signer] The payer. - // 2. [writeable] The IGP program data. - // 3. [signer] Unique gas payment account. - // 4. [writeable] Gas payment PDA. - // 5. [writeable] The IGP account. - // 6. [] Overhead IGP account (optional). + // 0. `[executable]` The system program. + // 1. `[signer]` The payer. + // 2. `[writeable]` The IGP program data. + // 3. `[signer]` Unique gas payment account. + // 4. `[writeable]` Gas payment PDA. + // 5. `[writeable]` The IGP account. + // 6. `[]` Overhead IGP account (optional). let mut igp_payment_account_metas = vec![ AccountMeta::new_readonly(solana_program::system_program::id(), false), @@ -491,11 +491,11 @@ where } /// Accounts: - /// 0. [signer] Mailbox processor authority specific to this program. - /// 1. [executable] system_program - /// 2. [] hyperlane_token storage + /// 0. `[signer]` Mailbox processor authority specific to this program. + /// 1. `[executable]` system_program + /// 2. `[]` hyperlane_token storage /// 3. [depends on plugin] recipient wallet address - /// 4..N [??..??] Plugin-specific accounts. + /// 4..N `[??..??]` Plugin-specific accounts. pub fn transfer_from_remote( program_id: &Pubkey, accounts: &[AccountInfo], @@ -575,7 +575,7 @@ where /// serializes them, and sets them as return data. /// /// Accounts: - /// 0. [] The token PDA, which is the PDA with the seeds `HANDLE_ACCOUNT_METAS_PDA_SEEDS`. + /// 0. `[]` The token PDA, which is the PDA with the seeds `HANDLE_ACCOUNT_METAS_PDA_SEEDS`. pub fn transfer_from_remote_account_metas( program_id: &Pubkey, accounts: &[AccountInfo], @@ -621,9 +621,9 @@ where /// Enrolls a remote router. /// /// Accounts: - /// 0. [executable] The system program. - /// 1. [writeable] The token PDA account. - /// 2. [signer] The owner. + /// 0. `[executable]` The system program. + /// 1. `[writeable]` The token PDA account. + /// 2. `[signer]` The owner. pub fn enroll_remote_router( program_id: &Pubkey, accounts: &[AccountInfo], @@ -670,9 +670,9 @@ where /// Enrolls remote routers. /// /// Accounts: - /// 0. [executable] The system program. - /// 1. [writeable] The token PDA account. - /// 2. [signer] The owner. + /// 0. `[executable]` The system program. + /// 1. `[writeable]` The token PDA account. + /// 2. `[signer]` The owner. pub fn enroll_remote_routers( program_id: &Pubkey, accounts: &[AccountInfo], @@ -719,8 +719,8 @@ where /// Transfers ownership. /// /// Accounts: - /// 0. [writeable] The token PDA account. - /// 1. [signer] The current owner. + /// 0. `[writeable]` The token PDA account. + /// 1. `[signer]` The current owner. pub fn transfer_ownership( program_id: &Pubkey, accounts: &[AccountInfo], @@ -747,7 +747,7 @@ where /// Gets the interchain security module. /// /// Accounts: - /// 0. [] The token PDA account. + /// 0. `[]` The token PDA account. pub fn interchain_security_module( program_id: &Pubkey, accounts: &[AccountInfo], @@ -792,8 +792,8 @@ where /// Lets the owner set the interchain security module. /// /// Accounts: - /// 0. [writeable] The token PDA account. - /// 1. [signer] The access control owner. + /// 0. `[writeable]` The token PDA account. + /// 1. `[signer]` The access control owner. pub fn set_interchain_security_module( program_id: &Pubkey, accounts: &[AccountInfo], @@ -820,9 +820,9 @@ where /// Lets the owner set destination gas configs. /// /// Accounts: - /// 0. [executable] The system program. - /// 1. [writeable] The token PDA account. - /// 2. [signer] The access control owner. + /// 0. `[executable]` The system program. + /// 1. `[writeable]` The token PDA account. + /// 2. `[signer]` The access control owner. pub fn set_destination_gas_configs( program_id: &Pubkey, accounts: &[AccountInfo], @@ -860,8 +860,8 @@ where /// Lets the owner set the interchain gas paymaster. /// /// Accounts: - /// 0. [writeable] The token PDA account. - /// 1. [signer] The access control owner. + /// 0. `[writeable]` The token PDA account. + /// 1. `[signer]` The access control owner. pub fn set_interchain_gas_paymaster( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/rust/sealevel/libraries/multisig-ism/src/test_data.rs b/rust/sealevel/libraries/multisig-ism/src/test_data.rs index 78ca51b35e..952bde14b9 100644 --- a/rust/sealevel/libraries/multisig-ism/src/test_data.rs +++ b/rust/sealevel/libraries/multisig-ism/src/test_data.rs @@ -17,7 +17,7 @@ const DESTINATION_DOMAIN: u32 = 4321u32; pub fn get_multisig_ism_test_data() -> MultisigIsmTestData { let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 69, origin: ORIGIN_DOMAIN, sender: H256::from_str( @@ -49,31 +49,31 @@ pub fn get_multisig_ism_test_data() -> MultisigIsmTestData { }; // checkpoint.signing_hash() is equal to: - // 0x4fc33ff33d5e9305a2d87f7824d1b943ba219cff4c153ae8fd39b0d8620fc332 + // 0x5c2b4cbafdd7319d9a3dea4aa078748ae53368e1521494a80cf4259b9c6dba6a // Validator 0: // Address: 0xE3DCDBbc248cE191bDc271f3FCcd0d95911BFC5D // Private Key: 0x788aa7213bd92ff92017d767fde0d75601425818c8e4b21e87314c2a4dcd6091 let validator_0 = H160::from_str("0xE3DCDBbc248cE191bDc271f3FCcd0d95911BFC5D").unwrap(); - // > await (new ethers.Wallet('0x788aa7213bd92ff92017d767fde0d75601425818c8e4b21e87314c2a4dcd6091')).signMessage(ethers.utils.arrayify('0x4fc33ff33d5e9305a2d87f7824d1b943ba219cff4c153ae8fd39b0d8620fc332')) - // '0x3a06cc01fef07025ee5ae9e29ae783338fe11f5c21af383fb8cc5878a2ea3616125c230ec07b059eaebb842af0a51040ad3214f9050cccef36b5c21c9c9cc4ba1b' - let signature_0 = hex::decode("3a06cc01fef07025ee5ae9e29ae783338fe11f5c21af383fb8cc5878a2ea3616125c230ec07b059eaebb842af0a51040ad3214f9050cccef36b5c21c9c9cc4ba1b").unwrap(); + // > await (new ethers.Wallet('0x788aa7213bd92ff92017d767fde0d75601425818c8e4b21e87314c2a4dcd6091')).signMessage(ethers.utils.arrayify('0x5c2b4cbafdd7319d9a3dea4aa078748ae53368e1521494a80cf4259b9c6dba6a')) + // '0xb8875fb75adf471e43a943b78eb422ffe86a4291fa6324f9f875241605ca831d2b4225358936deee7501cf305aafc1677e3dc9bcfea4caec54f4cde49d416bd91b' + let signature_0 = hex::decode("b8875fb75adf471e43a943b78eb422ffe86a4291fa6324f9f875241605ca831d2b4225358936deee7501cf305aafc1677e3dc9bcfea4caec54f4cde49d416bd91b").unwrap(); // Validator 1: // Address: 0xb25206874C24733F05CC0dD11924724A8E7175bd // Private Key: 0x4a599de3915f404d84a2ebe522bfe7032ebb1ca76a65b55d6eb212b129043a0e let validator_1 = H160::from_str("0xb25206874C24733F05CC0dD11924724A8E7175bd").unwrap(); - // > await (new ethers.Wallet('0x4a599de3915f404d84a2ebe522bfe7032ebb1ca76a65b55d6eb212b129043a0e')).signMessage(ethers.utils.arrayify('0x4fc33ff33d5e9305a2d87f7824d1b943ba219cff4c153ae8fd39b0d8620fc332')) - // '0xfd34aac152ec85a79211c990f308c7e719145e2e67e48f2d10db4347d3a9102131254eccbcd0fe389afad96b88d368192b33649336893dfe1bbad43901d1bef71b' - let signature_1 = hex::decode("fd34aac152ec85a79211c990f308c7e719145e2e67e48f2d10db4347d3a9102131254eccbcd0fe389afad96b88d368192b33649336893dfe1bbad43901d1bef71b").unwrap(); + // > await (new ethers.Wallet('0x4a599de3915f404d84a2ebe522bfe7032ebb1ca76a65b55d6eb212b129043a0e')).signMessage(ethers.utils.arrayify('0x5c2b4cbafdd7319d9a3dea4aa078748ae53368e1521494a80cf4259b9c6dba6a')) + // '0xfa8d61da2e0ac6f32c8432e75770d90483613efe96b442fbca9ca8d200447bf979f46529c7341879333a9c24a7d3fba08b53d13447618b71cf2ee4734e82f96e1c' + let signature_1 = hex::decode("fa8d61da2e0ac6f32c8432e75770d90483613efe96b442fbca9ca8d200447bf979f46529c7341879333a9c24a7d3fba08b53d13447618b71cf2ee4734e82f96e1c").unwrap(); // Validator 2: // Address: 0x28b8d0E2bBfeDe9071F8Ff3DaC9CcE3d3176DBd3 // Private Key: 0x2cc76d56db9924ddc3388164454dfea9edd2d5f5da81102fd3594fc7c5281515 let validator_2 = H160::from_str("0x28b8d0E2bBfeDe9071F8Ff3DaC9CcE3d3176DBd3").unwrap(); - // > await (new ethers.Wallet('0x2cc76d56db9924ddc3388164454dfea9edd2d5f5da81102fd3594fc7c5281515')).signMessage(ethers.utils.arrayify('0x4fc33ff33d5e9305a2d87f7824d1b943ba219cff4c153ae8fd39b0d8620fc332')) - // '0x85992e471002c40730d2b91831ba40cd8ffcebf4905646c25b7b6abb7575f25d19395045466e833b7700e233bfa5836f0a459da05bf817efd6cb4f55bcaec4b51c' - let signature_2 = hex::decode("85992e471002c40730d2b91831ba40cd8ffcebf4905646c25b7b6abb7575f25d19395045466e833b7700e233bfa5836f0a459da05bf817efd6cb4f55bcaec4b51c").unwrap(); + // > await (new ethers.Wallet('0x2cc76d56db9924ddc3388164454dfea9edd2d5f5da81102fd3594fc7c5281515')).signMessage(ethers.utils.arrayify('0x5c2b4cbafdd7319d9a3dea4aa078748ae53368e1521494a80cf4259b9c6dba6a')) + // '0x6c60c3744f6bf779017b8ab9aa8eed60bf53c317cf4d74d765015cc0a7dcad783dee39334bfc7e4baab944355914e7431e4286df8c0557a0c1f6ba867677da421b' + let signature_2 = hex::decode("6c60c3744f6bf779017b8ab9aa8eed60bf53c317cf4d74d765015cc0a7dcad783dee39334bfc7e4baab944355914e7431e4286df8c0557a0c1f6ba867677da421b").unwrap(); MultisigIsmTestData { message, diff --git a/rust/sealevel/libraries/serializable-account-meta/src/lib.rs b/rust/sealevel/libraries/serializable-account-meta/src/lib.rs index 1153f9975f..5d2df76447 100644 --- a/rust/sealevel/libraries/serializable-account-meta/src/lib.rs +++ b/rust/sealevel/libraries/serializable-account-meta/src/lib.rs @@ -29,7 +29,7 @@ impl From for AccountMeta { } } -/// A ridiculous workaround for https://github.com/solana-labs/solana/issues/31391, +/// A ridiculous workaround for ``, /// which is a bug where if a simulated transaction's return data ends with zero byte(s), /// they end up being incorrectly truncated. /// As a workaround, we can (de)serialize data with a trailing non-zero byte. diff --git a/rust/sealevel/libraries/test-utils/src/igp.rs b/rust/sealevel/libraries/test-utils/src/igp.rs index 688928e9dc..70e5100067 100644 --- a/rust/sealevel/libraries/test-utils/src/igp.rs +++ b/rust/sealevel/libraries/test-utils/src/igp.rs @@ -74,9 +74,9 @@ pub async fn initialize_igp_program( Pubkey::find_program_address(igp_program_data_pda_seeds!(), &program_id); // Accounts: - // 0. [executable] The system program. - // 1. [signer] The payer account. - // 2. [writeable] The program data account. + // 0. `[executable]` The system program. + // 1. `[signer]` The payer account. + // 2. `[writeable]` The program data account. let init_instruction = Instruction::new_with_borsh( program_id, &IgpInstruction::Init, @@ -104,9 +104,9 @@ pub async fn initialize_igp( let (igp_key, igp_bump_seed) = Pubkey::find_program_address(igp_pda_seeds!(salt), &program_id); // Accounts: - // 0. [executable] The system program. - // 1. [signer] The payer account. - // 2. [writeable] The IGP account to initialize. + // 0. `[executable]` The system program. + // 1. `[signer]` The payer account. + // 2. `[writeable]` The IGP account to initialize. let init_instruction = Instruction::new_with_borsh( program_id, &IgpInstruction::InitIgp(InitIgp { @@ -139,9 +139,9 @@ pub async fn initialize_overhead_igp( Pubkey::find_program_address(overhead_igp_pda_seeds!(salt), &program_id); // Accounts: - // 0. [executable] The system program. - // 1. [signer] The payer account. - // 2. [writeable] The Overhead IGP account to initialize. + // 0. `[executable]` The system program. + // 1. `[signer]` The payer account. + // 2. `[writeable]` The Overhead IGP account to initialize. let init_instruction = Instruction::new_with_borsh( program_id, &IgpInstruction::InitOverheadIgp(InitOverheadIgp { salt, owner, inner }), diff --git a/rust/sealevel/programs/helloworld/src/instruction.rs b/rust/sealevel/programs/helloworld/src/instruction.rs index 5c0a42edac..4b3bbb6596 100644 --- a/rust/sealevel/programs/helloworld/src/instruction.rs +++ b/rust/sealevel/programs/helloworld/src/instruction.rs @@ -71,9 +71,9 @@ pub fn init_instruction( }; // Accounts: - // 0. [executable] System program. - // 1. [signer] Payer. - // 2. [writeable] Storage PDA. + // 0. `[executable]` System program. + // 1. `[signer]` Payer. + // 2. `[writeable]` Storage PDA. let accounts = vec![ AccountMeta::new_readonly(solana_program::system_program::id(), false), AccountMeta::new_readonly(payer, true), @@ -100,9 +100,9 @@ pub fn enroll_remote_routers_instruction( .ok_or(ProgramError::InvalidSeeds)?; // Accounts: - // 0. [executable] System program. - // 1. [signer] Payer. - // 2. [writeable] Storage PDA. + // 0. `[executable]` System program. + // 1. `[signer]` Payer. + // 2. `[writeable]` Storage PDA. let accounts = vec![ AccountMeta::new_readonly(solana_program::system_program::id(), false), AccountMeta::new(program_storage_account, false), @@ -129,8 +129,8 @@ pub fn set_interchain_security_module_instruction( .ok_or(ProgramError::InvalidSeeds)?; // Accounts: - // 0. [writeable] Storage PDA account. - // 1. [signer] Owner. + // 0. `[writeable]` Storage PDA account. + // 1. `[signer]` Owner. let accounts = vec![ AccountMeta::new(program_storage_account, false), AccountMeta::new(owner, true), diff --git a/rust/sealevel/programs/helloworld/src/processor.rs b/rust/sealevel/programs/helloworld/src/processor.rs index 4e1fdcd924..48ca4119fb 100644 --- a/rust/sealevel/programs/helloworld/src/processor.rs +++ b/rust/sealevel/programs/helloworld/src/processor.rs @@ -103,9 +103,9 @@ pub fn process_instruction( /// Creates the storage PDA. /// /// Accounts: -/// 0. [executable] System program. -/// 1. [signer] Payer. -/// 2. [writeable] Storage PDA. +/// 0. `[executable]` System program. +/// 1. `[signer]` Payer. +/// 2. `[writeable]` Storage PDA. fn init(program_id: &Pubkey, accounts: &[AccountInfo], init: Init) -> ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -155,22 +155,22 @@ fn init(program_id: &Pubkey, accounts: &[AccountInfo], init: Init) -> ProgramRes /// Dispatches a message using the dispatch authority. /// /// Accounts: -/// 0. [writeable] Program storage. -/// 1. [executable] The Mailbox program. -/// 2. [writeable] Outbox PDA. -/// 3. [] This program's dispatch authority. -/// 4. [executable] System program. -/// 5. [executable] SPL Noop program. -/// 6. [signer] Payer. -/// 7. [signer] Unique message account. -/// 8. [writeable] Dispatched message PDA. An empty message PDA relating to the seeds +/// 0. `[writeable]` Program storage. +/// 1. `[executable]` The Mailbox program. +/// 2. `[writeable]` Outbox PDA. +/// 3. `[]` This program's dispatch authority. +/// 4. `[executable]` System program. +/// 5. `[executable]` SPL Noop program. +/// 6. `[signer]` Payer. +/// 7. `[signer]` Unique message account. +/// 8. `[writeable]` Dispatched message PDA. An empty message PDA relating to the seeds /// `mailbox_dispatched_message_pda_seeds` where the message contents will be stored. /// ---- if an IGP is configured ---- -/// 9. [executable] The IGP program. -/// 10. [writeable] The IGP program data. -/// 11. [writeable] The gas payment PDA. -/// 12. [] OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. -/// 13. [writeable] The IGP account. +/// 9. `[executable]` The IGP program. +/// 10. `[writeable]` The IGP program data. +/// 11. `[writeable]` The gas payment PDA. +/// 12. `[]` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. +/// 13. `[writeable]` The IGP account. /// ---- end if an IGP is configured ---- fn send_hello_world( program_id: &Pubkey, @@ -261,13 +261,13 @@ fn send_hello_world( // Accounts expected by the IGP's `PayForGas` instruction: // - // 0. [executable] The system program. - // 1. [signer] The payer. - // 2. [writeable] The IGP program data. - // 3. [signer] Unique gas payment account. - // 4. [writeable] Gas payment PDA. - // 5. [writeable] The IGP account. - // 6. [] Overhead IGP account (optional). + // 0. `[executable]` The system program. + // 1. `[signer]` The payer. + // 2. `[writeable]` The IGP program data. + // 3. `[signer]` Unique gas payment account. + // 4. `[writeable]` Gas payment PDA. + // 5. `[writeable]` The IGP account. + // 6. `[]` Overhead IGP account (optional). let mut igp_payment_account_metas = vec![ AccountMeta::new_readonly(solana_program::system_program::id(), false), @@ -355,8 +355,8 @@ fn send_hello_world( /// Handles a message. /// /// Accounts: -/// 0. [writeable] Process authority specific to this program. -/// 1. [] Storage PDA account. +/// 0. `[writeable]` Process authority specific to this program. +/// 1. `[]` Storage PDA account. pub fn handle( program_id: &Pubkey, accounts: &[AccountInfo], @@ -412,8 +412,8 @@ pub fn handle( } /// Accounts: -/// 0. [writeable] Storage PDA account. -/// 1. [signer] Owner. +/// 0. `[writeable]` Storage PDA account. +/// 1. `[signer]` Owner. fn set_interchain_security_module( program_id: &Pubkey, accounts: &[AccountInfo], @@ -445,7 +445,7 @@ fn set_interchain_security_module( } /// Accounts: -/// 0. [] Storage PDA account. +/// 0. `[]` Storage PDA account. fn get_interchain_security_module(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -491,9 +491,9 @@ fn set_account_meta_return_data(program_id: &Pubkey) -> ProgramResult { /// Enrolls remote routers. /// /// Accounts: -/// 0. [executable] System program. -/// 1. [writeable] Storage PDA account. -/// 2. [signer] Owner. +/// 0. `[executable]` System program. +/// 1. `[writeable]` Storage PDA account. +/// 2. `[signer]` Owner. fn enroll_remote_routers( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/rust/sealevel/programs/hyperlane-sealevel-igp-test/src/functional.rs b/rust/sealevel/programs/hyperlane-sealevel-igp-test/src/functional.rs index 0a3e6c962a..a7820019ac 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-igp-test/src/functional.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-igp-test/src/functional.rs @@ -66,9 +66,9 @@ async fn initialize( Pubkey::find_program_address(igp_program_data_pda_seeds!(), &program_id); // Accounts: - // 0. [executable] The system program. - // 1. [signer] The payer account. - // 2. [writeable] The program data account. + // 0. `[executable]` The system program. + // 1. `[signer]` The payer account. + // 2. `[writeable]` The program data account. let init_instruction = Instruction::new_with_borsh( program_id, &IgpInstruction::Init, @@ -96,9 +96,9 @@ async fn initialize_igp( let (igp_key, igp_bump_seed) = Pubkey::find_program_address(igp_pda_seeds!(salt), &program_id); // Accounts: - // 0. [executable] The system program. - // 1. [signer] The payer account. - // 2. [writeable] The IGP account to initialize. + // 0. `[executable]` The system program. + // 1. `[signer]` The payer account. + // 2. `[writeable]` The IGP account to initialize. let init_instruction = Instruction::new_with_borsh( program_id, &IgpInstruction::InitIgp(InitIgp { @@ -131,9 +131,9 @@ async fn initialize_overhead_igp( Pubkey::find_program_address(overhead_igp_pda_seeds!(salt), &program_id); // Accounts: - // 0. [executable] The system program. - // 1. [signer] The payer account. - // 2. [writeable] The Overhead IGP account to initialize. + // 0. `[executable]` The system program. + // 1. `[signer]` The payer account. + // 2. `[writeable]` The Overhead IGP account to initialize. let init_instruction = Instruction::new_with_borsh( program_id, &IgpInstruction::InitOverheadIgp(InitOverheadIgp { salt, owner, inner }), @@ -438,9 +438,9 @@ async fn test_set_gas_oracle_configs() { ]; // Accounts: - // 0. [executable] The system program. - // 1. [writeable] The IGP. - // 2. [signer] The IGP owner. + // 0. `[executable]` The system program. + // 1. `[writeable]` The IGP. + // 2. `[signer]` The IGP owner. let instruction = Instruction::new_with_borsh( program_id, &IgpInstruction::SetGasOracleConfigs(configs.clone()), @@ -536,9 +536,9 @@ async fn test_set_gas_oracle_configs_errors_if_owner_not_signer() { }]; // Accounts: - // 0. [executable] The system program. - // 1. [writeable] The IGP. - // 2. [signer] The IGP owner. + // 0. `[executable]` The system program. + // 1. `[writeable]` The IGP. + // 2. `[signer]` The IGP owner. // Try with the correct owner passed in, but it's not a signer let instruction = Instruction::new_with_borsh( @@ -600,9 +600,9 @@ async fn test_set_destination_gas_overheads() { ]; // Accounts: - // 0. [executable] The system program. - // 1. [writeable] The Overhead IGP. - // 2. [signer] The Overhead IGP owner. + // 0. `[executable]` The system program. + // 1. `[writeable]` The Overhead IGP. + // 2. `[signer]` The Overhead IGP owner. let instruction = Instruction::new_with_borsh( program_id, &IgpInstruction::SetDestinationGasOverheads(configs.clone()), @@ -698,9 +698,9 @@ async fn test_set_destination_gas_overheads_errors_if_owner_not_signer() { }]; // Accounts: - // 0. [executable] The system program. - // 1. [writeable] The Overhead IGP. - // 2. [signer] The Overhead IGP owner. + // 0. `[executable]` The system program. + // 1. `[writeable]` The Overhead IGP. + // 2. `[signer]` The Overhead IGP owner. // Try with the correct owner passed in, but it's not a signer let instruction = Instruction::new_with_borsh( @@ -986,13 +986,13 @@ async fn pay_for_gas( &program_id, ); - // 0. [executable] The system program. - // 1. [signer] The payer. - // 2. [writeable] The IGP program data. - // 3. [signer] Unique gas payment account. - // 4. [writeable] Gas payment PDA. - // 5. [writeable] The IGP account. - // 6. [] Overhead IGP account (optional). + // 0. `[executable]` The system program. + // 1. `[signer]` The payer. + // 2. `[writeable]` The IGP program data. + // 3. `[signer]` Unique gas payment account. + // 4. `[writeable]` Gas payment PDA. + // 5. `[writeable]` The IGP account. + // 6. `[]` Overhead IGP account (optional). let mut accounts = vec![ AccountMeta::new_readonly(system_program::id(), false), AccountMeta::new(payer.pubkey(), true), @@ -1301,9 +1301,9 @@ async fn test_claim() { let beneficiary_balance_before = banks_client.get_balance(payer.pubkey()).await.unwrap(); // Accounts: - // 0. [executable] The system program. - // 1. [writeable] The IGP. - // 2. [writeable] The IGP beneficiary. + // 0. `[executable]` The system program. + // 1. `[writeable]` The IGP. + // 2. `[writeable]` The IGP beneficiary. process_instruction( &mut banks_client, Instruction::new_with_borsh( @@ -1357,8 +1357,8 @@ async fn test_set_igp_beneficiary() { let new_beneficiary = Pubkey::new_unique(); // Accounts: - // 0. [] The IGP. - // 1. [signer] The owner of the IGP account. + // 0. `[]` The IGP. + // 1. `[signer]` The owner of the IGP account. let instruction = Instruction::new_with_borsh( program_id, &IgpInstruction::SetIgpBeneficiary(new_beneficiary), @@ -1403,8 +1403,8 @@ async fn test_set_igp_beneficiary_errors_if_owner_not_signer() { .unwrap(); // Accounts: - // 0. [] The IGP. - // 1. [signer] The owner of the IGP account. + // 0. `[]` The IGP. + // 1. `[signer]` The owner of the IGP account. // Try with the right owner passed in, but it's not a signer let instruction = Instruction::new_with_borsh( @@ -1448,8 +1448,8 @@ async fn run_transfer_ownership_tests ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -147,9 +147,9 @@ fn init(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { /// Initialize a new IGP account. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [signer] The payer account. -/// 2. [writeable] The IGP account to initialize. +/// 0. `[executable]` The system program. +/// 1. `[signer]` The payer account. +/// 2. `[writeable]` The IGP account to initialize. fn init_igp(program_id: &Pubkey, accounts: &[AccountInfo], data: InitIgp) -> ProgramResult { let igp_key = init_igp_variant( program_id, @@ -175,9 +175,9 @@ fn init_igp(program_id: &Pubkey, accounts: &[AccountInfo], data: InitIgp) -> Pro /// Initialize a new overhead IGP account. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [signer] The payer account. -/// 2. [writeable] The Overhead IGP account to initialize. +/// 0. `[executable]` The system program. +/// 1. `[signer]` The payer account. +/// 2. `[writeable]` The Overhead IGP account to initialize. fn init_overhead_igp( program_id: &Pubkey, accounts: &[AccountInfo], @@ -258,13 +258,13 @@ fn init_igp_variant( /// Pay for gas. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [signer] The payer. -/// 2. [writeable] The IGP program data. -/// 3. [signer] Unique gas payment account. -/// 4. [writeable] Gas payment PDA. -/// 5. [writeable] The IGP account. -/// 6. [] Overhead IGP account (optional). +/// 0. `[executable]` The system program. +/// 1. `[signer]` The payer. +/// 2. `[writeable]` The IGP program data. +/// 3. `[signer]` Unique gas payment account. +/// 4. `[writeable]` Gas payment PDA. +/// 5. `[writeable]` The IGP account. +/// 6. `[]` Overhead IGP account (optional). fn pay_for_gas(program_id: &Pubkey, accounts: &[AccountInfo], payment: PayForGas) -> ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -407,9 +407,9 @@ fn pay_for_gas(program_id: &Pubkey, accounts: &[AccountInfo], payment: PayForGas /// Quotes the required payment for a given gas amount and destination domain. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [] The IGP account. -/// 2. [] The overhead IGP account (optional). +/// 0. `[executable]` The system program. +/// 1. `[]` The IGP account. +/// 2. `[]` The overhead IGP account (optional). fn quote_gas_payment( program_id: &Pubkey, accounts: &[AccountInfo], @@ -463,8 +463,8 @@ fn quote_gas_payment( /// Sets the beneficiary of an IGP. /// /// Accounts: -/// 0. [] The IGP. -/// 1. [signer] The owner of the IGP account. +/// 0. `[]` The IGP. +/// 1. `[signer]` The owner of the IGP account. fn set_igp_beneficiary( program_id: &Pubkey, accounts: &[AccountInfo], @@ -485,8 +485,8 @@ fn set_igp_beneficiary( /// Transfers ownership of an IGP variant. /// /// Accounts: -/// 0. [writeable] The IGP or OverheadIGP. -/// 1. [signer] The owner of the IGP account. +/// 0. `[writeable]` The IGP or OverheadIGP. +/// 1. `[signer]` The owner of the IGP account. fn transfer_igp_variant_ownership( program_id: &Pubkey, accounts: &[AccountInfo], @@ -506,8 +506,8 @@ fn transfer_igp_variant_ownership ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -583,9 +583,9 @@ fn claim(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { /// Sets destination gas overheads for an OverheadIGP. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writeable] The OverheadIGP. -/// 2. [signer] The OverheadIGP owner. +/// 0. `[executable]` The system program. +/// 1. `[writeable]` The OverheadIGP. +/// 2. `[signer]` The OverheadIGP owner. fn set_destination_gas_overheads( program_id: &Pubkey, accounts: &[AccountInfo], @@ -629,9 +629,9 @@ fn set_destination_gas_overheads( /// Sets gas oracle configs for an IGP. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writeable] The IGP. -/// 2. [signer] The IGP owner. +/// 0. `[executable]` The system program. +/// 1. `[writeable]` The IGP. +/// 2. `[signer]` The IGP owner. fn set_gas_oracle_configs( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/instruction.rs b/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/instruction.rs index df0d434fc8..3f3d0af86d 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/instruction.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/instruction.rs @@ -23,11 +23,11 @@ pub fn init_instruction( let mut instruction = lib_init_instruction(program_id, payer, init)?; // Add additional account metas: - // 0. [executable] The SPL token program for the mint, i.e. either SPL token program or the 2022 version. - // 1. [] The mint. - // 2. [executable] The Rent sysvar program. - // 3. [writable] The escrow PDA account. - // 4. [writable] The ATA payer PDA account. + // 0. `[executable]` The SPL token program for the mint, i.e. either SPL token program or the 2022 version. + // 1. `[]` The mint. + // 2. `[executable]` The Rent sysvar program. + // 3. `[writable]` The escrow PDA account. + // 4. `[writable]` The ATA payer PDA account. let (escrow_key, _escrow_bump) = Pubkey::find_program_address(hyperlane_token_escrow_pda_seeds!(), &program_id); diff --git a/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/plugin.rs b/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/plugin.rs index 81b867b904..0fc224667e 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/plugin.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/plugin.rs @@ -100,11 +100,11 @@ impl HyperlaneSealevelTokenPlugin for CollateralPlugin { /// Initializes the plugin. /// /// Accounts: - /// 0. [executable] The SPL token program for the mint, i.e. either SPL token program or the 2022 version. - /// 1. [] The mint. - /// 2. [executable] The Rent sysvar program. - /// 3. [writable] The escrow PDA account. - /// 4. [writable] The ATA payer PDA account. + /// 0. `[executable]` The SPL token program for the mint, i.e. either SPL token program or the 2022 version. + /// 1. `[]` The mint. + /// 2. `[executable]` The Rent sysvar program. + /// 3. `[writable]` The escrow PDA account. + /// 4. `[writable]` The ATA payer PDA account. fn initialize<'a, 'b>( program_id: &Pubkey, system_program: &'a AccountInfo<'b>, @@ -232,10 +232,10 @@ impl HyperlaneSealevelTokenPlugin for CollateralPlugin { /// Burns the tokens from the sender's associated token account. /// /// Accounts: - /// 0. [executable] The SPL token program for the mint. - /// 1. [writeable] The mint. - /// 2. [writeable] The token sender's associated token account, from which tokens will be sent. - /// 3. [writeable] The escrow PDA account. + /// 0. `[executable]` The SPL token program for the mint. + /// 1. `[writeable]` The mint. + /// 2. `[writeable]` The token sender's associated token account, from which tokens will be sent. + /// 3. `[writeable]` The escrow PDA account. fn transfer_in<'a, 'b>( _program_id: &Pubkey, token: &HyperlaneToken, @@ -308,12 +308,12 @@ impl HyperlaneSealevelTokenPlugin for CollateralPlugin { /// result of a transfer to this chain from a remote chain. /// /// Accounts: - /// 0. [executable] SPL token for the mint. - /// 1. [executable] SPL associated token account. - /// 2. [writeable] Mint account. - /// 3. [writeable] Recipient associated token account. - /// 4. [writeable] ATA payer PDA account. - /// 5. [writeable] Escrow account. + /// 0. `[executable]` SPL token for the mint. + /// 1. `[executable]` SPL associated token account. + /// 2. `[writeable]` Mint account. + /// 3. `[writeable]` Recipient associated token account. + /// 4. `[writeable]` ATA payer PDA account. + /// 5. `[writeable]` Escrow account. fn transfer_out<'a, 'b>( program_id: &Pubkey, token: &HyperlaneToken, diff --git a/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/processor.rs b/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/processor.rs index 09546028b8..e9dff90ee0 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/processor.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token-collateral/src/processor.rs @@ -89,15 +89,15 @@ pub fn process_instruction( /// Initializes the program. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writable] The token PDA account. -/// 2. [writable] The dispatch authority PDA account. -/// 3. [signer] The payer and access control owner of the program. -/// 4. [executable] The SPL token program for the mint, i.e. either SPL token program or the 2022 version. -/// 5. [] The mint. -/// 6. [executable] The Rent sysvar program. -/// 7. [writable] The escrow PDA account. -/// 8. [writable] The ATA payer PDA account. +/// 0. `[executable]` The system program. +/// 1. `[writable]` The token PDA account. +/// 2. `[writable]` The dispatch authority PDA account. +/// 3. `[signer]` The payer and access control owner of the program. +/// 4. `[executable]` The SPL token program for the mint, i.e. either SPL token program or the 2022 version. +/// 5. `[]` The mint. +/// 6. `[executable]` The Rent sysvar program. +/// 7. `[writable]` The escrow PDA account. +/// 8. `[writable]` The ATA payer PDA account. fn initialize(program_id: &Pubkey, accounts: &[AccountInfo], init: Init) -> ProgramResult { HyperlaneSealevelToken::::initialize(program_id, accounts, init) } @@ -107,26 +107,26 @@ fn initialize(program_id: &Pubkey, accounts: &[AccountInfo], init: Init) -> Prog /// then dispatches a message to the remote recipient. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [executable] The spl_noop program. -/// 2. [] The token PDA account. -/// 3. [executable] The mailbox program. -/// 4. [writeable] The mailbox outbox account. -/// 5. [] Message dispatch authority. -/// 6. [signer] The token sender and mailbox payer. -/// 7. [signer] Unique message / gas payment account. -/// 8. [writeable] Message storage PDA. +/// 0. `[executable]` The system program. +/// 1. `[executable]` The spl_noop program. +/// 2. `[]` The token PDA account. +/// 3. `[executable]` The mailbox program. +/// 4. `[writeable]` The mailbox outbox account. +/// 5. `[]` Message dispatch authority. +/// 6. `[signer]` The token sender and mailbox payer. +/// 7. `[signer]` Unique message / gas payment account. +/// 8. `[writeable]` Message storage PDA. /// ---- If using an IGP ---- -/// 9. [executable] The IGP program. -/// 10. [writeable] The IGP program data. -/// 11. [writeable] Gas payment PDA. -/// 12. [] OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. -/// 13. [writeable] The IGP account. +/// 9. `[executable]` The IGP program. +/// 10. `[writeable]` The IGP program data. +/// 11. `[writeable]` Gas payment PDA. +/// 12. `[]` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. +/// 13. `[writeable]` The IGP account. /// ---- End if ---- -/// 14. [executable] The SPL token program for the mint. -/// 15. [writeable] The mint. -/// 16. [writeable] The token sender's associated token account, from which tokens will be sent. -/// 17. [writeable] The escrow PDA account. +/// 14. `[executable]` The SPL token program for the mint. +/// 15. `[writeable]` The mint. +/// 16. `[writeable]` The token sender's associated token account, from which tokens will be sent. +/// 17. `[writeable]` The escrow PDA account. fn transfer_remote( program_id: &Pubkey, accounts: &[AccountInfo], @@ -136,16 +136,16 @@ fn transfer_remote( } // Accounts: -// 0. [signer] Mailbox process authority specific to this program. -// 1. [executable] system_program -// 2. [] hyperlane_token storage -// 3. [] recipient wallet address -// 4. [executable] SPL token 2022 program. -// 5. [executable] SPL associated token account. -// 6. [writeable] Mint account. -// 7. [writeable] Recipient associated token account. -// 8. [writeable] ATA payer PDA account. -// 9. [writeable] Escrow account. +// 0. `[signer]` Mailbox process authority specific to this program. +// 1. `[executable]` system_program +// 2. `[]` hyperlane_token storage +// 3. `[]` recipient wallet address +// 4. `[executable]` SPL token 2022 program. +// 5. `[executable]` SPL associated token account. +// 6. `[writeable]` Mint account. +// 7. `[writeable]` Recipient associated token account. +// 8. `[writeable]` ATA payer PDA account. +// 9. `[writeable]` Escrow account. fn transfer_from_remote( program_id: &Pubkey, accounts: &[AccountInfo], @@ -171,9 +171,9 @@ fn transfer_from_remote_account_metas( /// Enrolls a remote router. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writeable] The token PDA account. -/// 2. [signer] The owner. +/// 0. `[executable]` The system program. +/// 1. `[writeable]` The token PDA account. +/// 2. `[signer]` The owner. fn enroll_remote_router( program_id: &Pubkey, accounts: &[AccountInfo], @@ -185,9 +185,9 @@ fn enroll_remote_router( /// Enrolls remote routers. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writeable] The token PDA account. -/// 2. [signer] The owner. +/// 0. `[executable]` The system program. +/// 1. `[writeable]` The token PDA account. +/// 2. `[signer]` The owner. fn enroll_remote_routers( program_id: &Pubkey, accounts: &[AccountInfo], @@ -199,9 +199,9 @@ fn enroll_remote_routers( /// Sets the destination gas configs. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writeable] The token PDA account. -/// 2. [signer] The owner. +/// 0. `[executable]` The system program. +/// 1. `[writeable]` The token PDA account. +/// 2. `[signer]` The owner. fn set_destination_gas_configs( program_id: &Pubkey, accounts: &[AccountInfo], @@ -215,8 +215,8 @@ fn set_destination_gas_configs( /// Transfers ownership. /// /// Accounts: -/// 0. [writeable] The token PDA account. -/// 1. [signer] The current owner. +/// 0. `[writeable]` The token PDA account. +/// 1. `[signer]` The current owner. fn transfer_ownership( program_id: &Pubkey, accounts: &[AccountInfo], @@ -228,7 +228,7 @@ fn transfer_ownership( /// Gets the interchain security module, returning it as a serialized Option. /// /// Accounts: -/// 0. [] The token PDA account. +/// 0. `[]` The token PDA account. fn interchain_security_module(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { HyperlaneSealevelToken::::interchain_security_module(program_id, accounts) } @@ -244,8 +244,8 @@ fn interchain_security_module_account_metas(program_id: &Pubkey) -> ProgramResul /// Lets the owner set the interchain security module. /// /// Accounts: -/// 0. [writeable] The token PDA account. -/// 1. [signer] The access control owner. +/// 0. `[writeable]` The token PDA account. +/// 1. `[signer]` The access control owner. fn set_interchain_security_module( program_id: &Pubkey, accounts: &[AccountInfo], @@ -259,8 +259,8 @@ fn set_interchain_security_module( /// Lets the owner set the interchain gas paymaster. /// /// Accounts: -/// 0. [writeable] The token PDA account. -/// 1. [signer] The access control owner. +/// 0. `[writeable]` The token PDA account. +/// 1. `[signer]` The access control owner. fn set_interchain_gas_paymaster( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/rust/sealevel/programs/hyperlane-sealevel-token-collateral/tests/functional.rs b/rust/sealevel/programs/hyperlane-sealevel-token-collateral/tests/functional.rs index 7ac4bd8e20..0f5e33f4df 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token-collateral/tests/functional.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token-collateral/tests/functional.rs @@ -299,15 +299,15 @@ async fn initialize_hyperlane_token( .encode() .unwrap(), vec![ - // 0. [executable] The system program. - // 1. [writable] The token PDA account. - // 2. [writable] The dispatch authority PDA account. - // 3. [signer] The payer. - // 4. [executable] The SPL token program for the mint, i.e. either SPL token program or the 2022 version. - // 5. [] The mint. - // 6. [executable] The Rent sysvar program. - // 7. [writable] The escrow PDA account. - // 8. [writable] The ATA payer PDA account. + // 0. `[executable]` The system program. + // 1. `[writable]` The token PDA account. + // 2. `[writable]` The dispatch authority PDA account. + // 3. `[signer]` The payer. + // 4. `[executable]` The SPL token program for the mint, i.e. either SPL token program or the 2022 version. + // 5. `[]` The mint. + // 6. `[executable]` The Rent sysvar program. + // 7. `[writable]` The escrow PDA account. + // 8. `[writable]` The ATA payer PDA account. AccountMeta::new_readonly(solana_program::system_program::id(), false), AccountMeta::new(token_account_key, false), AccountMeta::new(dispatch_authority_key, false), @@ -642,26 +642,26 @@ async fn test_transfer_remote(spl_token_program_id: Pubkey) { }) .encode() .unwrap(), - // 0. [executable] The system program. - // 1. [executable] The spl_noop program. - // 2. [] The token PDA account. - // 3. [executable] The mailbox program. - // 4. [writeable] The mailbox outbox account. - // 5. [] Message dispatch authority. - // 6. [signer] The token sender and mailbox payer. - // 7. [signer] Unique message account. - // 8. [writeable] Message storage PDA. + // 0. `[executable]` The system program. + // 1. `[executable]` The spl_noop program. + // 2. `[]` The token PDA account. + // 3. `[executable]` The mailbox program. + // 4. `[writeable]` The mailbox outbox account. + // 5. `[]` Message dispatch authority. + // 6. `[signer]` The token sender and mailbox payer. + // 7. `[signer]` Unique message account. + // 8. `[writeable]` Message storage PDA. // ---- If using an IGP ---- - // 9. [executable] The IGP program. - // 10. [writeable] The IGP program data. - // 11. [writeable] Gas payment PDA. - // 12. [] OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. - // 13. [writeable] The IGP account. + // 9. `[executable]` The IGP program. + // 10. `[writeable]` The IGP program data. + // 11. `[writeable]` Gas payment PDA. + // 12. `[]` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. + // 13. `[writeable]` The IGP account. // ---- End if ---- - // 14. [executable] The spl_token_2022 program. - // 15. [writeable] The mint. - // 16. [writeable] The token sender's associated token account, from which tokens will be sent. - // 17. [writeable] The escrow PDA account. + // 14. `[executable]` The spl_token_2022 program. + // 15. `[writeable]` The mint. + // 16. `[writeable]` The token sender's associated token account, from which tokens will be sent. + // 17. `[writeable]` The escrow PDA account. vec![ AccountMeta::new_readonly(solana_program::system_program::id(), false), AccountMeta::new_readonly(spl_noop::id(), false), @@ -725,7 +725,7 @@ async fn test_transfer_remote(spl_token_program_id: Pubkey) { .unwrap(); let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: LOCAL_DOMAIN, sender: program_id.to_bytes().into(), @@ -869,7 +869,7 @@ async fn transfer_from_remote( ); let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: origin_override.unwrap_or(REMOTE_DOMAIN), // Default to the remote router as the sender @@ -1084,16 +1084,16 @@ async fn test_transfer_from_remote_errors_if_process_authority_not_signer() { .unwrap(), vec![ // Recipient.handle accounts - // 0. [signer] Mailbox process authority - // 1. [executable] system_program - // 2. [] hyperlane_token storage - // 3. [] recipient wallet address - // 4. [executable] SPL token 2022 program. - // 5. [executable] SPL associated token account. - // 6. [writeable] Mint account. - // 7. [writeable] Recipient associated token account. - // 8. [writeable] ATA payer PDA account. - // 9. [writeable] Escrow account. + // 0. `[signer]` Mailbox process authority + // 1. `[executable]` system_program + // 2. `[]` hyperlane_token storage + // 3. `[]` recipient wallet address + // 4. `[executable]` SPL token 2022 program. + // 5. `[executable]` SPL associated token account. + // 6. `[writeable]` Mint account. + // 7. `[writeable]` Recipient associated token account. + // 8. `[writeable]` ATA payer PDA account. + // 9. `[writeable]` Escrow account. AccountMeta::new_readonly( hyperlane_token_accounts.mailbox_process_authority, false, diff --git a/rust/sealevel/programs/hyperlane-sealevel-token-native/src/instruction.rs b/rust/sealevel/programs/hyperlane-sealevel-token-native/src/instruction.rs index 356d176b09..2cc12149f7 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token-native/src/instruction.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token-native/src/instruction.rs @@ -19,7 +19,7 @@ pub fn init_instruction( let mut instruction = lib_init_instruction(program_id, payer, init)?; // Add additional account metas: - // 0. [writable] The native collateral PDA account. + // 0. `[writable]` The native collateral PDA account. let (native_collateral_key, _native_collatera_bump) = Pubkey::find_program_address(hyperlane_token_native_collateral_pda_seeds!(), &program_id); diff --git a/rust/sealevel/programs/hyperlane-sealevel-token-native/src/plugin.rs b/rust/sealevel/programs/hyperlane-sealevel-token-native/src/plugin.rs index 855fa6dcb3..8c553058c0 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token-native/src/plugin.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token-native/src/plugin.rs @@ -76,7 +76,7 @@ impl HyperlaneSealevelTokenPlugin for NativePlugin { /// Initializes the plugin. /// /// Accounts: - /// 0. [writable] The native collateral PDA account. + /// 0. `[writable]` The native collateral PDA account. fn initialize<'a, 'b>( program_id: &Pubkey, system_program: &'a AccountInfo<'b>, @@ -115,8 +115,8 @@ impl HyperlaneSealevelTokenPlugin for NativePlugin { /// Burns the tokens from the sender's associated token account. /// /// Accounts: - /// 0. [executable] The system program. - /// 1. [writeable] The native token collateral PDA account. + /// 0. `[executable]` The system program. + /// 1. `[writeable]` The native token collateral PDA account. fn transfer_in<'a, 'b>( program_id: &Pubkey, token: &HyperlaneToken, @@ -145,8 +145,8 @@ impl HyperlaneSealevelTokenPlugin for NativePlugin { /// result of a transfer to this chain from a remote chain. /// /// Accounts: - /// 0. [executable] The system program. - /// 1. [writeable] The native token collateral PDA account. + /// 0. `[executable]` The system program. + /// 1. `[writeable]` The native token collateral PDA account. fn transfer_out<'a, 'b>( program_id: &Pubkey, token: &HyperlaneToken, diff --git a/rust/sealevel/programs/hyperlane-sealevel-token-native/src/processor.rs b/rust/sealevel/programs/hyperlane-sealevel-token-native/src/processor.rs index ab3121b537..1cbfd072dd 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token-native/src/processor.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token-native/src/processor.rs @@ -89,11 +89,11 @@ pub fn process_instruction( /// Initializes the program. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writable] The token PDA account. -/// 2. [writable] The dispatch authority PDA account. -/// 3. [signer] The payer and mailbox payer. -/// 4. [writable] The native collateral PDA account. +/// 0. `[executable]` The system program. +/// 1. `[writable]` The token PDA account. +/// 2. `[writable]` The dispatch authority PDA account. +/// 3. `[signer]` The payer and mailbox payer. +/// 4. `[writable]` The native collateral PDA account. fn initialize(program_id: &Pubkey, accounts: &[AccountInfo], init: Init) -> ProgramResult { HyperlaneSealevelToken::::initialize(program_id, accounts, init) } @@ -103,24 +103,24 @@ fn initialize(program_id: &Pubkey, accounts: &[AccountInfo], init: Init) -> Prog /// then dispatches a message to the remote recipient. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [executable] The spl_noop program. -/// 2. [] The token PDA account. -/// 3. [executable] The mailbox program. -/// 4. [writeable] The mailbox outbox account. -/// 5. [] Message dispatch authority. -/// 6. [signer] The token sender and mailbox payer. -/// 7. [signer] Unique message / gas payment account. -/// 8. [writeable] Message storage PDA. +/// 0. `[executable]` The system program. +/// 1. `[executable]` The spl_noop program. +/// 2. `[]` The token PDA account. +/// 3. `[executable]` The mailbox program. +/// 4. `[writeable]` The mailbox outbox account. +/// 5. `[]` Message dispatch authority. +/// 6. `[signer]` The token sender and mailbox payer. +/// 7. `[signer]` Unique message / gas payment account. +/// 8. `[writeable]` Message storage PDA. /// ---- If using an IGP ---- -/// 9. [executable] The IGP program. -/// 10. [writeable] The IGP program data. -/// 11. [writeable] Gas payment PDA. -/// 12. [] OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. -/// 13. [writeable] The IGP account. +/// 9. `[executable]` The IGP program. +/// 10. `[writeable]` The IGP program data. +/// 11. `[writeable]` Gas payment PDA. +/// 12. `[]` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. +/// 13. `[writeable]` The IGP account. /// ---- End if ---- -/// 14. [executable] The system program. -/// 15. [writeable] The native token collateral PDA account. +/// 14. `[executable]` The system program. +/// 15. `[writeable]` The native token collateral PDA account. fn transfer_remote( program_id: &Pubkey, accounts: &[AccountInfo], @@ -130,12 +130,12 @@ fn transfer_remote( } /// Accounts: -/// 0. [signer] Mailbox processor authority specific to this program. -/// 1. [executable] system_program -/// 2. [] hyperlane_token storage -/// 3. [writeable] recipient wallet address -/// 4. [executable] The system program. -/// 5. [writeable] The native token collateral PDA account. +/// 0. `[signer]` Mailbox processor authority specific to this program. +/// 1. `[executable]` system_program +/// 2. `[]` hyperlane_token storage +/// 3. `[writeable]` recipient wallet address +/// 4. `[executable]` The system program. +/// 5. `[writeable]` The native token collateral PDA account. fn transfer_from_remote( program_id: &Pubkey, accounts: &[AccountInfo], @@ -161,9 +161,9 @@ fn transfer_from_remote_account_metas( /// Enrolls a remote router. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writeable] The token PDA account. -/// 2. [signer] The owner. +/// 0. `[executable]` The system program. +/// 1. `[writeable]` The token PDA account. +/// 2. `[signer]` The owner. fn enroll_remote_router( program_id: &Pubkey, accounts: &[AccountInfo], @@ -175,9 +175,9 @@ fn enroll_remote_router( /// Enrolls remote routers. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writeable] The token PDA account. -/// 2. [signer] The owner. +/// 0. `[executable]` The system program. +/// 1. `[writeable]` The token PDA account. +/// 2. `[signer]` The owner. fn enroll_remote_routers( program_id: &Pubkey, accounts: &[AccountInfo], @@ -189,9 +189,9 @@ fn enroll_remote_routers( /// Sets the destination gas configs. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writeable] The token PDA account. -/// 2. [signer] The owner. +/// 0. `[executable]` The system program. +/// 1. `[writeable]` The token PDA account. +/// 2. `[signer]` The owner. fn set_destination_gas_configs( program_id: &Pubkey, accounts: &[AccountInfo], @@ -205,8 +205,8 @@ fn set_destination_gas_configs( /// Transfers ownership. /// /// Accounts: -/// 0. [writeable] The token PDA account. -/// 1. [signer] The current owner. +/// 0. `[writeable]` The token PDA account. +/// 1. `[signer]` The current owner. fn transfer_ownership( program_id: &Pubkey, accounts: &[AccountInfo], @@ -218,7 +218,7 @@ fn transfer_ownership( /// Gets the interchain security module, returning it as a serialized Option. /// /// Accounts: -/// 0. [] The token PDA account. +/// 0. `[]` The token PDA account. fn interchain_security_module(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { HyperlaneSealevelToken::::interchain_security_module(program_id, accounts) } @@ -234,8 +234,8 @@ fn interchain_security_module_account_metas(program_id: &Pubkey) -> ProgramResul /// Lets the owner set the interchain security module. /// /// Accounts: -/// 0. [writeable] The token PDA account. -/// 1. [signer] The access control owner. +/// 0. `[writeable]` The token PDA account. +/// 1. `[signer]` The access control owner. fn set_interchain_security_module( program_id: &Pubkey, accounts: &[AccountInfo], @@ -249,8 +249,8 @@ fn set_interchain_security_module( /// Lets the owner set the interchain gas paymaster. /// /// Accounts: -/// 0. [writeable] The token PDA account. -/// 1. [signer] The access control owner. +/// 0. `[writeable]` The token PDA account. +/// 1. `[signer]` The access control owner. fn set_interchain_gas_paymaster( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/rust/sealevel/programs/hyperlane-sealevel-token-native/tests/functional.rs b/rust/sealevel/programs/hyperlane-sealevel-token-native/tests/functional.rs index ec5f6e438d..1863f5b14a 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token-native/tests/functional.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token-native/tests/functional.rs @@ -148,11 +148,11 @@ async fn initialize_hyperlane_token( .encode() .unwrap(), vec![ - // 0. [executable] The system program. - // 1. [writable] The token PDA account. - // 2. [writable] The dispatch authority PDA account. - // 3. [signer] The payer and mailbox payer. - // 4. [writable] The native collateral PDA account. + // 0. `[executable]` The system program. + // 1. `[writable]` The token PDA account. + // 2. `[writable]` The dispatch authority PDA account. + // 3. `[signer]` The payer and mailbox payer. + // 4. `[writable]` The native collateral PDA account. AccountMeta::new_readonly(solana_program::system_program::id(), false), AccountMeta::new(token_account_key, false), AccountMeta::new(dispatch_authority_key, false), @@ -416,24 +416,24 @@ async fn test_transfer_remote() { }) .encode() .unwrap(), - // 0. [executable] The system program. - // 1. [executable] The spl_noop program. - // 2. [] The token PDA account. - // 3. [executable] The mailbox program. - // 4. [writeable] The mailbox outbox account. - // 5. [] Message dispatch authority. - // 6. [signer] The token sender and mailbox payer. - // 7. [signer] Unique message / gas payment account. - // 8. [writeable] Message storage PDA. + // 0. `[executable]` The system program. + // 1. `[executable]` The spl_noop program. + // 2. `[]` The token PDA account. + // 3. `[executable]` The mailbox program. + // 4. `[writeable]` The mailbox outbox account. + // 5. `[]` Message dispatch authority. + // 6. `[signer]` The token sender and mailbox payer. + // 7. `[signer]` Unique message / gas payment account. + // 8. `[writeable]` Message storage PDA. // ---- If using an IGP ---- - // 9. [executable] The IGP program. - // 10. [writeable] The IGP program data. - // 11. [writeable] Gas payment PDA. - // 12. [] OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. - // 13. [writeable] The IGP account. + // 9. `[executable]` The IGP program. + // 10. `[writeable]` The IGP program data. + // 11. `[writeable]` Gas payment PDA. + // 12. `[]` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. + // 13. `[writeable]` The IGP account. // ---- End if ---- - // 14. [executable] The system program. - // 15. [writeable] The native token collateral PDA account. + // 14. `[executable]` The system program. + // 15. `[writeable]` The native token collateral PDA account. vec![ AccountMeta::new_readonly(solana_program::system_program::id(), false), AccountMeta::new_readonly(spl_noop::id(), false), @@ -510,7 +510,7 @@ async fn test_transfer_remote() { .unwrap(); let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: LOCAL_DOMAIN, sender: program_id.to_bytes().into(), @@ -616,7 +616,7 @@ async fn transfer_from_remote( let recipient: H256 = recipient_pubkey.to_bytes().into(); let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: origin_override.unwrap_or(REMOTE_DOMAIN), // Default to the remote router as the sender @@ -762,12 +762,12 @@ async fn test_transfer_from_remote_errors_if_process_authority_not_signer() { .unwrap(), vec![ // Recipient.handle accounts - // 0. [signer] Mailbox processor authority specific to this program. - // 1. [executable] system_program - // 2. [] hyperlane_token storage - // 3. [writeable] recipient wallet address - // 4. [executable] The system program. - // 5. [writeable] The native token collateral PDA account. + // 0. `[signer]` Mailbox processor authority specific to this program. + // 1. `[executable]` system_program + // 2. `[]` hyperlane_token storage + // 3. `[writeable]` recipient wallet address + // 4. `[executable]` The system program. + // 5. `[writeable]` The native token collateral PDA account. AccountMeta::new_readonly( hyperlane_token_accounts.mailbox_process_authority, false, diff --git a/rust/sealevel/programs/hyperlane-sealevel-token/src/instruction.rs b/rust/sealevel/programs/hyperlane-sealevel-token/src/instruction.rs index 594e5836e5..0bfab1f334 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token/src/instruction.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token/src/instruction.rs @@ -19,8 +19,8 @@ pub fn init_instruction( let mut instruction = lib_init_instruction(program_id, payer, init)?; // Add additional account metas: - // 0. [writable] The mint / mint authority PDA account. - // 1. [writable] The ATA payer PDA account. + // 0. `[writable]` The mint / mint authority PDA account. + // 1. `[writable]` The ATA payer PDA account. let (mint_key, _mint_bump) = Pubkey::find_program_address(hyperlane_token_mint_pda_seeds!(), &program_id); diff --git a/rust/sealevel/programs/hyperlane-sealevel-token/src/plugin.rs b/rust/sealevel/programs/hyperlane-sealevel-token/src/plugin.rs index 60928790ee..c5029f9423 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token/src/plugin.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token/src/plugin.rs @@ -121,8 +121,8 @@ impl HyperlaneSealevelTokenPlugin for SyntheticPlugin { /// instruction initializing the mint with the SPL token 2022 program. /// /// Accounts: - /// 0. [writable] The mint / mint authority PDA account. - /// 1. [writable] The ATA payer PDA account. + /// 0. `[writable]` The mint / mint authority PDA account. + /// 1. `[writable]` The ATA payer PDA account. fn initialize<'a, 'b>( program_id: &Pubkey, system_program: &'a AccountInfo<'b>, @@ -187,9 +187,9 @@ impl HyperlaneSealevelTokenPlugin for SyntheticPlugin { /// Burns the tokens from the sender's associated token account. /// /// Accounts: - /// 0. [executable] The spl_token_2022 program. - /// 1. [writeable] The mint / mint authority PDA account. - /// 2. [writeable] The token sender's associated token account, from which tokens will be burned. + /// 0. `[executable]` The spl_token_2022 program. + /// 1. `[writeable]` The mint / mint authority PDA account. + /// 2. `[writeable]` The token sender's associated token account, from which tokens will be burned. fn transfer_in<'a, 'b>( program_id: &Pubkey, token: &HyperlaneToken, @@ -244,11 +244,11 @@ impl HyperlaneSealevelTokenPlugin for SyntheticPlugin { /// result of a transfer to this chain from a remote chain. /// /// Accounts: - /// 0. [executable] SPL token 2022 program - /// 1. [executable] SPL associated token account - /// 2. [writeable] Mint account - /// 3. [writeable] Recipient associated token account - /// 4. [writeable] ATA payer PDA account. + /// 0. `[executable]` SPL token 2022 program + /// 1. `[executable]` SPL associated token account + /// 2. `[writeable]` Mint account + /// 3. `[writeable]` Recipient associated token account + /// 4. `[writeable]` ATA payer PDA account. fn transfer_out<'a, 'b>( program_id: &Pubkey, token: &HyperlaneToken, diff --git a/rust/sealevel/programs/hyperlane-sealevel-token/src/processor.rs b/rust/sealevel/programs/hyperlane-sealevel-token/src/processor.rs index 50990fe4a7..f203a1e4e6 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token/src/processor.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token/src/processor.rs @@ -89,12 +89,12 @@ pub fn process_instruction( /// Initializes the program. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writable] The token PDA account. -/// 2. [writable] The dispatch authority PDA account. -/// 3. [signer] The payer. -/// 4. [writable] The mint / mint authority PDA account. -/// 5. [writable] The ATA payer PDA account. +/// 0. `[executable]` The system program. +/// 1. `[writable]` The token PDA account. +/// 2. `[writable]` The dispatch authority PDA account. +/// 3. `[signer]` The payer. +/// 4. `[writable]` The mint / mint authority PDA account. +/// 5. `[writable]` The ATA payer PDA account. fn initialize(program_id: &Pubkey, accounts: &[AccountInfo], init: Init) -> ProgramResult { HyperlaneSealevelToken::::initialize(program_id, accounts, init) } @@ -104,26 +104,26 @@ fn initialize(program_id: &Pubkey, accounts: &[AccountInfo], init: Init) -> Prog /// then dispatches a message to the remote recipient. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [executable] The spl_noop program. -/// 2. [] The token PDA account. -/// 3. [executable] The mailbox program. -/// 4. [writeable] The mailbox outbox account. -/// 5. [] Message dispatch authority. -/// 6. [signer] The token sender and mailbox payer. -/// 7. [signer] Unique message / gas payment account. -/// 8. [writeable] Message storage PDA. +/// 0. `[executable]` The system program. +/// 1. `[executable]` The spl_noop program. +/// 2. `[]` The token PDA account. +/// 3. `[executable]` The mailbox program. +/// 4. `[writeable]` The mailbox outbox account. +/// 5. `[]` Message dispatch authority. +/// 6. `[signer]` The token sender and mailbox payer. +/// 7. `[signer]` Unique message / gas payment account. +/// 8. `[writeable]` Message storage PDA. /// ---- If using an IGP ---- -/// 9. [executable] The IGP program. -/// 10. [writeable] The IGP program data. -/// 11. [writeable] Gas payment PDA. -/// 12. [] OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. -/// 13. [writeable] The IGP account. +/// 9. `[executable]` The IGP program. +/// 10. `[writeable]` The IGP program data. +/// 11. `[writeable]` Gas payment PDA. +/// 12. `[]` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. +/// 13. `[writeable]` The IGP account. /// ---- End if ---- -/// 14. [signer] The token sender. -/// 15. [executable] The spl_token_2022 program. -/// 16. [writeable] The mint / mint authority PDA account. -/// 17. [writeable] The token sender's associated token account, from which tokens will be burned. +/// 14. `[signer]` The token sender. +/// 15. `[executable]` The spl_token_2022 program. +/// 16. `[writeable]` The mint / mint authority PDA account. +/// 17. `[writeable]` The token sender's associated token account, from which tokens will be burned. fn transfer_remote( program_id: &Pubkey, accounts: &[AccountInfo], @@ -133,15 +133,15 @@ fn transfer_remote( } // Accounts: -// 0. [signer] Mailbox process authority specific to this program. -// 1. [executable] system_program -// 2. [] hyperlane_token storage -// 3. [] recipient wallet address -// 4. [executable] SPL token 2022 program -// 5. [executable] SPL associated token account -// 6. [writeable] Mint account -// 7. [writeable] Recipient associated token account -// 8. [writeable] ATA payer PDA account. +// 0. `[signer]` Mailbox process authority specific to this program. +// 1. `[executable]` system_program +// 2. `[]` hyperlane_token storage +// 3. `[]` recipient wallet address +// 4. `[executable]` SPL token 2022 program +// 5. `[executable]` SPL associated token account +// 6. `[writeable]` Mint account +// 7. `[writeable]` Recipient associated token account +// 8. `[writeable]` ATA payer PDA account. fn transfer_from_remote( program_id: &Pubkey, accounts: &[AccountInfo], @@ -164,9 +164,9 @@ fn transfer_from_remote_account_metas( /// Enrolls a remote router. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writeable] The token PDA account. -/// 2. [signer] The owner. +/// 0. `[executable]` The system program. +/// 1. `[writeable]` The token PDA account. +/// 2. `[signer]` The owner. fn enroll_remote_router( program_id: &Pubkey, accounts: &[AccountInfo], @@ -178,9 +178,9 @@ fn enroll_remote_router( /// Enrolls remote routers. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writeable] The token PDA account. -/// 2. [signer] The owner. +/// 0. `[executable]` The system program. +/// 1. `[writeable]` The token PDA account. +/// 2. `[signer]` The owner. fn enroll_remote_routers( program_id: &Pubkey, accounts: &[AccountInfo], @@ -192,9 +192,9 @@ fn enroll_remote_routers( /// Sets the destination gas configs. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [writeable] The token PDA account. -/// 2. [signer] The owner. +/// 0. `[executable]` The system program. +/// 1. `[writeable]` The token PDA account. +/// 2. `[signer]` The owner. fn set_destination_gas_configs( program_id: &Pubkey, accounts: &[AccountInfo], @@ -208,8 +208,8 @@ fn set_destination_gas_configs( /// Transfers ownership. /// /// Accounts: -/// 0. [writeable] The token PDA account. -/// 1. [signer] The current owner. +/// 0. `[writeable]` The token PDA account. +/// 1. `[signer]` The current owner. fn transfer_ownership( program_id: &Pubkey, accounts: &[AccountInfo], @@ -221,7 +221,7 @@ fn transfer_ownership( /// Gets the interchain security module, returning it as a serialized Option. /// /// Accounts: -/// 0. [] The token PDA account. +/// 0. `[]` The token PDA account. fn interchain_security_module(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { HyperlaneSealevelToken::::interchain_security_module(program_id, accounts) } @@ -237,8 +237,8 @@ fn interchain_security_module_account_metas(program_id: &Pubkey) -> ProgramResul /// Lets the owner set the interchain security module. /// /// Accounts: -/// 0. [writeable] The token PDA account. -/// 1. [signer] The access control owner. +/// 0. `[writeable]` The token PDA account. +/// 1. `[signer]` The access control owner. fn set_interchain_security_module( program_id: &Pubkey, accounts: &[AccountInfo], @@ -252,8 +252,8 @@ fn set_interchain_security_module( /// Lets the owner set the interchain gas paymaster. /// /// Accounts: -/// 0. [writeable] The token PDA account. -/// 1. [signer] The access control owner. +/// 0. `[writeable]` The token PDA account. +/// 1. `[signer]` The access control owner. fn set_interchain_gas_paymaster( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/rust/sealevel/programs/hyperlane-sealevel-token/tests/functional.rs b/rust/sealevel/programs/hyperlane-sealevel-token/tests/functional.rs index 7cac39aee5..73324efde2 100644 --- a/rust/sealevel/programs/hyperlane-sealevel-token/tests/functional.rs +++ b/rust/sealevel/programs/hyperlane-sealevel-token/tests/functional.rs @@ -165,12 +165,12 @@ async fn initialize_hyperlane_token( .encode() .unwrap(), vec![ - // 0. [executable] The system program. - // 1. [writable] The token PDA account. - // 2. [writable] The dispatch authority PDA account. - // 3. [signer] The payer. - // 4. [writable] The mint / mint authority PDA account. - // 5. [writable] The ATA payer PDA account. + // 0. `[executable]` The system program. + // 1. `[writable]` The token PDA account. + // 2. `[writable]` The dispatch authority PDA account. + // 3. `[signer]` The payer. + // 4. `[writable]` The mint / mint authority PDA account. + // 5. `[writable]` The ATA payer PDA account. AccountMeta::new_readonly(solana_program::system_program::id(), false), AccountMeta::new(token_account_key, false), AccountMeta::new(dispatch_authority_key, false), @@ -451,7 +451,7 @@ async fn transfer_from_remote( ); let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: origin_override.unwrap_or(REMOTE_DOMAIN), // Default to the remote router as the sender @@ -592,15 +592,15 @@ async fn test_transfer_from_remote_errors_if_process_authority_not_signer() { .unwrap(), vec![ // Recipient.handle accounts - // 0. [signer] Mailbox process authority specific to this program. - // 1. [executable] system_program - // 2. [] hyperlane_token storage - // 3. [] recipient wallet address - // 4. [executable] SPL token 2022 program - // 5. [executable] SPL associated token account - // 6. [writeable] Mint account - // 7. [writeable] Recipient associated token account - // 8. [writeable] ATA payer PDA account. + // 0. `[signer]` Mailbox process authority specific to this program. + // 1. `[executable]` system_program + // 2. `[]` hyperlane_token storage + // 3. `[]` recipient wallet address + // 4. `[executable]` SPL token 2022 program + // 5. `[executable]` SPL associated token account + // 6. `[writeable]` Mint account + // 7. `[writeable]` Recipient associated token account + // 8. `[writeable]` ATA payer PDA account. AccountMeta::new_readonly( hyperlane_token_accounts.mailbox_process_authority, false, @@ -710,25 +710,25 @@ async fn test_transfer_remote() { }) .encode() .unwrap(), - // 0. [executable] The system program. - // 1. [executable] The spl_noop program. - // 2. [] The token PDA account. - // 3. [executable] The mailbox program. - // 4. [writeable] The mailbox outbox account. - // 5. [] Message dispatch authority. - // 6. [signer] The token sender and mailbox payer. - // 7. [signer] Unique message account. - // 8. [writeable] Message storage PDA. + // 0. `[executable]` The system program. + // 1. `[executable]` The spl_noop program. + // 2. `[]` The token PDA account. + // 3. `[executable]` The mailbox program. + // 4. `[writeable]` The mailbox outbox account. + // 5. `[]` Message dispatch authority. + // 6. `[signer]` The token sender and mailbox payer. + // 7. `[signer]` Unique message account. + // 8. `[writeable]` Message storage PDA. // ---- If using an IGP ---- - // 9. [executable] The IGP program. - // 10. [writeable] The IGP program data. - // 11. [writeable] Gas payment PDA. - // 12. [] OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. - // 13. [writeable] The IGP account. + // 9. `[executable]` The IGP program. + // 10. `[writeable]` The IGP program data. + // 11. `[writeable]` Gas payment PDA. + // 12. `[]` OPTIONAL - The Overhead IGP program, if the configured IGP is an Overhead IGP. + // 13. `[writeable]` The IGP account. // ---- End if ---- - // 14. [executable] The spl_token_2022 program. - // 15. [writeable] The mint / mint authority PDA account. - // 16. [writeable] The token sender's associated token account, from which tokens will be burned. + // 14. `[executable]` The spl_token_2022 program. + // 15. `[writeable]` The mint / mint authority PDA account. + // 16. `[writeable]` The token sender's associated token account, from which tokens will be burned. vec![ AccountMeta::new_readonly(solana_program::system_program::id(), false), AccountMeta::new_readonly(spl_noop::id(), false), @@ -783,7 +783,7 @@ async fn test_transfer_remote() { .unwrap(); let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: LOCAL_DOMAIN, sender: program_id.to_bytes().into(), diff --git a/rust/sealevel/programs/ism/multisig-ism-message-id/Cargo.toml b/rust/sealevel/programs/ism/multisig-ism-message-id/Cargo.toml index 8a35c3b96f..86b543fcd9 100644 --- a/rust/sealevel/programs/ism/multisig-ism-message-id/Cargo.toml +++ b/rust/sealevel/programs/ism/multisig-ism-message-id/Cargo.toml @@ -27,10 +27,13 @@ serializable-account-meta = { path = "../../../libraries/serializable-account-me [dev-dependencies] hyperlane-sealevel-multisig-ism-message-id = { path = "../multisig-ism-message-id" } hyperlane-test-utils = { path = "../../../libraries/test-utils" } +multisig-ism = { path = "../../../libraries/multisig-ism", features = ["test-data"] } solana-program-test.workspace = true solana-sdk.workspace = true hex.workspace = true -multisig-ism = { path = "../../../libraries/multisig-ism", features = ["test-data"] } +# Can't have as a workspace dep, because this is already in the dep tree twice: once as +# an older solana one, once as a newer one used more generally. +rand = "0.8.5" [lib] crate-type = ["cdylib", "lib"] diff --git a/rust/sealevel/programs/ism/multisig-ism-message-id/src/metadata.rs b/rust/sealevel/programs/ism/multisig-ism-message-id/src/metadata.rs index 50b3e2c64b..dd1bd1b15f 100644 --- a/rust/sealevel/programs/ism/multisig-ism-message-id/src/metadata.rs +++ b/rust/sealevel/programs/ism/multisig-ism-message-id/src/metadata.rs @@ -7,12 +7,14 @@ use crate::error::Error; pub struct MultisigIsmMessageIdMetadata { pub origin_merkle_tree_hook: H256, pub merkle_root: H256, + pub merkle_index: u32, pub validator_signatures: Vec, } const ORIGIN_MAILBOX_OFFSET: usize = 0; const MERKLE_ROOT_OFFSET: usize = 32; -const SIGNATURES_OFFSET: usize = 64; +const MERKLE_INDEX_OFFSET: usize = 64; +const SIGNATURES_OFFSET: usize = 68; const SIGNATURE_LENGTH: usize = 65; /// Format of metadata: @@ -32,7 +34,12 @@ impl TryFrom> for MultisigIsmMessageIdMetadata { } let origin_mailbox = H256::from_slice(&bytes[ORIGIN_MAILBOX_OFFSET..MERKLE_ROOT_OFFSET]); - let merkle_root = H256::from_slice(&bytes[MERKLE_ROOT_OFFSET..SIGNATURES_OFFSET]); + let merkle_root = H256::from_slice(&bytes[MERKLE_ROOT_OFFSET..MERKLE_INDEX_OFFSET]); + // This cannot panic since SIGNATURES_OFFSET - MERKLE_INDEX_OFFSET is 4. + let merkle_index_bytes: [u8; 4] = bytes[MERKLE_INDEX_OFFSET..SIGNATURES_OFFSET] + .try_into() + .map_err(|_| Error::InvalidMetadata)?; + let merkle_index = u32::from_be_bytes(merkle_index_bytes); let signature_bytes_len = bytes_len - SIGNATURES_OFFSET; // Require the signature bytes to be a multiple of the signature length. @@ -55,6 +62,7 @@ impl TryFrom> for MultisigIsmMessageIdMetadata { Ok(Self { origin_merkle_tree_hook: origin_mailbox, merkle_root, + merkle_index, validator_signatures, }) } @@ -68,6 +76,7 @@ impl Encode for MultisigIsmMessageIdMetadata { let mut bytes_written = 0; bytes_written += writer.write(self.origin_merkle_tree_hook.as_ref())?; bytes_written += writer.write(self.merkle_root.as_ref())?; + bytes_written += writer.write(&self.merkle_index.to_be_bytes())?; for signature in &self.validator_signatures { bytes_written += writer.write(&signature.as_fixed_bytes()[..])?; } @@ -78,11 +87,21 @@ impl Encode for MultisigIsmMessageIdMetadata { #[cfg(test)] mod test { use super::*; + use rand::Rng; + + // Provide a default test implementation + fn dummy_metadata_with_sigs(sigs: Vec) -> MultisigIsmMessageIdMetadata { + let mut rng = rand::thread_rng(); + MultisigIsmMessageIdMetadata { + origin_merkle_tree_hook: H256::random(), + merkle_root: H256::random(), + merkle_index: rng.gen(), + validator_signatures: sigs, + } + } #[test] fn test_decode_correctly_formatted_metadata() { - let origin_mailbox = H256::random(); - let merkle_root = H256::random(); let validator_signatures = vec![ EcdsaSignature { serialized_rs: [11u8; 64], @@ -97,43 +116,49 @@ mod test { recovery_id: 0, }, ]; - let mut metadata_bytes = origin_mailbox.as_bytes().to_vec(); - metadata_bytes.extend_from_slice(merkle_root.as_bytes()); - for signature in &validator_signatures { - metadata_bytes.extend_from_slice(&signature.as_fixed_bytes()[..]); - } - - let metadata = MultisigIsmMessageIdMetadata::try_from(metadata_bytes).unwrap(); - assert_eq!(metadata.origin_merkle_tree_hook, origin_mailbox); - assert_eq!(metadata.merkle_root, merkle_root); - assert_eq!(metadata.validator_signatures, validator_signatures); + let test_meta = dummy_metadata_with_sigs(validator_signatures); + let encoded_meta = test_meta.to_vec(); + let metadata = MultisigIsmMessageIdMetadata::try_from(encoded_meta.clone()).unwrap(); + assert_eq!( + metadata.origin_merkle_tree_hook, + test_meta.origin_merkle_tree_hook + ); + assert_eq!(metadata.merkle_root, test_meta.merkle_root); + assert_eq!(metadata.merkle_index, test_meta.merkle_index); + assert_eq!( + metadata.validator_signatures, + test_meta.validator_signatures + ); } #[test] fn test_decode_no_signatures_is_err() { - let origin_mailbox = H256::random(); - let merkle_root = H256::random(); - let metadata_bytes = origin_mailbox - .as_bytes() - .iter() - .chain(merkle_root.as_bytes().iter()) - .cloned() - .collect::>(); - - let result = MultisigIsmMessageIdMetadata::try_from(metadata_bytes); + let test_meta = dummy_metadata_with_sigs(vec![]); + let encoded_meta = test_meta.to_vec(); + let result = MultisigIsmMessageIdMetadata::try_from(encoded_meta); assert!(result.unwrap_err() == Error::InvalidMetadata); } #[test] fn test_decode_incorrect_signature_length_is_err() { - let origin_mailbox = H256::random(); - let merkle_root = H256::random(); - let mut metadata_bytes = origin_mailbox.as_bytes().to_vec(); - metadata_bytes.extend_from_slice(merkle_root.as_bytes()); - // 64 byte signature instead of 65. - metadata_bytes.extend_from_slice(&[1u8; 64]); - - let result = MultisigIsmMessageIdMetadata::try_from(metadata_bytes); + let sigs = vec![EcdsaSignature { + serialized_rs: [1u8; 64], + recovery_id: 0, + }]; + let test_meta = dummy_metadata_with_sigs(sigs); + let encoded_meta = test_meta.to_vec(); + // remove the last byte from the encoded signature + let faulty_encoded_meta = encoded_meta[..encoded_meta.len() - 1].to_vec(); + let result = MultisigIsmMessageIdMetadata::try_from(faulty_encoded_meta); assert!(result.unwrap_err() == Error::InvalidMetadata); + MultisigIsmMessageIdMetadata::try_from(encoded_meta).expect("Decoding should succeed"); + } + + #[test] + fn test_decode_real_meta() { + // multisig ism message id metadata from this tx: + // https://arbiscan.io//tx/0xe558f04ad446b1d9ec4d4a1284661869b73daff38ec9fb7e809be652732fff30#txninfo + let bytes = hex::decode("000000000000000000000000149db7afd694722747035d5aec7007ccb6f8f112fb91807ccda2db543bfbd013242643553bc1238f891ae9d0abb3b8b46c5a89990000017addc429c97ca8bcd6ad86ef4461379374b0d545308a1f47db246a6c028f74d7af521dd9355afd2f2a02565a24f22ac7b7e388cbd1f2a931acc97ce689be5456851b4d22f1aece05d293e574e38edcda9f2db64f1dc5b69a89a6a5989e7aaa4f443c137e593bb794eb211de719ed0f466a0778c4d204cc275f54c0936eee918ae1651c").unwrap(); + MultisigIsmMessageIdMetadata::try_from(bytes).expect("Decoding should succeed"); } } diff --git a/rust/sealevel/programs/ism/multisig-ism-message-id/src/processor.rs b/rust/sealevel/programs/ism/multisig-ism-message-id/src/processor.rs index 400cfdc7b2..c479b69a94 100644 --- a/rust/sealevel/programs/ism/multisig-ism-message-id/src/processor.rs +++ b/rust/sealevel/programs/ism/multisig-ism-message-id/src/processor.rs @@ -601,6 +601,7 @@ pub mod test { metadata: MultisigIsmMessageIdMetadata { origin_merkle_tree_hook: checkpoint.merkle_tree_hook_address, merkle_root: checkpoint.root, + merkle_index: checkpoint.index, validator_signatures: vec![ EcdsaSignature::from_bytes(&signatures[0]).unwrap(), EcdsaSignature::from_bytes(&signatures[1]).unwrap(), @@ -626,6 +627,7 @@ pub mod test { metadata: MultisigIsmMessageIdMetadata { origin_merkle_tree_hook: checkpoint.merkle_tree_hook_address, merkle_root: checkpoint.root, + merkle_index: checkpoint.index, validator_signatures: vec![ EcdsaSignature::from_bytes(&signatures[1]).unwrap(), EcdsaSignature::from_bytes(&signatures[0]).unwrap(), @@ -654,6 +656,7 @@ pub mod test { metadata: MultisigIsmMessageIdMetadata { origin_merkle_tree_hook: checkpoint.merkle_tree_hook_address, merkle_root: checkpoint.root, + merkle_index: checkpoint.index, validator_signatures: vec![ EcdsaSignature::from_bytes(&signatures[0]).unwrap(), EcdsaSignature::from_bytes(&signatures[2]).unwrap(), @@ -678,6 +681,7 @@ pub mod test { metadata: MultisigIsmMessageIdMetadata { origin_merkle_tree_hook: checkpoint.merkle_tree_hook_address, merkle_root: checkpoint.root, + merkle_index: checkpoint.index, validator_signatures: vec![ EcdsaSignature::from_bytes(&signatures[0]).unwrap(), EcdsaSignature::from_bytes(&signatures[1]).unwrap(), diff --git a/rust/sealevel/programs/ism/multisig-ism-message-id/tests/functional.rs b/rust/sealevel/programs/ism/multisig-ism-message-id/tests/functional.rs index b7820649fc..e40cd3a7aa 100644 --- a/rust/sealevel/programs/ism/multisig-ism-message-id/tests/functional.rs +++ b/rust/sealevel/programs/ism/multisig-ism-message-id/tests/functional.rs @@ -299,7 +299,7 @@ async fn test_set_validators_and_threshold_creates_pda_account() { // to fetch the account metas required for the instruction. let test_message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: domain, sender: H256::random(), @@ -421,6 +421,7 @@ async fn test_ism_verify() { metadata: MultisigIsmMessageIdMetadata { origin_merkle_tree_hook: checkpoint.merkle_tree_hook_address, merkle_root: checkpoint.root, + merkle_index: checkpoint.index, validator_signatures: vec![ EcdsaSignature::from_bytes(&signatures[0]).unwrap(), EcdsaSignature::from_bytes(&signatures[1]).unwrap(), diff --git a/rust/sealevel/programs/ism/test-ism/src/program.rs b/rust/sealevel/programs/ism/test-ism/src/program.rs index 4b4c87638e..ef4914e650 100644 --- a/rust/sealevel/programs/ism/test-ism/src/program.rs +++ b/rust/sealevel/programs/ism/test-ism/src/program.rs @@ -101,9 +101,9 @@ pub fn process_instruction( /// Creates the storage PDA. /// /// Accounts: -/// 0. [executable] System program. -/// 1. [signer] Payer. -/// 2. [writeable] Storage PDA. +/// 0. `[executable]` System program. +/// 1. `[signer]` Payer. +/// 2. `[writeable]` Storage PDA. fn init(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -144,7 +144,7 @@ fn init(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { } /// Accounts: -/// 0. [writeable] Storage PDA. +/// 0. `[writeable]` Storage PDA. fn set_accept(_program_id: &Pubkey, accounts: &[AccountInfo], accept: bool) -> ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -160,7 +160,7 @@ fn set_accept(_program_id: &Pubkey, accounts: &[AccountInfo], accept: bool) -> P } /// Accounts: -/// 0. [] Storage PDA. +/// 0. `[]` Storage PDA. fn verify(_program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { let accounts_iter = &mut accounts.iter(); diff --git a/rust/sealevel/programs/ism/test-ism/src/test_client.rs b/rust/sealevel/programs/ism/test-ism/src/test_client.rs index f2bf0f6af5..d756dd41dc 100644 --- a/rust/sealevel/programs/ism/test-ism/src/test_client.rs +++ b/rust/sealevel/programs/ism/test-ism/src/test_client.rs @@ -38,9 +38,9 @@ impl TestIsmTestClient { program_id, data: TestIsmInstruction::Init.try_to_vec().unwrap(), accounts: vec![ - // 0. [executable] System program. - // 1. [signer] Payer. - // 2. [writeable] Storage PDA. + // 0. `[executable]` System program. + // 1. `[signer]` Payer. + // 2. `[writeable]` Storage PDA. AccountMeta::new_readonly(system_program::id(), false), AccountMeta::new(payer_pubkey, true), AccountMeta::new(Self::get_storage_pda_key(), false), @@ -66,7 +66,7 @@ impl TestIsmTestClient { program_id, data: TestIsmInstruction::SetAccept(accept).try_to_vec().unwrap(), accounts: vec![ - // 0. [writeable] Storage PDA. + // 0. `[writeable]` Storage PDA. AccountMeta::new(Self::get_storage_pda_key(), false), ], }; diff --git a/rust/sealevel/programs/mailbox-test/src/functional.rs b/rust/sealevel/programs/mailbox-test/src/functional.rs index c826b6ed0c..088dc7da74 100644 --- a/rust/sealevel/programs/mailbox-test/src/functional.rs +++ b/rust/sealevel/programs/mailbox-test/src/functional.rs @@ -183,7 +183,7 @@ async fn test_dispatch_from_eoa() { .unwrap(); let expected_message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: LOCAL_DOMAIN, sender: payer.pubkey().to_bytes().into(), @@ -238,7 +238,7 @@ async fn test_dispatch_from_eoa() { .unwrap(); let expected_message = HyperlaneMessage { - version: 0, + version: 3, nonce: 1, origin: LOCAL_DOMAIN, sender: payer.pubkey().to_bytes().into(), @@ -300,7 +300,7 @@ async fn test_dispatch_from_program() { .unwrap(); let expected_message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: LOCAL_DOMAIN, // The sender should be the program ID because its dispatch authority signed @@ -389,7 +389,7 @@ async fn test_dispatch_returns_message_id() { message_body: message_body.clone(), }; let expected_message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: LOCAL_DOMAIN, sender: payer.pubkey().to_bytes().into(), @@ -411,13 +411,13 @@ async fn test_dispatch_returns_message_id() { .into_instruction_data() .unwrap(), accounts: vec![ - // 0. [writeable] Outbox PDA. - // 1. [signer] Message sender signer. - // 2. [executable] System program. - // 3. [executable] SPL Noop program. - // 4. [signer] Payer. - // 5. [signer] Unique message account. - // 6. [writeable] Dispatched message PDA. An empty message PDA relating to the seeds + // 0. `[writeable]` Outbox PDA. + // 1. `[signer]` Message sender signer. + // 2. `[executable]` System program. + // 3. `[executable]` SPL Noop program. + // 4. `[signer]` Payer. + // 5. `[signer]` Unique message account. + // 6. `[writeable]` Dispatched message PDA. An empty message PDA relating to the seeds // `mailbox_dispatched_message_pda_seeds` where the message contents will be stored. AccountMeta::new(mailbox_accounts.outbox, false), AccountMeta::new(payer.pubkey(), true), @@ -574,7 +574,7 @@ async fn test_process_successful_verify_and_handle() { let recipient_id = hyperlane_sealevel_test_send_receiver::id(); let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: REMOTE_DOMAIN, sender: payer.pubkey().to_bytes().into(), @@ -605,7 +605,7 @@ async fn test_process_successful_verify_and_handle() { // Send another to illustrate that the sequence is incremented let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: REMOTE_DOMAIN, sender: payer.pubkey().to_bytes().into(), @@ -647,7 +647,7 @@ async fn test_process_errors_if_message_already_processed() { let recipient_id = hyperlane_sealevel_test_send_receiver::id(); let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: REMOTE_DOMAIN, sender: payer.pubkey().to_bytes().into(), @@ -697,7 +697,7 @@ async fn test_process_errors_if_ism_verify_fails() { test_ism.set_accept(false).await.unwrap(); let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: REMOTE_DOMAIN, sender: payer.pubkey().to_bytes().into(), @@ -743,7 +743,7 @@ async fn test_process_errors_if_recipient_handle_fails() { .unwrap(); let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: REMOTE_DOMAIN, sender: payer.pubkey().to_bytes().into(), @@ -784,7 +784,7 @@ async fn test_process_errors_if_incorrect_destination_domain() { let recipient_id = hyperlane_sealevel_test_send_receiver::id(); let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: REMOTE_DOMAIN, sender: payer.pubkey().to_bytes().into(), @@ -905,7 +905,7 @@ async fn test_process_errors_if_reentrant() { let recipient_id = hyperlane_sealevel_test_send_receiver::id(); let message = HyperlaneMessage { - version: 0, + version: 3, nonce: 0, origin: REMOTE_DOMAIN, sender: payer.pubkey().to_bytes().into(), @@ -964,9 +964,9 @@ async fn test_inbox_set_default_ism() { .into_instruction_data() .unwrap(), accounts: vec![ - // 0. [writeable] - The Inbox PDA account. - // 1. [] - The Outbox PDA account. - // 2. [signer] - The owner of the Mailbox. + // 0. `[writeable]` - The Inbox PDA account. + // 1. `[]` - The Outbox PDA account. + // 2. `[signer]` - The owner of the Mailbox. AccountMeta::new(mailbox_accounts.inbox, false), AccountMeta::new_readonly(mailbox_accounts.outbox, false), AccountMeta::new(payer.pubkey(), true), @@ -1011,9 +1011,9 @@ async fn test_inbox_set_default_ism_errors_if_owner_not_signer() { .into_instruction_data() .unwrap(), accounts: vec![ - // 0. [writeable] - The Inbox PDA account. - // 1. [] - The Outbox PDA account. - // 2. [signer] - The owner of the Mailbox. + // 0. `[writeable]` - The Inbox PDA account. + // 1. `[]` - The Outbox PDA account. + // 2. `[signer]` - The owner of the Mailbox. AccountMeta::new(mailbox_accounts.inbox, false), AccountMeta::new_readonly(mailbox_accounts.outbox, false), AccountMeta::new_readonly(non_owner.pubkey(), true), @@ -1033,9 +1033,9 @@ async fn test_inbox_set_default_ism_errors_if_owner_not_signer() { .into_instruction_data() .unwrap(), accounts: vec![ - // 0. [writeable] - The Inbox PDA account. - // 1. [] - The Outbox PDA account. - // 2. [signer] - The owner of the Mailbox. + // 0. `[writeable]` - The Inbox PDA account. + // 1. `[]` - The Outbox PDA account. + // 2. `[signer]` - The owner of the Mailbox. AccountMeta::new(mailbox_accounts.inbox, false), AccountMeta::new_readonly(mailbox_accounts.outbox, false), AccountMeta::new_readonly(payer.pubkey(), false), diff --git a/rust/sealevel/programs/mailbox-test/src/utils.rs b/rust/sealevel/programs/mailbox-test/src/utils.rs index 434dce00bb..b4e2076668 100644 --- a/rust/sealevel/programs/mailbox-test/src/utils.rs +++ b/rust/sealevel/programs/mailbox-test/src/utils.rs @@ -42,13 +42,13 @@ pub async fn dispatch_from_payer( .into_instruction_data() .unwrap(), accounts: vec![ - // 0. [writeable] Outbox PDA. - // 1. [signer] Message sender signer. - // 2. [executable] System program. - // 3. [executable] SPL Noop program. - // 4. [signer] Payer. - // 5. [signer] Unique message account. - // 6. [writeable] Dispatched message PDA. An empty message PDA relating to the seeds + // 0. `[writeable]` Outbox PDA. + // 1. `[signer]` Message sender signer. + // 2. `[executable]` System program. + // 3. `[executable]` SPL Noop program. + // 4. `[signer]` Payer. + // 5. `[signer]` Unique message account. + // 6. `[writeable]` Dispatched message PDA. An empty message PDA relating to the seeds // `mailbox_dispatched_message_pda_seeds` where the message contents will be stored. AccountMeta::new(mailbox_accounts.outbox, false), AccountMeta::new(payer.pubkey(), true), diff --git a/rust/sealevel/programs/mailbox/src/instruction.rs b/rust/sealevel/programs/mailbox/src/instruction.rs index 78a553f92d..74aac05f97 100644 --- a/rust/sealevel/programs/mailbox/src/instruction.rs +++ b/rust/sealevel/programs/mailbox/src/instruction.rs @@ -11,7 +11,7 @@ use solana_program::{ use crate::{mailbox_inbox_pda_seeds, mailbox_outbox_pda_seeds}; /// The current message version. -pub const VERSION: u8 = 0; +pub const VERSION: u8 = 3; /// Maximum bytes per message = 2 KiB (somewhat arbitrarily set to begin). pub const MAX_MESSAGE_BODY_BYTES: usize = 2 * 2_usize.pow(10); @@ -156,9 +156,9 @@ pub fn set_default_ism_instruction( Pubkey::try_find_program_address(mailbox_outbox_pda_seeds!(), &program_id) .ok_or(ProgramError::InvalidSeeds)?; - // 0. [writeable] - The Inbox PDA account. - // 1. [] - The Outbox PDA account. - // 2. [signer] - The owner of the Mailbox. + // 0. `[writeable]` - The Inbox PDA account. + // 1. `[]` - The Outbox PDA account. + // 2. `[signer]` - The owner of the Mailbox. let instruction = SolanaInstruction { program_id, data: Instruction::InboxSetDefaultIsm(default_ism).into_instruction_data()?, diff --git a/rust/sealevel/programs/mailbox/src/processor.rs b/rust/sealevel/programs/mailbox/src/processor.rs index c0efa6272a..9d4e133960 100644 --- a/rust/sealevel/programs/mailbox/src/processor.rs +++ b/rust/sealevel/programs/mailbox/src/processor.rs @@ -79,10 +79,10 @@ pub fn process_instruction( /// Initializes the Mailbox. /// /// Accounts: -/// 0. [executable] The system program. -/// 1. [signer, writable] The payer account and owner of the Mailbox. -/// 2. [writable] The inbox PDA account. -/// 3. [writable] The outbox PDA account. +/// 0. `[executable]` The system program. +/// 1. `[signer, writable]` The payer account and owner of the Mailbox. +/// 2. `[writable]` The inbox PDA account. +/// 3. `[writable]` The outbox PDA account. fn initialize(program_id: &Pubkey, accounts: &[AccountInfo], init: Init) -> ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -164,16 +164,16 @@ fn initialize(program_id: &Pubkey, accounts: &[AccountInfo], init: Init) -> Prog /// Process a message. Non-reentrant through the use of a RefMut. /// // Accounts: -// 0. [signer] Payer account. This pays for the creation of the processed message PDA. -// 1. [executable] The system program. -// 2. [writable] Inbox PDA account. -// 3. [] Mailbox process authority specific to the message recipient. -// 4. [writable] Processed message PDA. +// 0. `[signer]` Payer account. This pays for the creation of the processed message PDA. +// 1. `[executable]` The system program. +// 2. `[writable]` Inbox PDA account. +// 3. `[]` Mailbox process authority specific to the message recipient. +// 4. `[writable]` Processed message PDA. // 5..N [??] Accounts required to invoke the recipient's InterchainSecurityModule instruction. -// N+1. [executable] SPL noop -// N+2. [executable] ISM +// N+1. `[executable]` SPL noop +// N+2. `[executable]` ISM // N+2..M. [??] Accounts required to invoke the ISM's Verify instruction. -// M+1. [executable] Recipient program. +// M+1. `[executable]` Recipient program. // M+2..K. [??] Accounts required to invoke the recipient's Handle instruction. fn inbox_process( program_id: &Pubkey, @@ -414,8 +414,8 @@ fn inbox_process( /// Gets the ISM to use for a recipient program and sets it as return data. /// /// Accounts: -/// 0. [] - The Inbox PDA. -/// 1. [] - The recipient program. +/// 0. `[]` - The Inbox PDA. +/// 1. `[]` - The recipient program. /// 2..N. [??] - The accounts required to make the CPI into the recipient program. /// These can be retrieved from the recipient using the /// `MessageRecipientInstruction::InterchainSecurityModuleAccountMetas` instruction. @@ -505,9 +505,9 @@ fn get_recipient_ism( /// Sets the default ISM. /// /// Accounts: -/// 0. [writeable] - The Inbox PDA account. -/// 1. [] - The Outbox PDA account. -/// 2. [signer] - The owner of the Mailbox. +/// 0. `[writeable]` - The Inbox PDA account. +/// 1. `[]` - The Outbox PDA account. +/// 2. `[signer]` - The owner of the Mailbox. fn inbox_set_default_ism( program_id: &Pubkey, accounts: &[AccountInfo], @@ -549,13 +549,13 @@ fn inbox_set_default_ism( /// Sets the ID of the message as return data. /// /// Accounts: -/// 0. [writeable] Outbox PDA. -/// 1. [signer] Message sender signer. -/// 2. [executable] System program. -/// 3. [executable] SPL Noop program. -/// 4. [signer] Payer. -/// 5. [signer] Unique message account. -/// 6. [writeable] Dispatched message PDA. An empty message PDA relating to the seeds +/// 0. `[writeable]` Outbox PDA. +/// 1. `[signer]` Message sender signer. +/// 2. `[executable]` System program. +/// 3. `[executable]` SPL Noop program. +/// 4. `[signer]` Payer. +/// 5. `[signer]` Unique message account. +/// 6. `[writeable]` Dispatched message PDA. An empty message PDA relating to the seeds /// `mailbox_dispatched_message_pda_seeds` where the message contents will be stored. fn outbox_dispatch( program_id: &Pubkey, @@ -712,7 +712,7 @@ fn outbox_dispatch( /// Gets the number of dispatched messages as little endian encoded return data. /// /// Accounts: -/// 0. [] Outbox PDA account. +/// 0. `[]` Outbox PDA account. fn outbox_get_count(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -743,7 +743,7 @@ fn outbox_get_count(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramRes /// Gets the latest checkpoint as return data. /// /// Accounts: -/// 0. [] Outbox PDA account. +/// 0. `[]` Outbox PDA account. fn outbox_get_latest_checkpoint(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -779,7 +779,7 @@ fn outbox_get_latest_checkpoint(program_id: &Pubkey, accounts: &[AccountInfo]) - /// Gets the root as return data. /// /// Accounts: -/// 0. [] Outbox PDA account. +/// 0. `[]` Outbox PDA account. fn outbox_get_root(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { let accounts_iter = &mut accounts.iter(); diff --git a/rust/sealevel/programs/test-send-receiver/src/program.rs b/rust/sealevel/programs/test-send-receiver/src/program.rs index 0f2bbc37af..46884ea400 100644 --- a/rust/sealevel/programs/test-send-receiver/src/program.rs +++ b/rust/sealevel/programs/test-send-receiver/src/program.rs @@ -37,7 +37,7 @@ pub enum TestSendReceiverError { /// that the Mailbox can handle different ISM getter return data. #[derive(BorshSerialize, BorshDeserialize, Debug)] pub enum IsmReturnDataMode { - /// Encodes the ISM as an Option. + /// Encodes the ISM as an `Option`. EncodeOption, /// Returns no data. ReturnNothing, @@ -161,9 +161,9 @@ pub fn process_instruction( /// Creates the storage PDA. /// /// Accounts: -/// 0. [executable] System program. -/// 1. [signer] Payer. -/// 2. [writeable] Storage PDA. +/// 0. `[executable]` System program. +/// 1. `[signer]` Payer. +/// 2. `[writeable]` Storage PDA. fn init(program_id: &Pubkey, accounts: &[AccountInfo], mailbox: Pubkey) -> ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -211,15 +211,15 @@ fn init(program_id: &Pubkey, accounts: &[AccountInfo], mailbox: Pubkey) -> Progr /// Dispatches a message using the dispatch authority. /// /// Accounts: -/// 0. [executable] The Mailbox program. +/// 0. `[executable]` The Mailbox program. /// And now the accounts expected by the Mailbox's OutboxDispatch instruction: -/// 2. [writeable] Outbox PDA. -/// 3. [] This program's dispatch authority. -/// 4. [executable] System program. -/// 5. [executable] SPL Noop program. -/// 6. [signer] Payer. -/// 7. [signer] Unique message account. -/// 8. [writeable] Dispatched message PDA. An empty message PDA relating to the seeds +/// 2. `[writeable]` Outbox PDA. +/// 3. `[]` This program's dispatch authority. +/// 4. `[executable]` System program. +/// 5. `[executable]` SPL Noop program. +/// 6. `[signer]` Payer. +/// 7. `[signer]` Unique message account. +/// 8. `[writeable]` Dispatched message PDA. An empty message PDA relating to the seeds /// `mailbox_dispatched_message_pda_seeds` where the message contents will be stored. fn dispatch( program_id: &Pubkey, @@ -291,8 +291,8 @@ fn dispatch( /// Handles a message. /// /// Accounts: -/// 0. [writeable] Process authority specific to this program. -/// 1. [] Storage PDA account. +/// 0. `[writeable]` Process authority specific to this program. +/// 1. `[]` Storage PDA account. pub fn handle( program_id: &Pubkey, accounts: &[AccountInfo], @@ -367,7 +367,7 @@ pub fn handle( } /// Accounts: -/// 0. [writeable] Storage PDA account. +/// 0. `[writeable]` Storage PDA account. fn set_interchain_security_module( _program_id: &Pubkey, accounts: &[AccountInfo], @@ -392,7 +392,7 @@ fn set_interchain_security_module( } /// Accounts: -/// 0. [] Storage PDA account. +/// 0. `[]` Storage PDA account. fn get_interchain_security_module(_program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult { let accounts_iter = &mut accounts.iter(); @@ -424,7 +424,7 @@ fn get_interchain_security_module(_program_id: &Pubkey, accounts: &[AccountInfo] } /// Accounts: -/// 0. [writeable] Storage PDA account. +/// 0. `[writeable]` Storage PDA account. fn set_handle_mode( _program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/rust/sealevel/programs/test-send-receiver/src/test_client.rs b/rust/sealevel/programs/test-send-receiver/src/test_client.rs index 3096c10f7b..2f1539d9fe 100644 --- a/rust/sealevel/programs/test-send-receiver/src/test_client.rs +++ b/rust/sealevel/programs/test-send-receiver/src/test_client.rs @@ -48,9 +48,9 @@ impl TestSendReceiverTestClient { .try_to_vec() .unwrap(), accounts: vec![ - // 0. [executable] System program. - // 1. [signer] Payer. - // 2. [writeable] Storage PDA. + // 0. `[executable]` System program. + // 1. `[signer]` Payer. + // 2. `[writeable]` Storage PDA. AccountMeta::new_readonly(system_program::id(), false), AccountMeta::new(payer_pubkey, true), AccountMeta::new(Self::get_storage_pda_key(), false), @@ -85,7 +85,7 @@ impl TestSendReceiverTestClient { .try_to_vec() .unwrap(), accounts: vec![ - // 0. [writeable] Storage PDA. + // 0. `[writeable]` Storage PDA. AccountMeta::new(Self::get_storage_pda_key(), false), ], }; @@ -114,7 +114,7 @@ impl TestSendReceiverTestClient { .try_to_vec() .unwrap(), accounts: vec![ - // 0. [writeable] Storage PDA. + // 0. `[writeable]` Storage PDA. AccountMeta::new(storage_pda_key, false), ], }; @@ -155,15 +155,15 @@ impl TestSendReceiverTestClient { .try_to_vec() .unwrap(), accounts: vec![ - // 0. [executable] The Mailbox program. + // 0. `[executable]` The Mailbox program. // And now the accounts expected by the Mailbox's OutboxDispatch instruction: - // 1. [writeable] Outbox PDA. - // 2. [] This program's dispatch authority. - // 3. [executable] System program. - // 4. [executable] SPL Noop program. - // 5. [signer] Payer. - // 6. [signer] Unique message account. - // 7. [writeable] Dispatched message PDA. An empty message PDA relating to the seeds + // 1. `[writeable]` Outbox PDA. + // 2. `[]` This program's dispatch authority. + // 3. `[executable]` System program. + // 4. `[executable]` SPL Noop program. + // 5. `[signer]` Payer. + // 6. `[signer]` Unique message account. + // 7. `[writeable]` Dispatched message PDA. An empty message PDA relating to the seeds // `mailbox_dispatched_message_pda_seeds` where the message contents will be stored. AccountMeta::new_readonly(mailbox_accounts.program, false), AccountMeta::new(mailbox_accounts.outbox, false), diff --git a/rust/sealevel/programs/validator-announce/src/instruction.rs b/rust/sealevel/programs/validator-announce/src/instruction.rs index 6501bbd398..a94898fe3d 100644 --- a/rust/sealevel/programs/validator-announce/src/instruction.rs +++ b/rust/sealevel/programs/validator-announce/src/instruction.rs @@ -80,9 +80,9 @@ pub fn init_instruction( }); // Accounts: - // 0. [signer] The payer. - // 1. [executable] The system program. - // 2. [writable] The ValidatorAnnounce PDA account. + // 0. `[signer]` The payer. + // 1. `[executable]` The system program. + // 2. `[writable]` The ValidatorAnnounce PDA account. let accounts = vec![ AccountMeta::new_readonly(payer, true), AccountMeta::new_readonly(solana_program::system_program::id(), false), diff --git a/rust/sealevel/programs/validator-announce/src/processor.rs b/rust/sealevel/programs/validator-announce/src/processor.rs index 253c58d569..409dc29e78 100644 --- a/rust/sealevel/programs/validator-announce/src/processor.rs +++ b/rust/sealevel/programs/validator-announce/src/processor.rs @@ -49,9 +49,9 @@ pub fn process_instruction( /// Initializes the program. /// /// Accounts: -/// 0. [signer] The payer. -/// 1. [executable] The system program. -/// 2. [writable] The ValidatorAnnounce PDA account. +/// 0. `[signer]` The payer. +/// 1. `[executable]` The system program. +/// 2. `[writable]` The ValidatorAnnounce PDA account. pub fn process_init( program_id: &Pubkey, accounts: &[AccountInfo], @@ -115,11 +115,11 @@ pub fn process_init( /// Announces a validator. /// /// Accounts: -/// 0. [signer] The payer. -/// 1. [executable] The system program. -/// 2. [] The ValidatorAnnounce PDA account. -/// 3. [writeable] The validator-specific ValidatorStorageLocationsAccount PDA account. -/// 4. [writeable] The ReplayProtection PDA account specific to the announcement being made. +/// 0. `[signer]` The payer. +/// 1. `[executable]` The system program. +/// 2. `[]` The ValidatorAnnounce PDA account. +/// 3. `[writeable]` The validator-specific ValidatorStorageLocationsAccount PDA account. +/// 4. `[writeable]` The ReplayProtection PDA account specific to the announcement being made. fn process_announce( program_id: &Pubkey, accounts: &[AccountInfo], diff --git a/rust/sealevel/programs/validator-announce/tests/functional.rs b/rust/sealevel/programs/validator-announce/tests/functional.rs index 68ee589f9d..cf1b5f0f55 100644 --- a/rust/sealevel/programs/validator-announce/tests/functional.rs +++ b/rust/sealevel/programs/validator-announce/tests/functional.rs @@ -88,9 +88,9 @@ async fn initialize( Pubkey::find_program_address(validator_announce_pda_seeds!(), &program_id); // Accounts: - // 0. [signer] The payer. - // 1. [executable] The system program. - // 2. [writable] The ValidatorAnnounce PDA account. + // 0. `[signer]` The payer. + // 1. `[executable]` The system program. + // 2. `[writable]` The ValidatorAnnounce PDA account. let init_instruction = Instruction::new_with_borsh( program_id, &ValidatorAnnounceInstruction::Init(InitInstruction { @@ -194,11 +194,11 @@ async fn announce( Pubkey::find_program_address(replay_protection_pda_seeds!(replay_id), &program_id); // Accounts: - // 0. [signer] The payer. - // 1. [executable] The system program. - // 2. [] The ValidatorAnnounce PDA account. - // 3. [writeable] The validator-specific ValidatorStorageLocationsAccount PDA account. - // 4. [writeable] The ReplayProtection PDA account specific to the announcement being made. + // 0. `[signer]` The payer. + // 1. `[executable]` The system program. + // 2. `[]` The ValidatorAnnounce PDA account. + // 3. `[writeable]` The validator-specific ValidatorStorageLocationsAccount PDA account. + // 4. `[writeable]` The ReplayProtection PDA account specific to the announcement being made. let announce_instruction = Instruction::new_with_borsh( program_id, &ValidatorAnnounceInstruction::Announce(announce_instruction), diff --git a/rust/utils/run-locally/Cargo.toml b/rust/utils/run-locally/Cargo.toml index 66e86a92bc..03d771734e 100644 --- a/rust/utils/run-locally/Cargo.toml +++ b/rust/utils/run-locally/Cargo.toml @@ -11,8 +11,10 @@ version.workspace = true [dependencies] hyperlane-core = { path = "../../hyperlane-core", features = ["float"]} +hyperlane-cosmos = { path = "../../chains/hyperlane-cosmos"} toml_edit.workspace = true k256.workspace = true +jobserver.workspace = true ripemd.workspace = true sha2.workspace = true serde.workspace = true @@ -29,3 +31,6 @@ macro_rules_attribute.workspace = true regex.workspace = true hpl-interface.workspace = true cosmwasm-schema.workspace = true + +[features] +cosmos = [] \ No newline at end of file diff --git a/rust/utils/run-locally/src/cosmos/cli.rs b/rust/utils/run-locally/src/cosmos/cli.rs index b221c9f499..4258f149c2 100644 --- a/rust/utils/run-locally/src/cosmos/cli.rs +++ b/rust/utils/run-locally/src/cosmos/cli.rs @@ -1,5 +1,6 @@ use std::{collections::BTreeMap, io::Write, path::PathBuf, process::Stdio}; +use hyperlane_cosmos::RawCosmosAmount; use k256::ecdsa::SigningKey; use crate::{ @@ -9,7 +10,7 @@ use crate::{ use super::{ crypto::KeyPair, default_keys, modify_toml, sed, types::BalanceResponse, wait_for_node, Codes, - Coin, TxResponse, + TxResponse, }; const GENESIS_FUND: u128 = 1000000000000; @@ -253,7 +254,7 @@ impl OsmosisCLI { sender: &str, contract: &str, execute_msg: T, - funds: Vec, + funds: Vec, ) -> TxResponse { let mut cmd = self .cli() diff --git a/rust/utils/run-locally/src/cosmos/crypto.rs b/rust/utils/run-locally/src/cosmos/crypto.rs index e4520cbcbf..9b336f4df7 100644 --- a/rust/utils/run-locally/src/cosmos/crypto.rs +++ b/rust/utils/run-locally/src/cosmos/crypto.rs @@ -1,6 +1,4 @@ -// TODO: this file can be removed if `CosmosAddress` can be imported from `hyperlane-cosmos`. -// However, adding a hyperlane-cosmos dep creates a dep cycle. -// Look into how this can be fixed. +// TODO: this file can be removed by replacing `KeyPair` uses with `CosmosAddress` use k256::ecdsa::{SigningKey, VerifyingKey}; use ripemd::Ripemd160; diff --git a/rust/utils/run-locally/src/cosmos/mod.rs b/rust/utils/run-locally/src/cosmos/mod.rs index 28c9515137..a61df94166 100644 --- a/rust/utils/run-locally/src/cosmos/mod.rs +++ b/rust/utils/run-locally/src/cosmos/mod.rs @@ -6,6 +6,7 @@ use std::{env, fs}; use cosmwasm_schema::cw_serde; use hpl_interface::types::bech32_decode; +use hyperlane_cosmos::RawCosmosAmount; use macro_rules_attribute::apply; use maplit::hashmap; use tempfile::tempdir; @@ -506,7 +507,7 @@ fn run_locally() { metadata: "".to_string(), }, }, - vec![Coin { + vec![RawCosmosAmount { denom: "uosmo".to_string(), amount: 25_000_000.to_string(), }], @@ -609,7 +610,7 @@ fn termination_invariants_met( Ok(true) } -#[cfg(test)] +#[cfg(feature = "cosmos")] mod test { use super::*; diff --git a/rust/utils/run-locally/src/cosmos/types.rs b/rust/utils/run-locally/src/cosmos/types.rs index f50986b600..d3a515c4e7 100644 --- a/rust/utils/run-locally/src/cosmos/types.rs +++ b/rust/utils/run-locally/src/cosmos/types.rs @@ -1,6 +1,7 @@ use std::{collections::BTreeMap, path::PathBuf}; use hpl_interface::types::bech32_decode; +use hyperlane_cosmos::RawCosmosAmount; use super::{cli::OsmosisCLI, CosmosNetwork}; @@ -35,12 +36,6 @@ pub struct TxResponse { pub logs: Vec, } -#[derive(serde::Serialize, serde::Deserialize)] -pub struct Coin { - pub denom: String, - pub amount: String, -} - #[derive(serde::Serialize, serde::Deserialize, Clone)] pub struct Codes { pub hpl_hook_merkle: u64, @@ -73,7 +68,7 @@ pub struct Deployments { #[derive(serde::Serialize, serde::Deserialize)] pub struct BalanceResponse { - pub balances: Vec, + pub balances: Vec, } #[derive(serde::Serialize, serde::Deserialize)] @@ -125,6 +120,7 @@ pub struct AgentConfig { pub prefix: String, pub signer: AgentConfigSigner, pub index: AgentConfigIndex, + pub gas_price: RawCosmosAmount, } #[derive(serde::Serialize, serde::Deserialize, Clone, Debug)] @@ -164,6 +160,10 @@ impl AgentConfig { key: format!("0x{}", hex::encode(validator.priv_key.to_bytes())), prefix: "osmo".to_string(), }, + gas_price: RawCosmosAmount { + denom: "uosmo".to_string(), + amount: "0.05".to_string(), + }, index: AgentConfigIndex { from: 1, chunk: 100, diff --git a/rust/utils/run-locally/src/invariants.rs b/rust/utils/run-locally/src/invariants.rs index 6fe857a436..6900210469 100644 --- a/rust/utils/run-locally/src/invariants.rs +++ b/rust/utils/run-locally/src/invariants.rs @@ -1,24 +1,26 @@ // use std::path::Path; +use std::path::Path; + use crate::config::Config; use crate::metrics::agent_balance_sum; use maplit::hashmap; use crate::logging::log; +use crate::solana::solana_termination_invariants_met; use crate::{fetch_metric, ZERO_MERKLE_INSERTION_KATHY_MESSAGES}; -// use crate::solana::solana_termination_invariants_met; // This number should be even, so the messages can be split into two equal halves // sent before and after the relayer spins up, to avoid rounding errors. -pub const SOL_MESSAGES_EXPECTED: u32 = 0; +pub const SOL_MESSAGES_EXPECTED: u32 = 20; /// Use the metrics to check if the relayer queues are empty and the expected /// number of messages have been sent. pub fn termination_invariants_met( config: &Config, starting_relayer_balance: f64, - // solana_cli_tools_path: &Path, - // solana_config_path: &Path, + solana_cli_tools_path: &Path, + solana_config_path: &Path, ) -> eyre::Result { let eth_messages_expected = (config.kathy_messages / 2) as u32 * 2; let total_messages_expected = eth_messages_expected + SOL_MESSAGES_EXPECTED; @@ -74,10 +76,10 @@ pub fn termination_invariants_met( return Ok(false); } - // if !solana_termination_invariants_met(solana_cli_tools_path, solana_config_path) { - // log!("Solana termination invariants not met"); - // return Ok(false); - // } + if !solana_termination_invariants_met(solana_cli_tools_path, solana_config_path) { + log!("Solana termination invariants not met"); + return Ok(false); + } let dispatched_messages_scraped = fetch_metric( "9093", diff --git a/rust/utils/run-locally/src/main.rs b/rust/utils/run-locally/src/main.rs index 52d56ed5d4..b4efc6115f 100644 --- a/rust/utils/run-locally/src/main.rs +++ b/rust/utils/run-locally/src/main.rs @@ -29,7 +29,7 @@ use tempfile::tempdir; use crate::{ config::Config, ethereum::start_anvil, - invariants::termination_invariants_met, + invariants::{termination_invariants_met, SOL_MESSAGES_EXPECTED}, metrics::agent_balance_sum, solana::*, utils::{concat_path, make_static, stop_child, AgentHandles, ArbitraryData, TaskHandle}, @@ -54,9 +54,9 @@ const RELAYER_KEYS: &[&str] = &[ // test3 "0x4bbbf85ce3377467afe5d46f804f221813b2bb87f24d81f60f1fcdbf7cbf4356", // sealeveltest1 - // "0x892bf6949af4233e62f854cb3618bc1a3ee3341dc71ada08c4d5deca239acf4f", - // // sealeveltest2 - // "0x892bf6949af4233e62f854cb3618bc1a3ee3341dc71ada08c4d5deca239acf4f", + "0x892bf6949af4233e62f854cb3618bc1a3ee3341dc71ada08c4d5deca239acf4f", + // sealeveltest2 + "0x892bf6949af4233e62f854cb3618bc1a3ee3341dc71ada08c4d5deca239acf4f", ]; /// These private keys are from hardhat/anvil's testing accounts. /// These must be consistent with the ISM config for the test. @@ -66,15 +66,13 @@ const VALIDATOR_KEYS: &[&str] = &[ "0x8b3a350cf5c34c9194ca85829a2df0ec3153be0318b5e2d3348e872092edffba", "0x92db14e403b83dfe3df233f83dfa3a0d7096f21ca9b0d6d6b8d88b2b4ec1564e", // sealevel - // "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d", + "0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d", ]; -const VALIDATOR_ORIGIN_CHAINS: &[&str] = &["test1", "test2", "test3"]; -// const VALIDATOR_ORIGIN_CHAINS: &[&str] = &["test1", "test2", "test3", "sealeveltest1"]; +const VALIDATOR_ORIGIN_CHAINS: &[&str] = &["test1", "test2", "test3", "sealeveltest1"]; const AGENT_BIN_PATH: &str = "target/debug"; const INFRA_PATH: &str = "../typescript/infra"; -// const TS_SDK_PATH: &str = "../typescript/sdk"; const MONOREPO_ROOT_PATH: &str = "../"; const ZERO_MERKLE_INSERTION_KATHY_MESSAGES: u32 = 10; @@ -92,6 +90,7 @@ struct State { watchers: Vec>>, data: Vec>, } + impl State { fn push_agent(&mut self, handles: AgentHandles) { self.agents.push((handles.0, handles.1)); @@ -100,6 +99,7 @@ impl State { self.data.push(handles.4); } } + impl Drop for State { fn drop(&mut self) { SHUTDOWN.store(true, Ordering::Relaxed); @@ -137,11 +137,11 @@ fn main() -> ExitCode { let config = Config::load(); - // let solana_checkpoint_path = Path::new(SOLANA_CHECKPOINT_LOCATION); - // fs::remove_dir_all(solana_checkpoint_path).unwrap_or_default(); - let checkpoints_dirs: Vec = (0..VALIDATOR_COUNT) + let solana_checkpoint_path = Path::new(SOLANA_CHECKPOINT_LOCATION); + fs::remove_dir_all(solana_checkpoint_path).unwrap_or_default(); + let checkpoints_dirs: Vec = (0..VALIDATOR_COUNT - 1) .map(|_| Box::new(tempdir().unwrap()) as DynPath) - // .chain([Box::new(solana_checkpoint_path) as DynPath]) + .chain([Box::new(solana_checkpoint_path) as DynPath]) .collect(); let rocks_db_dir = tempdir().unwrap(); let relayer_db = concat_path(&rocks_db_dir, "relayer"); @@ -173,8 +173,8 @@ fn main() -> ExitCode { .hyp_env("DB", relayer_db.to_str().unwrap()) .hyp_env("CHAINS_TEST1_SIGNER_KEY", RELAYER_KEYS[0]) .hyp_env("CHAINS_TEST2_SIGNER_KEY", RELAYER_KEYS[1]) - // .hyp_env("CHAINS_SEALEVELTEST1_SIGNER_KEY", RELAYER_KEYS[3]) - // .hyp_env("CHAINS_SEALEVELTEST2_SIGNER_KEY", RELAYER_KEYS[4]) + .hyp_env("CHAINS_SEALEVELTEST1_SIGNER_KEY", RELAYER_KEYS[3]) + .hyp_env("CHAINS_SEALEVELTEST2_SIGNER_KEY", RELAYER_KEYS[4]) .hyp_env("RELAYCHAINS", "invalidchain,otherinvalid") .hyp_env("ALLOWLOCALCHECKPOINTSYNCERS", "true") .hyp_env( @@ -201,8 +201,7 @@ fn main() -> ExitCode { .arg("defaultSigner.key", RELAYER_KEYS[2]) .arg( "relayChains", - "test1,test2,test3", - // "test1,test2,test3,sealeveltest1,sealeveltest2", + "test1,test2,test3,sealeveltest1,sealeveltest2", ); let base_validator_env = common_agent_env @@ -274,9 +273,9 @@ fn main() -> ExitCode { // Ready to run... // - // let (solana_path, solana_path_tempdir) = install_solana_cli_tools().join(); - // state.data.push(Box::new(solana_path_tempdir)); - // let solana_program_builder = build_solana_programs(solana_path.clone()); + let (solana_path, solana_path_tempdir) = install_solana_cli_tools().join(); + state.data.push(Box::new(solana_path_tempdir)); + let solana_program_builder = build_solana_programs(solana_path.clone()); // this task takes a long time in the CI so run it in parallel log!("Building rust..."); @@ -287,13 +286,13 @@ fn main() -> ExitCode { .arg("bin", "validator") .arg("bin", "scraper") .arg("bin", "init-db") - // .arg("bin", "hyperlane-sealevel-client") + .arg("bin", "hyperlane-sealevel-client") .filter_logs(|l| !l.contains("workspace-inheritance")) .run(); let start_anvil = start_anvil(config.clone()); - // let solana_program_path = solana_program_builder.join(); + let solana_program_path = solana_program_builder.join(); log!("Running postgres db..."); let postgres = Program::new("docker") @@ -308,15 +307,15 @@ fn main() -> ExitCode { build_rust.join(); - // let solana_ledger_dir = tempdir().unwrap(); - // let start_solana_validator = start_solana_test_validator( - // solana_path.clone(), - // solana_program_path, - // solana_ledger_dir.as_ref().to_path_buf(), - // ); + let solana_ledger_dir = tempdir().unwrap(); + let start_solana_validator = start_solana_test_validator( + solana_path.clone(), + solana_program_path, + solana_ledger_dir.as_ref().to_path_buf(), + ); - // let (_solana_config_path, solana_validator) = start_solana_validator.join(); - // state.push_agent(solana_validator); + let (solana_config_path, solana_validator) = start_solana_validator.join(); + state.push_agent(solana_validator); state.push_agent(start_anvil.join()); // spawn 1st validator before any messages have been sent to test empty mailbox @@ -362,9 +361,9 @@ fn main() -> ExitCode { kathy_env_double_insertion.clone().run().join(); // Send some sealevel messages before spinning up the agents, to test the backward indexing cursor - // for _i in 0..(SOL_MESSAGES_EXPECTED / 2) { - // initiate_solana_hyperlane_transfer(solana_path.clone(), solana_config_path.clone()).join(); - // } + for _i in 0..(SOL_MESSAGES_EXPECTED / 2) { + initiate_solana_hyperlane_transfer(solana_path.clone(), solana_config_path.clone()).join(); + } // spawn the rest of the validators for (i, validator_env) in validator_envs.into_iter().enumerate().skip(1) { @@ -375,9 +374,9 @@ fn main() -> ExitCode { state.push_agent(relayer_env.spawn("RLY")); // Send some sealevel messages after spinning up the relayer, to test the forward indexing cursor - // for _i in 0..(SOL_MESSAGES_EXPECTED / 2) { - // initiate_solana_hyperlane_transfer(solana_path.clone(), solana_config_path.clone()).join(); - // } + for _i in 0..(SOL_MESSAGES_EXPECTED / 2) { + initiate_solana_hyperlane_transfer(solana_path.clone(), solana_config_path.clone()).join(); + } log!("Setup complete! Agents running in background..."); log!("Ctrl+C to end execution..."); @@ -395,9 +394,14 @@ fn main() -> ExitCode { while !SHUTDOWN.load(Ordering::Relaxed) { if config.ci_mode { // for CI we have to look for the end condition. - if termination_invariants_met(&config, starting_relayer_balance) - // if termination_invariants_met(&config, &solana_path, &solana_config_path) - .unwrap_or(false) + // if termination_invariants_met(&config, starting_relayer_balance) + if termination_invariants_met( + &config, + starting_relayer_balance, + &solana_path, + &solana_config_path, + ) + .unwrap_or(false) { // end condition reached successfully break; diff --git a/rust/utils/run-locally/src/solana.rs b/rust/utils/run-locally/src/solana.rs index 1d2ccea623..94dbd926f5 100644 --- a/rust/utils/run-locally/src/solana.rs +++ b/rust/utils/run-locally/src/solana.rs @@ -282,10 +282,10 @@ pub fn start_solana_test_validator( } #[apply(as_task)] -pub fn _initiate_solana_hyperlane_transfer( +pub fn initiate_solana_hyperlane_transfer( solana_cli_tools_path: PathBuf, solana_config_path: PathBuf, -) { +) -> String { let sender = Program::new(concat_path(&solana_cli_tools_path, "solana")) .arg("config", solana_config_path.to_str().unwrap()) .arg("keypair", SOLANA_KEYPAIR) @@ -309,21 +309,20 @@ pub fn _initiate_solana_hyperlane_transfer( .run_with_output() .join(); - let message_id = _get_message_id_from_logs(output); - if let Some(message_id) = message_id { - sealevel_client(&solana_cli_tools_path, &solana_config_path) - .cmd("igp") - .cmd("pay-for-gas") - .arg("program-id", "GwHaw8ewMyzZn9vvrZEnTEAAYpLdkGYs195XWcLDCN4U") - .arg("message-id", message_id) - .arg("destination-domain", SOLANA_REMOTE_CHAIN_ID) - .arg("gas", "100000") - .run() - .join(); - } + let message_id = get_message_id_from_logs(output).expect("failed to get message id from logs"); + sealevel_client(&solana_cli_tools_path, &solana_config_path) + .cmd("igp") + .cmd("pay-for-gas") + .arg("program-id", "GwHaw8ewMyzZn9vvrZEnTEAAYpLdkGYs195XWcLDCN4U") + .arg("message-id", message_id.clone()) + .arg("destination-domain", SOLANA_REMOTE_CHAIN_ID) + .arg("gas", "100000") + .run() + .join(); + message_id } -fn _get_message_id_from_logs(logs: Vec) -> Option { +fn get_message_id_from_logs(logs: Vec) -> Option { let message_id_regex = Regex::new(r"Dispatched message to \d+, ID 0x([0-9a-fA-F]+)").unwrap(); for log in logs { // Use the regular expression to capture the ID @@ -337,7 +336,7 @@ fn _get_message_id_from_logs(logs: Vec) -> Option { None } -pub fn _solana_termination_invariants_met( +pub fn solana_termination_invariants_met( solana_cli_tools_path: &Path, solana_config_path: &Path, ) -> bool { @@ -349,7 +348,7 @@ pub fn _solana_termination_invariants_met( // This value was gotten by observing the relayer logs. // TODO: get the actual message-id so we don't have to hardcode it "message-id", - "0x7b8ba684e5ce44f898c5fa81785c83a00e32b5bef3412e648eb7a17bec497685", + "0x89c76191bd40b1858b7957e35bf3455122826e4737c5540b9dc5a555370d78c5", ) .arg("program-id", "9tCUWNjpqcf3NUSrtp7vquYVCwbEByvLjZUrhG5dgvhj") .run_with_output() diff --git a/solidity/CHANGELOG.md b/solidity/CHANGELOG.md index 783c5065a0..0a63377559 100644 --- a/solidity/CHANGELOG.md +++ b/solidity/CHANGELOG.md @@ -1,5 +1,13 @@ # @hyperlane-xyz/core +## 3.4.0 + +### Patch Changes + +- e06fe0b32: Supporting DefaultFallbackRoutingIsm through non-factory deployments +- Updated dependencies [fd4fc1898] + - @hyperlane-xyz/utils@3.4.0 + ## 3.3.0 ### Patch Changes diff --git a/solidity/package.json b/solidity/package.json index 459353ebca..d19a718e8e 100644 --- a/solidity/package.json +++ b/solidity/package.json @@ -1,10 +1,10 @@ { "name": "@hyperlane-xyz/core", "description": "Core solidity contracts for Hyperlane", - "version": "3.3.0", + "version": "3.4.0", "dependencies": { "@eth-optimism/contracts": "^0.6.0", - "@hyperlane-xyz/utils": "3.3.0", + "@hyperlane-xyz/utils": "3.4.0", "@openzeppelin/contracts": "^4.9.3", "@openzeppelin/contracts-upgradeable": "^v4.9.3" }, diff --git a/typescript/cli/CHANGELOG.md b/typescript/cli/CHANGELOG.md index 70ee047338..bf03bac185 100644 --- a/typescript/cli/CHANGELOG.md +++ b/typescript/cli/CHANGELOG.md @@ -1,5 +1,20 @@ # @hyperlane-xyz/cli +## 3.4.0 + +### Patch Changes + +- e06fe0b32: Supporting DefaultFallbackRoutingIsm through non-factory deployments +- dcf8b800a: Fixes for commands with --yes flag +- 9c7dbcb94: Remove domainId and protocolType setting when creating chain config +- Updated dependencies [7919417ec] +- Updated dependencies [fd4fc1898] +- Updated dependencies [e06fe0b32] +- Updated dependencies [b832e57ae] +- Updated dependencies [79c96d718] + - @hyperlane-xyz/sdk@3.4.0 + - @hyperlane-xyz/utils@3.4.0 + ## 3.3.0 ### Minor Changes diff --git a/typescript/cli/package.json b/typescript/cli/package.json index 21bfae776f..c0ac92c5da 100644 --- a/typescript/cli/package.json +++ b/typescript/cli/package.json @@ -1,10 +1,10 @@ { "name": "@hyperlane-xyz/cli", - "version": "3.3.0", + "version": "3.4.0", "description": "A command-line utility for common Hyperlane operations", "dependencies": { - "@hyperlane-xyz/sdk": "3.3.0", - "@hyperlane-xyz/utils": "3.3.0", + "@hyperlane-xyz/sdk": "3.4.0", + "@hyperlane-xyz/utils": "3.4.0", "@inquirer/prompts": "^3.0.0", "bignumber.js": "^9.1.1", "chalk": "^5.3.0", diff --git a/typescript/cli/src/commands/deploy.ts b/typescript/cli/src/commands/deploy.ts index f75238dc22..fffcb96d72 100644 --- a/typescript/cli/src/commands/deploy.ts +++ b/typescript/cli/src/commands/deploy.ts @@ -19,7 +19,7 @@ import { */ export const deployCommand: CommandModule = { command: 'deploy', - describe: 'Permisionslessly deploy a Hyperlane contracts or extensions', + describe: 'Permissionlessly deploy a Hyperlane contracts or extensions', builder: (yargs) => yargs .command(coreCommand) diff --git a/typescript/cli/src/config/artifacts.ts b/typescript/cli/src/config/artifacts.ts index 5b54b169f4..87a994deda 100644 --- a/typescript/cli/src/config/artifacts.ts +++ b/typescript/cli/src/config/artifacts.ts @@ -33,14 +33,24 @@ export function readDeploymentArtifacts(filePath: string) { return artifacts; } -export async function runDeploymentArtifactStep( - artifactsPath?: string, - message?: string, - selectedChains?: ChainName[], +export async function runDeploymentArtifactStep({ + artifactsPath, + message, + selectedChains, defaultArtifactsPath = './artifacts', defaultArtifactsNamePattern = 'core-deployment', -): Promise | undefined> { + skipConfirmation = false, +}: { + artifactsPath?: string; + message?: string; + selectedChains?: ChainName[]; + defaultArtifactsPath?: string; + defaultArtifactsNamePattern?: string; + skipConfirmation?: boolean; +}): Promise | undefined> { if (!artifactsPath) { + if (skipConfirmation) return undefined; + const useArtifacts = await confirm({ message: message || 'Do you want use some existing contract addresses?', }); diff --git a/typescript/cli/src/config/chain.ts b/typescript/cli/src/config/chain.ts index 2f33292bcb..f3499fde7a 100644 --- a/typescript/cli/src/config/chain.ts +++ b/typescript/cli/src/config/chain.ts @@ -1,4 +1,4 @@ -import { confirm, input, select } from '@inquirer/prompts'; +import { input } from '@inquirer/prompts'; import { ChainMap, @@ -81,30 +81,13 @@ export async function createChainConfig({ message: 'Enter chain name (one word, lower case)', }); const chainId = await input({ message: 'Enter chain id (number)' }); - const skipDomain = await confirm({ - message: 'Will the domainId match the chainId (recommended)?', - }); - let domainId: string; - if (skipDomain) { - domainId = chainId; - } else { - domainId = await input({ - message: 'Enter domain id (number, often matches chainId)', - }); - } - const protocol = await select({ - message: 'Select protocol type', - choices: Object.values(ProtocolType).map((protocol) => ({ - name: protocol, - value: protocol, - })), - }); + const domainId = chainId; const rpcUrl = await input({ message: 'Enter http or https rpc url' }); const metadata: ChainMetadata = { name, chainId: parseInt(chainId, 10), domainId: parseInt(domainId, 10), - protocol, + protocol: ProtocolType.Ethereum, rpcUrls: [{ http: rpcUrl }], }; const parseResult = ChainMetadataSchema.safeParse(metadata); diff --git a/typescript/cli/src/context.ts b/typescript/cli/src/context.ts index d3aa6d58e2..11fa8326d0 100644 --- a/typescript/cli/src/context.ts +++ b/typescript/cli/src/context.ts @@ -55,6 +55,7 @@ interface ContextSettings { key?: string; promptMessage?: string; }; + skipConfirmation?: boolean; } interface CommandContextBase { @@ -75,29 +76,34 @@ export async function getContext

({ chainConfigPath, coreConfig, keyConfig, + skipConfirmation, }: P): Promise> { const customChains = readChainConfigsIfExists(chainConfigPath); let signer = undefined; if (keyConfig) { - const key = - keyConfig.key || - (await input({ + let key: string; + if (keyConfig.key) key = keyConfig.key; + else if (skipConfirmation) throw new Error('No key provided'); + else + key = await input({ message: keyConfig.promptMessage || 'Please enter a private key or use the HYP_KEY environment variable', - })); + }); signer = keyToSigner(key); } let coreArtifacts = undefined; if (coreConfig) { coreArtifacts = - (await runDeploymentArtifactStep( - coreConfig.coreArtifactsPath, - coreConfig.promptMessage || + (await runDeploymentArtifactStep({ + artifactsPath: coreConfig.coreArtifactsPath, + message: + coreConfig.promptMessage || 'Do you want to use some core deployment address artifacts? This is required for PI chains (non-core chains).', - )) || {}; + skipConfirmation, + })) || {}; } const multiProvider = getMultiProvider(customChains, signer); diff --git a/typescript/cli/src/deploy/core.ts b/typescript/cli/src/deploy/core.ts index c49875ba26..47d0b688ca 100644 --- a/typescript/cli/src/deploy/core.ts +++ b/typescript/cli/src/deploy/core.ts @@ -79,17 +79,23 @@ export async function runCoreDeploy({ const { customChains, multiProvider, signer } = await getContext({ chainConfigPath, keyConfig: { key }, + skipConfirmation, }); if (!chains?.length) { + if (skipConfirmation) throw new Error('No chains provided'); chains = await runMultiChainSelectionStep( customChains, 'Select chains to connect', true, ); } - const artifacts = await runArtifactStep(chains, artifactsPath); - const result = await runIsmStep(chains, ismConfigPath); + const artifacts = await runArtifactStep( + chains, + skipConfirmation, + artifactsPath, + ); + const result = await runIsmStep(chains, skipConfirmation, ismConfigPath); // we can either specify the full ISM config or just the multisig config const isIsmConfig = isISMConfig(result); const ismConfigs = isIsmConfig ? (result as ChainMap) : undefined; @@ -118,14 +124,26 @@ export async function runCoreDeploy({ await executeDeploy(deploymentParams); } -function runArtifactStep(selectedChains: ChainName[], artifactsPath?: string) { +function runArtifactStep( + selectedChains: ChainName[], + skipConfirmation: boolean, + artifactsPath?: string, +) { logBlue( '\nDeployments can be totally new or can use some existing contract addresses.', ); - return runDeploymentArtifactStep(artifactsPath, undefined, selectedChains); + return runDeploymentArtifactStep({ + artifactsPath, + selectedChains, + skipConfirmation, + }); } -async function runIsmStep(selectedChains: ChainName[], ismConfigPath?: string) { +async function runIsmStep( + selectedChains: ChainName[], + skipConfirmation: boolean, + ismConfigPath?: string, +) { if (!ismConfigPath) { logBlue( '\n', @@ -134,6 +152,7 @@ async function runIsmStep(selectedChains: ChainName[], ismConfigPath?: string) { logGray( 'Example config: https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/cli/typescript/cli/examples/ism.yaml', ); + if (skipConfirmation) throw new Error('ISM config required'); ismConfigPath = await runFileSelectionStep( './configs', 'ISM config', diff --git a/typescript/cli/src/deploy/warp.ts b/typescript/cli/src/deploy/warp.ts index 778160edc3..adc70844d6 100644 --- a/typescript/cli/src/deploy/warp.ts +++ b/typescript/cli/src/deploy/warp.ts @@ -52,9 +52,11 @@ export async function runWarpDeploy({ chainConfigPath, coreConfig: { coreArtifactsPath }, keyConfig: { key }, + skipConfirmation, }); if (!warpConfigPath || !isFile(warpConfigPath)) { + if (skipConfirmation) throw new Error('Warp config required'); warpConfigPath = await runFileSelectionStep( './configs', 'Warp config', @@ -70,6 +72,7 @@ export async function runWarpDeploy({ coreArtifacts, multiProvider, signer, + skipConfirmation, }); const deploymentParams = { @@ -95,11 +98,13 @@ async function runBuildConfigStep({ multiProvider, signer, coreArtifacts, + skipConfirmation, }: { warpRouteConfig: WarpRouteConfig; multiProvider: MultiProvider; signer: ethers.Signer; coreArtifacts?: HyperlaneContractsMap; + skipConfirmation: boolean; }) { log('Assembling token configs'); const { base, synthetics } = warpRouteConfig; @@ -164,6 +169,8 @@ async function runBuildConfigStep({ for (const [chain, token] of Object.entries(configMap)) { for (const field of requiredRouterFields) { if (token[field]) continue; + if (skipConfirmation) + throw new Error(`Field ${field} for token on ${chain} required`); if (!hasShownInfo) { logBlue( 'Some router fields are missing. Please enter them now, add them to your warp config, or use the --core flag to use deployment artifacts.', diff --git a/typescript/cli/src/version.ts b/typescript/cli/src/version.ts index 70cb4144f8..a4138e791e 100644 --- a/typescript/cli/src/version.ts +++ b/typescript/cli/src/version.ts @@ -1 +1 @@ -export const VERSION = '3.3.0'; +export const VERSION = '3.4.0'; diff --git a/typescript/helloworld/CHANGELOG.md b/typescript/helloworld/CHANGELOG.md index f88a4c1855..88e2235921 100644 --- a/typescript/helloworld/CHANGELOG.md +++ b/typescript/helloworld/CHANGELOG.md @@ -1,5 +1,17 @@ # @hyperlane-xyz/helloworld +## 3.4.0 + +### Patch Changes + +- Updated dependencies [7919417ec] +- Updated dependencies [fd4fc1898] +- Updated dependencies [e06fe0b32] +- Updated dependencies [b832e57ae] +- Updated dependencies [79c96d718] + - @hyperlane-xyz/sdk@3.4.0 + - @hyperlane-xyz/core@3.4.0 + ## 3.3.0 ### Patch Changes diff --git a/typescript/helloworld/package.json b/typescript/helloworld/package.json index eb0b7a3619..585d96b614 100644 --- a/typescript/helloworld/package.json +++ b/typescript/helloworld/package.json @@ -1,10 +1,10 @@ { "name": "@hyperlane-xyz/helloworld", "description": "A basic skeleton of an Hyperlane app", - "version": "3.3.0", + "version": "3.4.0", "dependencies": { - "@hyperlane-xyz/core": "3.3.0", - "@hyperlane-xyz/sdk": "3.3.0", + "@hyperlane-xyz/core": "3.4.0", + "@hyperlane-xyz/sdk": "3.4.0", "@openzeppelin/contracts-upgradeable": "^4.9.3", "ethers": "^5.7.2" }, diff --git a/typescript/infra/CHANGELOG.md b/typescript/infra/CHANGELOG.md index a31a311507..81abc73326 100644 --- a/typescript/infra/CHANGELOG.md +++ b/typescript/infra/CHANGELOG.md @@ -1,5 +1,19 @@ # @hyperlane-xyz/infra +## 3.4.0 + +### Patch Changes + +- e06fe0b32: Supporting DefaultFallbackRoutingIsm through non-factory deployments +- Updated dependencies [7919417ec] +- Updated dependencies [fd4fc1898] +- Updated dependencies [e06fe0b32] +- Updated dependencies [b832e57ae] +- Updated dependencies [79c96d718] + - @hyperlane-xyz/sdk@3.4.0 + - @hyperlane-xyz/utils@3.4.0 + - @hyperlane-xyz/helloworld@3.4.0 + ## 3.3.0 ### Patch Changes diff --git a/typescript/infra/config/environments/mainnet3/agent.ts b/typescript/infra/config/environments/mainnet3/agent.ts index 7349a155cb..d5efa431f2 100644 --- a/typescript/infra/config/environments/mainnet3/agent.ts +++ b/typescript/infra/config/environments/mainnet3/agent.ts @@ -43,14 +43,14 @@ const hyperlane: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '36de5bc-20231205-145629', + tag: '86b7f98-20231207-153805', }, gasPaymentEnforcement, }, validators: { docker: { repo, - tag: '36de5bc-20231205-145629', + tag: '86b7f98-20231207-153805', }, rpcConsensusType: RpcConsensusType.Quorum, chains: validatorChainConfig(Contexts.Hyperlane), @@ -59,7 +59,7 @@ const hyperlane: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '36de5bc-20231205-145629', + tag: '86b7f98-20231207-153805', }, }, }; @@ -72,7 +72,7 @@ const releaseCandidate: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '36de5bc-20231205-145629', + tag: '86b7f98-20231207-153805', }, // whitelist: releaseCandidateHelloworldMatchingList, gasPaymentEnforcement, @@ -84,7 +84,7 @@ const releaseCandidate: RootAgentConfig = { validators: { docker: { repo, - tag: '36de5bc-20231205-145629', + tag: '86b7f98-20231207-153805', }, rpcConsensusType: RpcConsensusType.Quorum, chains: validatorChainConfig(Contexts.ReleaseCandidate), @@ -108,7 +108,7 @@ const neutron: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '36de5bc-20231205-145629', + tag: '86b7f98-20231207-153805', }, gasPaymentEnforcement: [ { diff --git a/typescript/infra/config/environments/mainnet3/chains.ts b/typescript/infra/config/environments/mainnet3/chains.ts index 239c179fd3..437fe170c2 100644 --- a/typescript/infra/config/environments/mainnet3/chains.ts +++ b/typescript/infra/config/environments/mainnet3/chains.ts @@ -52,7 +52,7 @@ export const nonEthereumMainnetConfigs: ChainMap = { export const mainnetConfigs: ChainMap = { ...ethereumMainnetConfigs, - ...nonEthereumMainnetConfigs, + // ...nonEthereumMainnetConfigs, }; export type MainnetChains = keyof typeof mainnetConfigs; diff --git a/typescript/infra/config/environments/mainnet3/funding.ts b/typescript/infra/config/environments/mainnet3/funding.ts index 08d216feca..ef558f7dad 100644 --- a/typescript/infra/config/environments/mainnet3/funding.ts +++ b/typescript/infra/config/environments/mainnet3/funding.ts @@ -9,7 +9,7 @@ import { environment } from './chains'; export const keyFunderConfig: KeyFunderConfig = { docker: { repo: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', - tag: 'b86ebc1-20231207-123951', + tag: 'f6da03e-20231216-141949', }, // We're currently using the same deployer key as mainnet. // To minimize nonce clobbering we offset the key funder cron diff --git a/typescript/infra/config/environments/mainnet3/owners.ts b/typescript/infra/config/environments/mainnet3/owners.ts index 1b4b2a1a0e..809ecc7611 100644 --- a/typescript/infra/config/environments/mainnet3/owners.ts +++ b/typescript/infra/config/environments/mainnet3/owners.ts @@ -13,10 +13,9 @@ export const safes: ChainMap

= { gnosis: '0x36b0AA0e7d04e7b825D7E409FEa3c9A3d57E4C22', // solana: 'EzppBFV2taxWw8kEjxNYvby6q7W1biJEqwP3iC7YgRe3', // TODO: create gnosis safes here - base: '', - scroll: '', - polygonzkevm: '', - mantapacific: '', + base: '0xa7ECcdb9Be08178f896c26b7BbD8C3D4E844d9Ba', + scroll: '0xa7ECcdb9Be08178f896c26b7BbD8C3D4E844d9Ba', + polygonzkevm: '0xa7ECcdb9Be08178f896c26b7BbD8C3D4E844d9Ba', }; // export const owners = safes; diff --git a/typescript/infra/config/environments/mainnet3/warp/addresses.json b/typescript/infra/config/environments/mainnet3/warp/addresses.json new file mode 100644 index 0000000000..79b01185bb --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/addresses.json @@ -0,0 +1,5 @@ +{ + "arbitrum": { + "router": "0x93ca0d85837FF83158Cd14D65B169CdB223b1921" + } +} diff --git a/typescript/infra/config/environments/mainnet3/warp/verification.json b/typescript/infra/config/environments/mainnet3/warp/verification.json new file mode 100644 index 0000000000..023a2a53da --- /dev/null +++ b/typescript/infra/config/environments/mainnet3/warp/verification.json @@ -0,0 +1,16 @@ +{ + "arbitrum": [ + { + "name": "HypERC20", + "address": "0x93ca0d85837FF83158Cd14D65B169CdB223b1921", + "constructorArguments": "0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000979ca5202784112f4738403dbec5d0f3b9daabb9", + "isProxy": false + }, + { + "name": "HypERC20", + "address": "0x93ca0d85837FF83158Cd14D65B169CdB223b1921", + "constructorArguments": "0000000000000000000000000000000000000000000000000000000000000006000000000000000000000000979ca5202784112f4738403dbec5d0f3b9daabb9", + "isProxy": false + } + ] +} diff --git a/typescript/infra/config/environments/testnet4/agent.ts b/typescript/infra/config/environments/testnet4/agent.ts index 662a9431f8..4621e0a1e1 100644 --- a/typescript/infra/config/environments/testnet4/agent.ts +++ b/typescript/infra/config/environments/testnet4/agent.ts @@ -50,7 +50,7 @@ const hyperlane: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '36de5bc-20231205-145629', + tag: '86b7f98-20231207-153805', }, blacklist: [ ...releaseCandidateHelloworldMatchingList, @@ -67,7 +67,7 @@ const hyperlane: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '36de5bc-20231205-145629', + tag: '86b7f98-20231207-153805', }, chains: validatorChainConfig(Contexts.Hyperlane), }, @@ -75,7 +75,7 @@ const hyperlane: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '36de5bc-20231205-145629', + tag: '86b7f98-20231207-153805', }, }, }; @@ -88,7 +88,7 @@ const releaseCandidate: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '36de5bc-20231205-145629', + tag: '86b7f98-20231207-153805', }, whitelist: [...releaseCandidateHelloworldMatchingList], gasPaymentEnforcement, @@ -101,34 +101,13 @@ const releaseCandidate: RootAgentConfig = { rpcConsensusType: RpcConsensusType.Fallback, docker: { repo, - tag: '36de5bc-20231205-145629', + tag: '86b7f98-20231207-153805', }, chains: validatorChainConfig(Contexts.ReleaseCandidate), }, }; -const neutron: RootAgentConfig = { - ...contextBase, - context: Contexts.Neutron, - rolesWithKeys: [Role.Relayer], - contextChainNames: { - relayer: [Chains.goerli], - validator: [], - scraper: [], - }, - relayer: { - rpcConsensusType: RpcConsensusType.Fallback, - docker: { - repo, - tag: '36de5bc-20231205-145629', - }, - gasPaymentEnforcement, - transactionGasLimit: 750000, - }, -}; - export const agents = { [Contexts.Hyperlane]: hyperlane, [Contexts.ReleaseCandidate]: releaseCandidate, - [Contexts.Neutron]: neutron, }; diff --git a/typescript/infra/config/environments/testnet4/chains.ts b/typescript/infra/config/environments/testnet4/chains.ts index a30cf70eb9..3f87914ede 100644 --- a/typescript/infra/config/environments/testnet4/chains.ts +++ b/typescript/infra/config/environments/testnet4/chains.ts @@ -27,7 +27,6 @@ export const ethereumTestnetConfigs: ChainMap = { // Blessed non-Ethereum chains. export const nonEthereumTestnetConfigs: ChainMap = { // solanadevnet: chainMetadata.solanadevnet, - // neutrontestnet: chainMetadata.neutrontestnet, }; export const testnetConfigs: ChainMap = { diff --git a/typescript/infra/config/environments/testnet4/funding.ts b/typescript/infra/config/environments/testnet4/funding.ts index 0e85d92456..75ec4ddf00 100644 --- a/typescript/infra/config/environments/testnet4/funding.ts +++ b/typescript/infra/config/environments/testnet4/funding.ts @@ -9,7 +9,7 @@ import { environment } from './chains'; export const keyFunderConfig: KeyFunderConfig = { docker: { repo: 'gcr.io/abacus-labs-dev/hyperlane-monorepo', - tag: 'b86ebc1-20231207-123951', + tag: 'f6da03e-20231216-141949', }, // We're currently using the same deployer key as testnet2. // To minimize nonce clobbering we offset the key funder cron diff --git a/typescript/infra/config/environments/testnet4/gas-oracle.ts b/typescript/infra/config/environments/testnet4/gas-oracle.ts index 7fda9ad6b1..b173f4d3a5 100644 --- a/typescript/infra/config/environments/testnet4/gas-oracle.ts +++ b/typescript/infra/config/environments/testnet4/gas-oracle.ts @@ -30,7 +30,6 @@ const gasPrices: ChainMap = { polygonzkevmtestnet: ethers.utils.parseUnits('1', 'gwei'), chiado: ethers.utils.parseUnits('2', 'gwei'), // solanadevnet: ethers.BigNumber.from('28'), - neutrontestnet: ethers.utils.parseUnits('0.1', 'gwei'), }; // Used to categorize rarity of testnet tokens & approximate exchange rates. @@ -65,7 +64,6 @@ const chainTokenRarity: ChainMap = { polygonzkevmtestnet: Rarity.Common, chiado: Rarity.Common, // solanadevnet: Rarity.Common, - neutrontestnet: Rarity.Common, }; // Gets the "value" of a testnet chain diff --git a/typescript/infra/config/environments/testnet4/infrastructure.ts b/typescript/infra/config/environments/testnet4/infrastructure.ts index c3367436cb..9429f4782d 100644 --- a/typescript/infra/config/environments/testnet4/infrastructure.ts +++ b/typescript/infra/config/environments/testnet4/infrastructure.ts @@ -40,7 +40,6 @@ export const infrastructure: InfrastructureConfig = { 'testnet3-', 'hyperlane-testnet4-', 'rc-testnet4-', - 'neutron-testnet4-', 'testnet4-', ], }, diff --git a/typescript/infra/config/routingIsm.ts b/typescript/infra/config/routingIsm.ts index 6e4d2e8f36..41271f5207 100644 --- a/typescript/infra/config/routingIsm.ts +++ b/typescript/infra/config/routingIsm.ts @@ -12,7 +12,7 @@ import { import { DeployEnvironment } from '../src/config'; import { Contexts } from './contexts'; -import { supportedChainNames as mainnet3Chains } from './environments/mainnet3/chains'; +import { ethereumChainNames as mainnet3Chains } from './environments/mainnet3/chains'; import { owners as mainnet3Owners } from './environments/mainnet3/owners'; import { owners as testOwners } from './environments/test/owners'; import { supportedChainNames as testnet4Chains } from './environments/testnet4/chains'; @@ -28,7 +28,7 @@ const owners = { const chains = { test: TestChains, testnet4: testnet4Chains, - mainnet3: mainnet3Chains, + mainnet3: mainnet3Chains.filter((_) => _ !== 'mantapacific'), }; // Intended to be the "entrypoint" ISM. diff --git a/typescript/infra/package.json b/typescript/infra/package.json index 6cafbc47cb..b924ce8981 100644 --- a/typescript/infra/package.json +++ b/typescript/infra/package.json @@ -1,7 +1,7 @@ { "name": "@hyperlane-xyz/infra", "description": "Infrastructure utilities for the Hyperlane Network", - "version": "3.3.0", + "version": "3.4.0", "dependencies": { "@arbitrum/sdk": "^3.0.0", "@aws-sdk/client-iam": "^3.74.0", @@ -12,9 +12,9 @@ "@ethersproject/experimental": "^5.7.0", "@ethersproject/hardware-wallets": "^5.7.0", "@ethersproject/providers": "^5.7.2", - "@hyperlane-xyz/helloworld": "3.3.0", - "@hyperlane-xyz/sdk": "3.3.0", - "@hyperlane-xyz/utils": "3.3.0", + "@hyperlane-xyz/helloworld": "3.4.0", + "@hyperlane-xyz/sdk": "3.4.0", + "@hyperlane-xyz/utils": "3.4.0", "@nomiclabs/hardhat-etherscan": "^3.0.3", "@safe-global/api-kit": "^1.3.0", "@safe-global/protocol-kit": "^1.2.0", diff --git a/typescript/infra/scripts/deploy.ts b/typescript/infra/scripts/deploy.ts index 8e109110ff..cc39c893cb 100644 --- a/typescript/infra/scripts/deploy.ts +++ b/typescript/infra/scripts/deploy.ts @@ -4,6 +4,8 @@ import { prompt } from 'prompts'; import { HelloWorldDeployer } from '@hyperlane-xyz/helloworld'; import { ChainMap, + Chains, + HypERC20Deployer, HyperlaneCore, HyperlaneCoreDeployer, HyperlaneDeployer, @@ -13,7 +15,9 @@ import { InterchainAccountDeployer, InterchainQueryDeployer, LiquidityLayerDeployer, + TokenConfig, } from '@hyperlane-xyz/sdk'; +import { TokenDecimals, TokenType } from '@hyperlane-xyz/sdk/dist/token/config'; import { objMap } from '@hyperlane-xyz/utils'; import { Contexts } from '../config/contexts'; @@ -75,6 +79,39 @@ async function main() { multiProvider, ); deployer = new HyperlaneCoreDeployer(multiProvider, ismFactory); + } else if (module === Modules.WARP) { + const owner = deployerAddress; + const neutronRouter = + '6b04c49fcfd98bc4ea9c05cd5790462a39537c00028333474aebe6ddf20b73a3'; + const ismFactory = HyperlaneIsmFactory.fromAddressesMap( + getAddresses(environment, Modules.PROXY_FACTORY), + multiProvider, + ); + const tokenConfig: TokenConfig & TokenDecimals = { + type: TokenType.synthetic, + name: 'Eclipse Fi', + symbol: 'ECLIP', + decimals: 6, + totalSupply: 0, + }; + const core = HyperlaneCore.fromEnvironment( + deployEnvToSdkEnv[environment], + multiProvider, + ); + const routerConfig = core.getRouterConfig(owner); + const targetChains = [Chains.arbitrum]; + config = { + arbitrum: { + ...routerConfig['arbitrum'], + ...tokenConfig, + interchainSecurityModule: '0x53A5c239d62ff35c98E0EC9612c86517748ffF59', + gas: 600_000, + }, + neutron: { + foreignDeployment: neutronRouter, + }, + }; + deployer = new HypERC20Deployer(multiProvider, ismFactory); } else if (module === Modules.INTERCHAIN_GAS_PAYMASTER) { config = envConfig.igp; deployer = new HyperlaneIgpDeployer(multiProvider); diff --git a/typescript/infra/scripts/funding/fund-keys-from-deployer.ts b/typescript/infra/scripts/funding/fund-keys-from-deployer.ts index baffafdd6d..75af8d646e 100644 --- a/typescript/infra/scripts/funding/fund-keys-from-deployer.ts +++ b/typescript/infra/scripts/funding/fund-keys-from-deployer.ts @@ -123,7 +123,7 @@ const RC_FUNDING_DISCOUNT_DENOMINATOR = ethers.BigNumber.from(10); const desiredBalancePerChain: ChainMap = { celo: '0.3', alfajores: '1', - avalanche: '0.3', + avalanche: '3', fuji: '1', ethereum: '0.5', polygon: '2', diff --git a/typescript/infra/src/govern/HyperlaneCoreGovernor.ts b/typescript/infra/src/govern/HyperlaneCoreGovernor.ts index 25547381c8..d41d3effd8 100644 --- a/typescript/infra/src/govern/HyperlaneCoreGovernor.ts +++ b/typescript/infra/src/govern/HyperlaneCoreGovernor.ts @@ -66,6 +66,10 @@ export class HyperlaneCoreGovernor extends HyperlaneAppGovernor< await this.handleMailboxViolation(violation as MailboxViolation); break; } + case CoreViolationType.ValidatorAnnounce: { + console.warn('Ignoring ValidatorAnnounce violation'); + break; + } default: throw new Error(`Unsupported violation type ${violation.type}`); } diff --git a/typescript/sdk/CHANGELOG.md b/typescript/sdk/CHANGELOG.md index 06f0cda296..56d575928b 100644 --- a/typescript/sdk/CHANGELOG.md +++ b/typescript/sdk/CHANGELOG.md @@ -1,5 +1,28 @@ # @hyperlane-xyz/sdk +## 3.4.0 + +### Minor Changes + +- b832e57ae: Replace Fallback and Retry Providers with new SmartProvider with more effective fallback/retry logic + +### Patch Changes + +- 7919417ec: Granular control of updating predeployed routingIsms based on routing config mismatch + - Add support for routingIsmDelta which filters out the incompatibility between the onchain deployed config and the desired config. + - Based on the above, you either update the deployed Ism with new routes, delete old routes, change owners, etc. + - `moduleMatchesConfig` uses the same +- fd4fc1898: - Upgrade Viem to 1.20.0 + - Add optional restUrls field to ChainMetadata + - Add deepCopy util function + - Add support for cosmos factory token addresses +- e06fe0b32: Supporting DefaultFallbackRoutingIsm through non-factory deployments +- 79c96d718: Remove healthy RPC URLs and remove NeutronTestnet +- Updated dependencies [fd4fc1898] +- Updated dependencies [e06fe0b32] + - @hyperlane-xyz/utils@3.4.0 + - @hyperlane-xyz/core@3.4.0 + ## 3.3.0 ### Patch Changes diff --git a/typescript/sdk/package.json b/typescript/sdk/package.json index 78cc14ce72..0bc963543b 100644 --- a/typescript/sdk/package.json +++ b/typescript/sdk/package.json @@ -1,24 +1,24 @@ { "name": "@hyperlane-xyz/sdk", "description": "The official SDK for the Hyperlane Network", - "version": "3.3.0", + "version": "3.4.0", "dependencies": { "@cosmjs/cosmwasm-stargate": "^0.31.3", "@cosmjs/stargate": "^0.31.3", - "@hyperlane-xyz/core": "3.3.0", - "@hyperlane-xyz/utils": "3.3.0", + "@hyperlane-xyz/core": "3.4.0", + "@hyperlane-xyz/utils": "3.4.0", "@solana/spl-token": "^0.3.8", "@solana/web3.js": "^1.78.0", "@types/coingecko-api": "^1.0.10", "@types/debug": "^4.1.7", - "@wagmi/chains": "^0.2.6", + "@wagmi/chains": "^1.8.0", "bignumber.js": "^9.1.1", "coingecko-api": "^1.0.10", "cosmjs-types": "^0.9.0", "cross-fetch": "^3.1.5", "debug": "^4.3.4", "ethers": "^5.7.2", - "viem": "^1.3.1", + "viem": "^1.20.0", "zod": "^3.21.2" }, "devDependencies": { diff --git a/typescript/sdk/src/consts/chainMetadata.ts b/typescript/sdk/src/consts/chainMetadata.ts index 11728d5ac0..253a67ce94 100644 --- a/typescript/sdk/src/consts/chainMetadata.ts +++ b/typescript/sdk/src/consts/chainMetadata.ts @@ -74,14 +74,6 @@ export const arbitrum: ChainMetadata = { }; export const arbitrumgoerli: ChainMetadata = { - blockExplorers: [ - { - apiUrl: 'https://api-goerli.arbiscan.io/api', - family: ExplorerFamily.Etherscan, - name: 'Arbiscan', - url: 'https://goerli.arbiscan.io', - }, - ], blocks: { confirmations: 1, estimateBlockTime: 3, @@ -617,6 +609,7 @@ export const neutron: ChainMetadata = { symbol: 'NTRN', }, protocol: ProtocolType.Cosmos, + restUrls: [{ http: 'grpc-kralum.neutron-1.neutron.org:80' }], rpcUrls: [{ http: 'https://rpc-kralum.neutron-1.neutron.org' }], slip44: 118, }; diff --git a/typescript/sdk/src/consts/chains.ts b/typescript/sdk/src/consts/chains.ts index 7139c057af..3907ee8c95 100644 --- a/typescript/sdk/src/consts/chains.ts +++ b/typescript/sdk/src/consts/chains.ts @@ -49,7 +49,6 @@ export enum DeprecatedChains { rinkeby = 'rinkeby', optimismkovan = 'optimismkovan', optimismrinkeby = 'optimismrinkeby', - neutrontestnet = 'neutrontestnet', } export const AllDeprecatedChains = Object.keys(DeprecatedChains) as string[]; diff --git a/typescript/sdk/src/consts/multisigIsm.ts b/typescript/sdk/src/consts/multisigIsm.ts index 069ad70b53..d1c1475755 100644 --- a/typescript/sdk/src/consts/multisigIsm.ts +++ b/typescript/sdk/src/consts/multisigIsm.ts @@ -18,6 +18,7 @@ export const defaultMultisigConfigs: ChainMap = { '0xec68258a7c882ac2fc46b81ce80380054ffb4ef2', // dsrv '0x5450447aee7b544c462c9352bef7cad049b0c2dc', // zeeprime '0x092e1c19da58e87ea65198785ee83867fe4bb418', // everstake + // '0xc2d68e109a7e80e12098d50ac4ef9fa7b3061684', // staked (not yet announced) ], }, @@ -61,7 +62,7 @@ export const defaultMultisigConfigs: ChainMap = { threshold: 2, validators: [ '0x570af9b7b36568c8877eebba6c6727aa9dab7268', - '0x8292b1a53907ece0f76af8a50724e9492bcdc8a3', // bsc + '0x8292b1a53907ece0f76af8a50724e9492bcdc8a3', // dsrv '0xeaf5cf9100f36a4baeea779f8745dda86159103c', // everstake ], }, @@ -81,6 +82,7 @@ export const defaultMultisigConfigs: ChainMap = { '0x63478422679303c3e4fc611b771fa4a707ef7f4a', '0x622e43baf06ad808ca8399360d9a2d9a1a12688b', // dsrv '0xf2c1e3888eb618f1f1a071ef3618f134715a9a49', // everstake + '0x46ecbc794574727abb8f97f01dacd9db6135f47a', // staked ], }, @@ -100,6 +102,7 @@ export const defaultMultisigConfigs: ChainMap = { '0x94438a7de38d4548ae54df5c6010c4ebc5239eae', // dsrv '0x5450447aee7b544c462c9352bef7cad049b0c2dc', // zeeprime '0xce327111035dd38698c92c3778884dbbb0ca8103', // everstake + // '0xb2f5a6a6e6046e2ede213617e989329666a6c4bc', // staked (not yet announced) ], }, @@ -167,6 +170,7 @@ export const defaultMultisigConfigs: ChainMap = { '0x2225e2f4e9221049456da93b71d2de41f3b6b2a8', '0x645428d198d2e76cbd9c1647f5c80740bb750b97', // dsrv '0xaed886392df07897743d8e272d438f00c4c9a2ae', // everstake + '0xcf0bb43255849cb3709a96ee166e5c3ce4adc7f9', // staked ], }, @@ -187,14 +191,6 @@ export const defaultMultisigConfigs: ChainMap = { '0x7885fae56dbcf5176657f54adbbd881dc6714132', ], }, - neutrontestnet: { - threshold: 2, - validators: [ - '0x5d2a99d67cd294a821de4fb25da6901ea8f89814', - '0xb57486243ce3bb3c38c50a582b8bbd20cb393589', - '0x661faee997654d14ead4ae48035883f05c3150cf', - ], - }, optimism: { threshold: 2, @@ -202,6 +198,7 @@ export const defaultMultisigConfigs: ChainMap = { '0x20349eadc6c72e94ce38268b96692b1a5c20de4f', '0x5b7d47b76c69740462432f6a5a0ca5005e014157', // dsrv '0x22b1ad4322cdb5f2c76ebf4e5a93803d480fcf0d', // everstake + '0x9636fbe90b6816438327b0fbde435aa3c8eeda15', // staked ], }, @@ -218,7 +215,7 @@ export const defaultMultisigConfigs: ChainMap = { threshold: 2, validators: [ '0x12ecb319c7f4e8ac5eb5226662aeb8528c5cefac', - '0x8dd8f8d34b5ecaa5f66de24b01acd7b8461c3916', + '0x008f24cbb1cc30ad0f19f2516ca75730e37efb5f', // dsrv '0x722aa4d45387009684582bca8281440d16b8b40f', // everstake ], }, diff --git a/typescript/sdk/src/core/HyperlaneCore.ts b/typescript/sdk/src/core/HyperlaneCore.ts index 00f3f91138..78d922428d 100644 --- a/typescript/sdk/src/core/HyperlaneCore.ts +++ b/typescript/sdk/src/core/HyperlaneCore.ts @@ -1,4 +1,5 @@ import { ethers } from 'ethers'; +import type { TransactionReceipt as ViemTxReceipt } from 'viem'; import { Mailbox__factory } from '@hyperlane-xyz/core'; import { @@ -119,7 +120,7 @@ export class HyperlaneCore extends HyperlaneApp { } waitForMessageProcessing( - sourceTx: ethers.ContractReceipt, + sourceTx: ethers.ContractReceipt | ViemTxReceipt, ): Promise { const messages = HyperlaneCore.getDispatchedMessages(sourceTx); return Promise.all(messages.map((msg) => this.waitForProcessReceipt(msg))); @@ -127,7 +128,7 @@ export class HyperlaneCore extends HyperlaneApp { // TODO consider renaming this, all the waitForMessage* methods are confusing async waitForMessageProcessed( - sourceTx: ethers.ContractReceipt, + sourceTx: ethers.ContractReceipt | ViemTxReceipt, delay?: number, maxAttempts?: number, ): Promise { @@ -146,12 +147,14 @@ export class HyperlaneCore extends HyperlaneApp { } // Redundant with static method but keeping for backwards compatibility - getDispatchedMessages(sourceTx: ethers.ContractReceipt): DispatchedMessage[] { + getDispatchedMessages( + sourceTx: ethers.ContractReceipt | ViemTxReceipt, + ): DispatchedMessage[] { return HyperlaneCore.getDispatchedMessages(sourceTx); } static getDispatchedMessages( - sourceTx: ethers.ContractReceipt, + sourceTx: ethers.ContractReceipt | ViemTxReceipt, ): DispatchedMessage[] { const mailbox = Mailbox__factory.createInterface(); const dispatchLogs = sourceTx.logs diff --git a/typescript/sdk/src/core/HyperlaneCoreDeployer.ts b/typescript/sdk/src/core/HyperlaneCoreDeployer.ts index 4432073a7b..674c7b61ba 100644 --- a/typescript/sdk/src/core/HyperlaneCoreDeployer.ts +++ b/typescript/sdk/src/core/HyperlaneCoreDeployer.ts @@ -106,7 +106,11 @@ export class HyperlaneCoreDeployer extends HyperlaneDeployer< ), ); } catch (e: any) { - if (!e.message.includes('already initialized')) { + if ( + !e.message.includes('already initialized') && + // Some RPC providers dont return the revert reason (nor allow ethers to parse it), so we have to check the message + !e.message.includes('Reverted 0x08c379a') + ) { throw e; } diff --git a/typescript/sdk/src/metadata/chainMetadataTypes.ts b/typescript/sdk/src/metadata/chainMetadataTypes.ts index 9418beb6d9..1ed7ecdb26 100644 --- a/typescript/sdk/src/metadata/chainMetadataTypes.ts +++ b/typescript/sdk/src/metadata/chainMetadataTypes.ts @@ -107,6 +107,10 @@ export const ChainMetadataSchemaObject = z.object({ .array(RpcUrlSchema) .nonempty() .describe('The list of RPC endpoints for interacting with the chain.'), + restUrls: z + .array(RpcUrlSchema) + .describe('For cosmos chains only, a list of Rest API URLs') + .optional(), blockExplorers: z .array( z.object({ diff --git a/typescript/utils/CHANGELOG.md b/typescript/utils/CHANGELOG.md index 8428fd3d34..61bdcf1123 100644 --- a/typescript/utils/CHANGELOG.md +++ b/typescript/utils/CHANGELOG.md @@ -1,5 +1,14 @@ # @hyperlane-xyz/utils +## 3.4.0 + +### Patch Changes + +- fd4fc1898: - Upgrade Viem to 1.20.0 + - Add optional restUrls field to ChainMetadata + - Add deepCopy util function + - Add support for cosmos factory token addresses + ## 3.3.0 ## 3.2.0 diff --git a/typescript/utils/index.ts b/typescript/utils/index.ts index 4730a417f8..f1ea44d95b 100644 --- a/typescript/utils/index.ts +++ b/typescript/utils/index.ts @@ -84,6 +84,7 @@ export { export { ValueOf, arrayToObject, + deepCopy, deepEquals, invertKeysAndValues, isObject, diff --git a/typescript/utils/package.json b/typescript/utils/package.json index b2a9faa023..89be8bec1a 100644 --- a/typescript/utils/package.json +++ b/typescript/utils/package.json @@ -1,7 +1,7 @@ { "name": "@hyperlane-xyz/utils", "description": "General utilities and types for the Hyperlane network", - "version": "3.3.0", + "version": "3.4.0", "dependencies": { "@cosmjs/encoding": "^0.31.3", "@solana/web3.js": "^1.78.0", diff --git a/typescript/utils/src/addresses.ts b/typescript/utils/src/addresses.ts index 131c12c1c6..5ff42ab374 100644 --- a/typescript/utils/src/addresses.ts +++ b/typescript/utils/src/addresses.ts @@ -6,9 +6,16 @@ import { Address, HexString, ProtocolType } from './types'; const EVM_ADDRESS_REGEX = /^0x[a-fA-F0-9]{40}$/; const SEALEVEL_ADDRESS_REGEX = /^[a-zA-Z0-9]{36,44}$/; -const COSMOS_ADDRESS_REGEX = - /^[a-z]{1,10}1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38,58}$/; // Bech32 -export const IBC_DENOM_REGEX = /^ibc\/([A-Fa-f0-9]{64})$/; + +// https://github.com/cosmos/cosmos-sdk/blob/84c33215658131d87daf3c629e909e12ed9370fa/types/coin.go#L601C17-L601C44 +const COSMOS_DENOM_PATTERN = `[a-zA-Z][a-zA-Z0-9]{2,127}`; +// https://en.bitcoin.it/wiki/BIP_0173 +const BECH32_ADDRESS_PATTERN = `[a-zA-Z]{1,83}1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38,58}`; +const COSMOS_ADDRESS_REGEX = new RegExp(`^${BECH32_ADDRESS_PATTERN}$`); +const IBC_DENOM_REGEX = new RegExp(`^ibc/([A-Fa-f0-9]{64})$`); +const COSMOS_FACTORY_TOKEN_REGEX = new RegExp( + `^factory/(${BECH32_ADDRESS_PATTERN})/${COSMOS_DENOM_PATTERN}$`, +); const EVM_TX_HASH_REGEX = /^0x([A-Fa-f0-9]{64})$/; const SEALEVEL_TX_HASH_REGEX = /^[a-zA-Z1-9]{88}$/; @@ -26,7 +33,11 @@ export function isAddressSealevel(address: Address) { } export function isAddressCosmos(address: Address) { - return COSMOS_ADDRESS_REGEX.test(address) || IBC_DENOM_REGEX.test(address); + return ( + COSMOS_ADDRESS_REGEX.test(address) || + IBC_DENOM_REGEX.test(address) || + COSMOS_FACTORY_TOKEN_REGEX.test(address) + ); } export function getAddressProtocolType(address: Address) { @@ -79,7 +90,10 @@ export function isValidAddressSealevel(address: Address) { export function isValidAddressCosmos(address: Address) { try { const isValid = - address && (IBC_DENOM_REGEX.test(address) || fromBech32(address)); + address && + (IBC_DENOM_REGEX.test(address) || + COSMOS_FACTORY_TOKEN_REGEX.test(address) || + fromBech32(address)); return !!isValid; } catch (error) { return false; diff --git a/typescript/utils/src/objects.ts b/typescript/utils/src/objects.ts index a99e7ff1d2..bff85958b2 100644 --- a/typescript/utils/src/objects.ts +++ b/typescript/utils/src/objects.ts @@ -6,6 +6,10 @@ export function deepEquals(v1: any, v2: any) { return JSON.stringify(v1) === JSON.stringify(v2); } +export function deepCopy(v: any) { + return JSON.parse(JSON.stringify(v)); +} + export type ValueOf = T[keyof T]; export function objMapEntries< diff --git a/yarn.lock b/yarn.lock index e723fcc3d1..04e50f8372 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5,10 +5,10 @@ __metadata: version: 8 cacheKey: 10 -"@adraffy/ens-normalize@npm:1.9.0": - version: 1.9.0 - resolution: "@adraffy/ens-normalize@npm:1.9.0" - checksum: 5257bbb45796720386a250ec2747f1c93b8fccd7063839ccda4aeb1b97ebec81caf5b435252dae1842c37175fe2e0ddcb89039f4ec1a4934fa4c6901a7f4992b +"@adraffy/ens-normalize@npm:1.10.0": + version: 1.10.0 + resolution: "@adraffy/ens-normalize@npm:1.10.0" + checksum: 5cdb5d2a9c9f8c0a71a7bb830967da0069cae1f1235cd41ae11147e4000f368f6958386e622cd4d52bf45c1ed3f8275056b387cba28902b83354e40ff323ecde languageName: node linkType: hard @@ -4235,8 +4235,8 @@ __metadata: version: 0.0.0-use.local resolution: "@hyperlane-xyz/cli@workspace:typescript/cli" dependencies: - "@hyperlane-xyz/sdk": "npm:3.3.0" - "@hyperlane-xyz/utils": "npm:3.3.0" + "@hyperlane-xyz/sdk": "npm:3.4.0" + "@hyperlane-xyz/utils": "npm:3.4.0" "@inquirer/prompts": "npm:^3.0.0" "@types/mocha": "npm:^10.0.1" "@types/node": "npm:^18.14.5" @@ -4261,12 +4261,12 @@ __metadata: languageName: unknown linkType: soft -"@hyperlane-xyz/core@npm:3.3.0, @hyperlane-xyz/core@workspace:solidity": +"@hyperlane-xyz/core@npm:3.4.0, @hyperlane-xyz/core@workspace:solidity": version: 0.0.0-use.local resolution: "@hyperlane-xyz/core@workspace:solidity" dependencies: "@eth-optimism/contracts": "npm:^0.6.0" - "@hyperlane-xyz/utils": "npm:3.3.0" + "@hyperlane-xyz/utils": "npm:3.4.0" "@nomiclabs/hardhat-ethers": "npm:^2.2.1" "@nomiclabs/hardhat-waffle": "npm:^2.0.6" "@openzeppelin/contracts": "npm:^4.9.3" @@ -4293,12 +4293,12 @@ __metadata: languageName: unknown linkType: soft -"@hyperlane-xyz/helloworld@npm:3.3.0, @hyperlane-xyz/helloworld@workspace:typescript/helloworld": +"@hyperlane-xyz/helloworld@npm:3.4.0, @hyperlane-xyz/helloworld@workspace:typescript/helloworld": version: 0.0.0-use.local resolution: "@hyperlane-xyz/helloworld@workspace:typescript/helloworld" dependencies: - "@hyperlane-xyz/core": "npm:3.3.0" - "@hyperlane-xyz/sdk": "npm:3.3.0" + "@hyperlane-xyz/core": "npm:3.4.0" + "@hyperlane-xyz/sdk": "npm:3.4.0" "@nomiclabs/hardhat-ethers": "npm:^2.2.1" "@nomiclabs/hardhat-waffle": "npm:^2.0.6" "@openzeppelin/contracts-upgradeable": "npm:^4.9.3" @@ -4343,9 +4343,9 @@ __metadata: "@ethersproject/experimental": "npm:^5.7.0" "@ethersproject/hardware-wallets": "npm:^5.7.0" "@ethersproject/providers": "npm:^5.7.2" - "@hyperlane-xyz/helloworld": "npm:3.3.0" - "@hyperlane-xyz/sdk": "npm:3.3.0" - "@hyperlane-xyz/utils": "npm:3.3.0" + "@hyperlane-xyz/helloworld": "npm:3.4.0" + "@hyperlane-xyz/sdk": "npm:3.4.0" + "@hyperlane-xyz/utils": "npm:3.4.0" "@nomiclabs/hardhat-ethers": "npm:^2.2.1" "@nomiclabs/hardhat-etherscan": "npm:^3.0.3" "@nomiclabs/hardhat-waffle": "npm:^2.0.6" @@ -4393,14 +4393,14 @@ __metadata: languageName: unknown linkType: soft -"@hyperlane-xyz/sdk@npm:3.3.0, @hyperlane-xyz/sdk@workspace:typescript/sdk": +"@hyperlane-xyz/sdk@npm:3.4.0, @hyperlane-xyz/sdk@workspace:typescript/sdk": version: 0.0.0-use.local resolution: "@hyperlane-xyz/sdk@workspace:typescript/sdk" dependencies: "@cosmjs/cosmwasm-stargate": "npm:^0.31.3" "@cosmjs/stargate": "npm:^0.31.3" - "@hyperlane-xyz/core": "npm:3.3.0" - "@hyperlane-xyz/utils": "npm:3.3.0" + "@hyperlane-xyz/core": "npm:3.4.0" + "@hyperlane-xyz/utils": "npm:3.4.0" "@nomiclabs/hardhat-ethers": "npm:^2.2.1" "@nomiclabs/hardhat-waffle": "npm:^2.0.6" "@solana/spl-token": "npm:^0.3.8" @@ -4412,7 +4412,7 @@ __metadata: "@types/sinon": "npm:^17.0.1" "@types/sinon-chai": "npm:^3.2.12" "@types/ws": "npm:^8.5.5" - "@wagmi/chains": "npm:^0.2.6" + "@wagmi/chains": "npm:^1.8.0" bignumber.js: "npm:^9.1.1" chai: "npm:^4.3.6" coingecko-api: "npm:^1.0.10" @@ -4429,7 +4429,7 @@ __metadata: sinon: "npm:^13.0.2" ts-node: "npm:^10.8.0" typescript: "npm:5.1.6" - viem: "npm:^1.3.1" + viem: "npm:^1.20.0" zod: "npm:^3.21.2" peerDependencies: "@ethersproject/abi": "*" @@ -4437,7 +4437,7 @@ __metadata: languageName: unknown linkType: soft -"@hyperlane-xyz/utils@npm:3.3.0, @hyperlane-xyz/utils@workspace:typescript/utils": +"@hyperlane-xyz/utils@npm:3.4.0, @hyperlane-xyz/utils@workspace:typescript/utils": version: 0.0.0-use.local resolution: "@hyperlane-xyz/utils@workspace:typescript/utils" dependencies: @@ -4819,12 +4819,12 @@ __metadata: languageName: node linkType: hard -"@noble/curves@npm:1.0.0, @noble/curves@npm:~1.0.0": - version: 1.0.0 - resolution: "@noble/curves@npm:1.0.0" +"@noble/curves@npm:1.2.0, @noble/curves@npm:~1.2.0": + version: 1.2.0 + resolution: "@noble/curves@npm:1.2.0" dependencies: - "@noble/hashes": "npm:1.3.0" - checksum: 6db884e03b3f6c773317bcf4611bf1d9adb8084eab0bf6158407cc998c9c5dcb0560741bdd0aaca9c4393c9e8a3dcd7592b4148a6cfd561d0a00addb77a6129f + "@noble/hashes": "npm:1.3.2" + checksum: 94e02e9571a9fd42a3263362451849d2f54405cb3ce9fa7c45bc6b9b36dcd7d1d20e2e1e14cfded24937a13d82f1e60eefc4d7a14982ce0bc219a9fc0f51d1f9 languageName: node linkType: hard @@ -4844,13 +4844,6 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:1.3.0": - version: 1.3.0 - resolution: "@noble/hashes@npm:1.3.0" - checksum: 4680a71941c06ac897cc9eab9d229717d5af1147cea5e8cd4942190c817426ad3173ded750d897f58d764b869f9347d4fc3f6b3c16574541ac81906efa9ddc36 - languageName: node - linkType: hard - "@noble/hashes@npm:1.3.1, @noble/hashes@npm:^1.3.0, @noble/hashes@npm:~1.3.0": version: 1.3.1 resolution: "@noble/hashes@npm:1.3.1" @@ -4858,13 +4851,20 @@ __metadata: languageName: node linkType: hard -"@noble/hashes@npm:^1, @noble/hashes@npm:^1.0.0, @noble/hashes@npm:^1.3.1": +"@noble/hashes@npm:1.3.2, @noble/hashes@npm:^1, @noble/hashes@npm:^1.0.0, @noble/hashes@npm:^1.3.1": version: 1.3.2 resolution: "@noble/hashes@npm:1.3.2" checksum: 685f59d2d44d88e738114b71011d343a9f7dce9dfb0a121f1489132f9247baa60bc985e5ec6f3213d114fbd1e1168e7294644e46cbd0ce2eba37994f28eeb51b languageName: node linkType: hard +"@noble/hashes@npm:~1.3.2": + version: 1.3.3 + resolution: "@noble/hashes@npm:1.3.3" + checksum: 1025ddde4d24630e95c0818e63d2d54ee131b980fe113312d17ed7468bc18f54486ac86c907685759f8a7e13c2f9b9e83ec7b67d1cc20836f36b5e4a65bb102d + languageName: node + linkType: hard + "@noble/secp256k1@npm:1.5.5, @noble/secp256k1@npm:~1.5.2": version: 1.5.5 resolution: "@noble/secp256k1@npm:1.5.5" @@ -5452,6 +5452,13 @@ __metadata: languageName: node linkType: hard +"@scure/base@npm:~1.1.2": + version: 1.1.4 + resolution: "@scure/base@npm:1.1.4" + checksum: e735792dc5555f9d11b93fbaffbcf65177621a60d25d54d84439155611ee98b5f6fb631ca06ef0c57a65bc4e40277331b7364e96cf7f164908bec98b546f3442 + languageName: node + linkType: hard + "@scure/bip32@npm:1.0.1": version: 1.0.1 resolution: "@scure/bip32@npm:1.0.1" @@ -5463,14 +5470,14 @@ __metadata: languageName: node linkType: hard -"@scure/bip32@npm:1.3.0": - version: 1.3.0 - resolution: "@scure/bip32@npm:1.3.0" +"@scure/bip32@npm:1.3.2": + version: 1.3.2 + resolution: "@scure/bip32@npm:1.3.2" dependencies: - "@noble/curves": "npm:~1.0.0" - "@noble/hashes": "npm:~1.3.0" - "@scure/base": "npm:~1.1.0" - checksum: 1fabcc7f2215910b35980bfc455c03fc4ae7f848efed066fe3867960a8dfceb6141c932496434fc2cfbf385d270ff9efdfce2571992e4584103f82e45ac2103f + "@noble/curves": "npm:~1.2.0" + "@noble/hashes": "npm:~1.3.2" + "@scure/base": "npm:~1.1.2" + checksum: b90da28dfe75519496a85c97e77c9443734873910f32b8557762910a5c4e642290a462b0ed14fa42e0efed6acb9a7f6155ad5cb5d38d4ff87eb2de4760eb32a4 languageName: node linkType: hard @@ -5484,13 +5491,13 @@ __metadata: languageName: node linkType: hard -"@scure/bip39@npm:1.2.0": - version: 1.2.0 - resolution: "@scure/bip39@npm:1.2.0" +"@scure/bip39@npm:1.2.1": + version: 1.2.1 + resolution: "@scure/bip39@npm:1.2.1" dependencies: "@noble/hashes": "npm:~1.3.0" "@scure/base": "npm:~1.1.0" - checksum: 2a260eefea0b2658c5d3b2cb982479ef650552c3007e57f667b445943c79717eb923c1a104a664b4873bc210aeb59859bf890c3e7b47fb51ed5b94dc96f75105 + checksum: 2ea368bbed34d6b1701c20683bf465e147f231a9e37e639b8c82f585d6f978bb0f3855fca7ceff04954ae248b3e313f5d322d0210614fb7acb402739415aaf31 languageName: node linkType: hard @@ -6431,27 +6438,15 @@ __metadata: languageName: node linkType: hard -"@wagmi/chains@npm:1.6.0": - version: 1.6.0 - resolution: "@wagmi/chains@npm:1.6.0" +"@wagmi/chains@npm:^1.8.0": + version: 1.8.0 + resolution: "@wagmi/chains@npm:1.8.0" peerDependencies: typescript: ">=5.0.4" peerDependenciesMeta: typescript: optional: true - checksum: 809954d65e0d32cfbf079f7f3df1ff6596d1da96187e177597bcaf0fa71532e7416186f3f7e94efe45cf529b1709a57b08e0e06b67b5529223221a6b82f1dc78 - languageName: node - linkType: hard - -"@wagmi/chains@npm:^0.2.6": - version: 0.2.6 - resolution: "@wagmi/chains@npm:0.2.6" - peerDependencies: - typescript: ">=4.9.4" - peerDependenciesMeta: - typescript: - optional: true - checksum: b56c6ec78fc077795b58757123bf04f387ecc7c3ee2088f9192de9d8e4e7b7f07bfaa8761ef8ecd180bb0a6276cf6827ce4b5958eb8d26b1ee7a90038d595ac6 + checksum: 8248419554a90c0d514acfc46f3a6f2090a282ff546b2488705e81fcdfaf197590e67a1fc62539383b4dd22ccafe9f16018cadad27acee098dc9d87b82f173e4 languageName: node linkType: hard @@ -6481,9 +6476,9 @@ __metadata: languageName: node linkType: hard -"abitype@npm:0.9.3": - version: 0.9.3 - resolution: "abitype@npm:0.9.3" +"abitype@npm:0.9.8": + version: 0.9.8 + resolution: "abitype@npm:0.9.8" peerDependencies: typescript: ">=5.0.4" zod: ^3 >=3.19.1 @@ -6492,7 +6487,7 @@ __metadata: optional: true zod: optional: true - checksum: 6a3f71b76b5d9b1fcda2796b46fdb89d3deaa7e89f64e530dff373ae50a29fd1b34a53bc4291ffc6b097baf400baaa5f374f5c2b53987c223e6dad38f379d348 + checksum: 90940804839b1b65cb5b427d934db9c1cc899157d6091f281b1ce94d9c0c08b1ae946ab43e984e70c031e94c49355f6677475a7242ec60cae5457c074dcd40f9 languageName: node linkType: hard @@ -11708,21 +11703,21 @@ __metadata: languageName: node linkType: hard -"isomorphic-ws@npm:5.0.0": - version: 5.0.0 - resolution: "isomorphic-ws@npm:5.0.0" +"isomorphic-ws@npm:^4.0.1": + version: 4.0.1 + resolution: "isomorphic-ws@npm:4.0.1" peerDependencies: ws: "*" - checksum: e20eb2aee09ba96247465fda40c6d22c1153394c0144fa34fe6609f341af4c8c564f60ea3ba762335a7a9c306809349f9b863c8beedf2beea09b299834ad5398 + checksum: d7190eadefdc28bdb93d67b5f0c603385aaf87724fa2974abb382ac1ec9756ed2cfb27065cbe76122879c2d452e2982bc4314317f3d6c737ddda6c047328771a languageName: node linkType: hard -"isomorphic-ws@npm:^4.0.1": - version: 4.0.1 - resolution: "isomorphic-ws@npm:4.0.1" +"isows@npm:1.0.3": + version: 1.0.3 + resolution: "isows@npm:1.0.3" peerDependencies: ws: "*" - checksum: d7190eadefdc28bdb93d67b5f0c603385aaf87724fa2974abb382ac1ec9756ed2cfb27065cbe76122879c2d452e2982bc4314317f3d6c737ddda6c047328771a + checksum: 9cacd5cf59f67deb51e825580cd445ab1725ecb05a67c704050383fb772856f3cd5e7da8ad08f5a3bd2823680d77d099459d0c6a7037972a74d6429af61af440 languageName: node linkType: hard @@ -17086,25 +17081,24 @@ __metadata: languageName: node linkType: hard -"viem@npm:^1.3.1": - version: 1.3.1 - resolution: "viem@npm:1.3.1" - dependencies: - "@adraffy/ens-normalize": "npm:1.9.0" - "@noble/curves": "npm:1.0.0" - "@noble/hashes": "npm:1.3.0" - "@scure/bip32": "npm:1.3.0" - "@scure/bip39": "npm:1.2.0" - "@wagmi/chains": "npm:1.6.0" - abitype: "npm:0.9.3" - isomorphic-ws: "npm:5.0.0" - ws: "npm:8.12.0" +"viem@npm:^1.20.0": + version: 1.20.0 + resolution: "viem@npm:1.20.0" + dependencies: + "@adraffy/ens-normalize": "npm:1.10.0" + "@noble/curves": "npm:1.2.0" + "@noble/hashes": "npm:1.3.2" + "@scure/bip32": "npm:1.3.2" + "@scure/bip39": "npm:1.2.1" + abitype: "npm:0.9.8" + isows: "npm:1.0.3" + ws: "npm:8.13.0" peerDependencies: typescript: ">=5.0.4" peerDependenciesMeta: typescript: optional: true - checksum: 073edf64453dd8bbce7bc6c6ac6a0281d6acc1e4ae7a770a01dba86c86e5a28ea5b466bb2f86833f3a822e699067ff23e1b6da1a272c8b9b7f1b7eb56eecc552 + checksum: f6f232e1b75085b2088e842a44d3e574afd3e603420cf65181d6fb0dec7942d0c4f4d3cdae8f7a43ddb9942dcb185443b1d5b7daec8a009a3cbab9436bea2164 languageName: node linkType: hard @@ -17737,9 +17731,9 @@ __metadata: languageName: node linkType: hard -"ws@npm:8.12.0": - version: 8.12.0 - resolution: "ws@npm:8.12.0" +"ws@npm:8.13.0, ws@npm:^8.5.0": + version: 8.13.0 + resolution: "ws@npm:8.13.0" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ">=5.0.2" @@ -17748,7 +17742,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: 325fbcf6bbed07350b82d7a5bdb43e8a4e81512973241c656c2119a37883a74fe49e7cac09646f9bfc28c517cd63f4111c78f5898bcdd25a3ec2cc4e59375331 + checksum: 1769532b6fdab9ff659f0b17810e7501831d34ecca23fd179ee64091dd93a51f42c59f6c7bb4c7a384b6c229aca8076fb312aa35626257c18081511ef62a161d languageName: node linkType: hard @@ -17793,21 +17787,6 @@ __metadata: languageName: node linkType: hard -"ws@npm:^8.5.0": - version: 8.13.0 - resolution: "ws@npm:8.13.0" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ">=5.0.2" - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 1769532b6fdab9ff659f0b17810e7501831d34ecca23fd179ee64091dd93a51f42c59f6c7bb4c7a384b6c229aca8076fb312aa35626257c18081511ef62a161d - languageName: node - linkType: hard - "xhr-request-promise@npm:^0.1.2": version: 0.1.3 resolution: "xhr-request-promise@npm:0.1.3"