diff --git a/Cargo.lock b/Cargo.lock index 7b3ff89039..8be7e937a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,6 +12,45 @@ dependencies = [ "regex", ] +[[package]] +name = "abscissa_core" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6750843603bf31a83accd3c8177f9dbf53a7d64275688fc7371e0a4d9f8628b5" +dependencies = [ + "abscissa_derive", + "arc-swap", + "backtrace", + "canonical-path", + "clap 3.2.25", + "color-eyre", + "fs-err", + "once_cell", + "regex", + "secrecy", + "semver 1.0.23", + "serde", + "termcolor", + "toml 0.5.11", + "tracing", + "tracing-log 0.1.4", + "tracing-subscriber", + "wait-timeout", +] + +[[package]] +name = "abscissa_derive" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a3473aa652e90865a06b723102aaa4a54a7d9f2092dbf4582497a61d0537d3f" +dependencies = [ + "ident_case", + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] + [[package]] name = "addr2line" version = "0.21.0" @@ -171,6 +210,12 @@ dependencies = [ "derive_arbitrary", ] +[[package]] +name = "arc-swap" +version = "1.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" + [[package]] name = "ark-bls12-381" version = "0.3.0" @@ -313,7 +358,7 @@ checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -324,7 +369,24 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", +] + +[[package]] +name = "async-tungstenite" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3609af4bbf701ddaf1f6bb4e6257dff4ff8932327d0e685d3f653724c258b1ac" +dependencies = [ + "futures-io", + "futures-util", + "log", + "pin-project-lite", + "rustls-native-certs 0.7.3", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.25.0", + "tungstenite 0.21.0", ] [[package]] @@ -353,6 +415,17 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + [[package]] name = "auto_impl" version = "1.1.0" @@ -371,6 +444,38 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core 0.3.4", + "bitflags 1.3.2", + "bytes", + "futures-util", + "http 0.2.11", + "http-body 0.4.5", + "hyper 0.14.27", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "serde_json", + "serde_path_to_error", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "tokio", + "tower", + "tower-layer", + "tower-service", +] + [[package]] name = "axum" version = "0.7.5" @@ -378,7 +483,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a6c9af12842a67734c9a2e355436e5d03b22383ed60cf13cd0c18fbfe3dcbcf" dependencies = [ "async-trait", - "axum-core", + "axum-core 0.4.3", "bytes", "futures-util", "http 1.1.0", @@ -398,6 +503,23 @@ dependencies = [ "tower-service", ] +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http 0.2.11", + "http-body 0.4.5", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + [[package]] name = "axum-core" version = "0.4.3" @@ -497,6 +619,12 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" +[[package]] +name = "bech32" +version = "0.10.0-beta" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98f7eed2b2781a6f0b5c903471d48e15f56fb4e1165df8a9a2337fd1a59d45ea" + [[package]] name = "bellman" version = "0.14.0" @@ -553,7 +681,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -585,6 +713,41 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitcoin" +version = "0.31.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c85783c2fe40083ea54a33aa2f0ba58831d90fcd190f5bdc47e74e84d2a96ae" +dependencies = [ + "bech32 0.10.0-beta", + "bitcoin-internals", + "bitcoin_hashes", + "hex-conservative", + "hex_lit", + "secp256k1", + "serde", +] + +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" +dependencies = [ + "serde", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative", + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -728,7 +891,7 @@ dependencies = [ "proc-macro-crate 2.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", "syn_derive", ] @@ -742,9 +905,9 @@ dependencies = [ [[package]] name = "bs58" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ "sha2 0.10.8", "tinyvec", @@ -813,9 +976,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" dependencies = [ "serde", ] @@ -849,6 +1012,12 @@ dependencies = [ "serde", ] +[[package]] +name = "canonical-path" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e9e01327e6c86e92ec72b1c798d4a94810f147209bbe3ffab6a86954937a6f" + [[package]] name = "cargo-platform" version = "0.1.5" @@ -866,7 +1035,7 @@ checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" dependencies = [ "camino", "cargo-platform", - "semver 1.0.20", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -1015,6 +1184,23 @@ dependencies = [ "libloading", ] +[[package]] +name = "clap" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" +dependencies = [ + "atty", + "bitflags 1.3.2", + "clap_derive", + "clap_lex 0.2.4", + "indexmap 1.9.3", + "once_cell", + "strsim 0.10.0", + "termcolor", + "textwrap", +] + [[package]] name = "clap" version = "4.5.4" @@ -1032,17 +1218,26 @@ checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", - "clap_lex", + "clap_lex 0.7.0", "strsim 0.11.1", ] +[[package]] +name = "clap_complete" +version = "3.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f7a2e0a962c45ce25afce14220bc24f9dade0a1787f185cecf96bfba7847cd8" +dependencies = [ + "clap 3.2.25", +] + [[package]] name = "clap_complete" version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd79504325bf38b10165b02e89b4347300f855f273c4cb30c4a3209e6583275e" dependencies = [ - "clap", + "clap 4.5.4", ] [[package]] @@ -1051,8 +1246,30 @@ version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80d0e48e026ce7df2040239117d25e4e79714907420c70294a5ce4b6bbe6a7b6" dependencies = [ - "clap", - "clap_complete", + "clap 4.5.4", + "clap_complete 4.5.2", +] + +[[package]] +name = "clap_derive" +version = "3.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", ] [[package]] @@ -1164,7 +1381,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f76990911f2267d837d9d0ad060aa63aaad170af40904b29461734c339030d4d" dependencies = [ "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -1182,7 +1399,7 @@ dependencies = [ "rust-ini", "serde", "serde_json", - "toml 0.8.2", + "toml 0.8.19", "yaml-rust2", ] @@ -1195,6 +1412,19 @@ dependencies = [ "windows", ] +[[package]] +name = "console" +version = "0.15.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e1f83fc076bd6dd27517eacdf25fef6c4dfe5f1d7448bafaaf3a26f13b5e4eb" +dependencies = [ + "encode_unicode", + "lazy_static", + "libc", + "unicode-width", + "windows-sys 0.52.0", +] + [[package]] name = "const-crc32" version = "1.3.0" @@ -1411,7 +1641,7 @@ dependencies = [ "anes", "cast", "ciborium", - "clap", + "clap 4.5.4", "criterion-plot", "is-terminal", "itertools 0.10.5", @@ -1576,7 +1806,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -1636,7 +1866,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -1658,7 +1888,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core 0.20.3", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -1741,7 +1971,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -1783,7 +2013,20 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", +] + +[[package]] +name = "dialoguer" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" +dependencies = [ + "console", + "shell-words", + "tempfile", + "thiserror", + "zeroize", ] [[package]] @@ -1828,6 +2071,16 @@ dependencies = [ "dirs-sys", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + [[package]] name = "dirs-sys" version = "0.3.7" @@ -1839,6 +2092,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "displaydoc" version = "0.2.5" @@ -1847,7 +2111,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -1903,7 +2167,7 @@ dependencies = [ "serde", "thiserror", "time", - "winnow 0.6.8", + "winnow 0.6.20", ] [[package]] @@ -1960,6 +2224,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", + "serde", "signature", ] @@ -1986,12 +2251,25 @@ checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" dependencies = [ "curve25519-dalek", "ed25519", + "rand_core 0.6.4", "serde", "sha2 0.10.8", "subtle", "zeroize", ] +[[package]] +name = "ed25519-dalek-bip32" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b49a684b133c4980d7ee783936af771516011c8cd15f429dbda77245e282f03" +dependencies = [ + "derivation-path", + "ed25519-dalek", + "hmac 0.12.1", + "sha2 0.10.8", +] + [[package]] name = "either" version = "1.12.0" @@ -2069,6 +2347,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "encode_unicode" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f" + [[package]] name = "encoding_rs" version = "0.8.33" @@ -2134,7 +2418,7 @@ dependencies = [ "darling 0.20.3", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -2339,8 +2623,8 @@ dependencies = [ "regex", "serde", "serde_json", - "syn 2.0.52", - "toml 0.8.2", + "syn 2.0.87", + "toml 0.8.19", "walkdir", ] @@ -2357,7 +2641,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -2383,7 +2667,7 @@ dependencies = [ "serde", "serde_json", "strum 0.25.0", - "syn 2.0.52", + "syn 2.0.87", "tempfile", "thiserror", "tiny-keccak", @@ -2399,7 +2683,7 @@ dependencies = [ "chrono", "ethers-core", "reqwest", - "semver 1.0.20", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -2595,6 +2879,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c606d892c9de11507fa0dcffc116434f94e105d0bbdc4e405b61519464c49d7b" dependencies = [ + "eyre", "paste", ] @@ -2688,6 +2973,15 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "fs-err" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88a41f105fe1d5b6b34b2055e3dc59bb79b46b48b2040b9e6c7b4b5de097aa41" +dependencies = [ + "autocfg", +] + [[package]] name = "fs_extra" version = "1.3.0" @@ -2766,7 +3060,7 @@ checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -2947,7 +3241,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.11", - "indexmap 2.2.6", + "indexmap 2.6.0", "slab", "tokio", "tokio-util 0.7.10", @@ -2966,7 +3260,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.1.0", - "indexmap 2.2.6", + "indexmap 2.6.0", "slab", "tokio", "tokio-util 0.7.10", @@ -3007,6 +3301,12 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" + [[package]] name = "hashers" version = "1.0.1" @@ -3025,6 +3325,15 @@ dependencies = [ "hashbrown 0.14.3", ] +[[package]] +name = "hdpath" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa5bc9db2c17d2660f53ce217b778d06d68de13d1cd01c0f4e5de4b7918935f" +dependencies = [ + "byteorder", +] + [[package]] name = "hdrhistogram" version = "7.5.4" @@ -3079,6 +3388,15 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + [[package]] name = "hermit-abi" version = "0.3.9" @@ -3091,6 +3409,18 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + +[[package]] +name = "hex_lit" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3011d1213f159867b13cfd6ac92d2cd5f1345762c63be3554e84092d85a50bbd" + [[package]] name = "hidapi" version = "1.5.0" @@ -3205,6 +3535,22 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "humantime-serde" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57a3db5ea5923d99402c94e9feb261dc5ee9b4efa158b0315f788cf549cc200c" +dependencies = [ + "humantime", + "serde", +] + [[package]] name = "hyper" version = "0.14.27" @@ -3259,9 +3605,9 @@ dependencies = [ "futures-util", "http 0.2.11", "hyper 0.14.27", - "rustls", + "rustls 0.21.12", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -3336,7 +3682,6 @@ dependencies = [ [[package]] name = "ibc" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "ibc-apps", "ibc-clients", @@ -3349,7 +3694,6 @@ dependencies = [ [[package]] name = "ibc-app-nft-transfer" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "ibc-app-nft-transfer-types", "ibc-core", @@ -3359,7 +3703,6 @@ dependencies = [ [[package]] name = "ibc-app-nft-transfer-types" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "arbitrary", "base64 0.22.1", @@ -3381,7 +3724,6 @@ dependencies = [ [[package]] name = "ibc-app-transfer" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "ibc-app-transfer-types", "ibc-core", @@ -3391,7 +3733,6 @@ dependencies = [ [[package]] name = "ibc-app-transfer-types" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "arbitrary", "borsh", @@ -3410,20 +3751,38 @@ dependencies = [ [[package]] name = "ibc-apps" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "ibc-app-nft-transfer", "ibc-app-transfer", ] [[package]] -name = "ibc-client-tendermint" -version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" +name = "ibc-chain-registry" +version = "0.29.3" dependencies = [ - "derive_more", - "ibc-client-tendermint-types", - "ibc-core-client", + "async-trait", + "flex-error", + "futures", + "http 1.1.0", + "ibc-proto", + "ibc-relayer", + "ibc-relayer-types", + "itertools 0.13.0", + "reqwest", + "serde", + "serde_json", + "tendermint-rpc", + "tokio", + "tracing", +] + +[[package]] +name = "ibc-client-tendermint" +version = "0.54.0" +dependencies = [ + "derive_more", + "ibc-client-tendermint-types", + "ibc-core-client", "ibc-core-commitment-types", "ibc-core-handler-types", "ibc-core-host", @@ -3436,7 +3795,6 @@ dependencies = [ [[package]] name = "ibc-client-tendermint-types" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "displaydoc", "ibc-core-client-types", @@ -3453,7 +3811,6 @@ dependencies = [ [[package]] name = "ibc-client-wasm-types" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "base64 0.22.1", "displaydoc", @@ -3467,7 +3824,6 @@ dependencies = [ [[package]] name = "ibc-clients" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "ibc-client-tendermint", "ibc-client-wasm-types", @@ -3476,7 +3832,6 @@ dependencies = [ [[package]] name = "ibc-core" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "ibc-core-channel", "ibc-core-client", @@ -3492,7 +3847,6 @@ dependencies = [ [[package]] name = "ibc-core-channel" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "ibc-core-channel-types", "ibc-core-client", @@ -3507,7 +3861,6 @@ dependencies = [ [[package]] name = "ibc-core-channel-types" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "arbitrary", "borsh", @@ -3531,7 +3884,6 @@ dependencies = [ [[package]] name = "ibc-core-client" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "ibc-core-client-context", "ibc-core-client-types", @@ -3544,7 +3896,6 @@ dependencies = [ [[package]] name = "ibc-core-client-context" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "derive_more", "displaydoc", @@ -3560,7 +3911,6 @@ dependencies = [ [[package]] name = "ibc-core-client-types" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "arbitrary", "borsh", @@ -3581,7 +3931,6 @@ dependencies = [ [[package]] name = "ibc-core-commitment-types" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "arbitrary", "borsh", @@ -3601,7 +3950,6 @@ dependencies = [ [[package]] name = "ibc-core-connection" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "ibc-client-wasm-types", "ibc-core-client", @@ -3615,7 +3963,6 @@ dependencies = [ [[package]] name = "ibc-core-connection-types" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "arbitrary", "borsh", @@ -3637,7 +3984,6 @@ dependencies = [ [[package]] name = "ibc-core-handler" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "ibc-core-channel", "ibc-core-client", @@ -3652,7 +3998,6 @@ dependencies = [ [[package]] name = "ibc-core-handler-types" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "arbitrary", "borsh", @@ -3677,7 +4022,6 @@ dependencies = [ [[package]] name = "ibc-core-host" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "derive_more", "displaydoc", @@ -3695,7 +4039,6 @@ dependencies = [ [[package]] name = "ibc-core-host-cosmos" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "derive_more", "displaydoc", @@ -3718,7 +4061,6 @@ dependencies = [ [[package]] name = "ibc-core-host-types" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "arbitrary", "borsh", @@ -3734,7 +4076,6 @@ dependencies = [ [[package]] name = "ibc-core-router" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "derive_more", "displaydoc", @@ -3748,7 +4089,6 @@ dependencies = [ [[package]] name = "ibc-core-router-types" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "borsh", "derive_more", @@ -3767,17 +4107,15 @@ dependencies = [ [[package]] name = "ibc-derive" version = "0.8.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] name = "ibc-primitives" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "arbitrary", "borsh", @@ -3818,7 +4156,6 @@ dependencies = [ [[package]] name = "ibc-query" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "displaydoc", "ibc", @@ -3826,10 +4163,173 @@ dependencies = [ "tonic", ] +[[package]] +name = "ibc-relayer" +version = "0.29.3" +dependencies = [ + "anyhow", + "async-stream", + "bech32 0.9.1", + "bitcoin", + "bs58", + "byte-unit", + "bytes", + "crossbeam-channel", + "digest 0.10.7", + "dirs-next", + "ed25519", + "ed25519-dalek", + "ed25519-dalek-bip32", + "flex-error", + "futures", + "generic-array", + "hdpath", + "hex", + "http 1.1.0", + "humantime", + "humantime-serde", + "ibc-proto", + "ibc-relayer-types", + "ibc-telemetry", + "itertools 0.13.0", + "moka", + "namada_sdk", + "num-bigint", + "num-rational", + "once_cell", + "prost 0.13.2", + "regex", + "reqwest", + "retry", + "ripemd", + "rpassword", + "secp256k1", + "semver 1.0.23", + "serde", + "serde_derive", + "serde_json", + "sha2 0.10.8", + "signature", + "strum 0.25.0", + "subtle-encoding", + "tendermint", + "tendermint-light-client", + "tendermint-light-client-detector", + "tendermint-light-client-verifier", + "tendermint-proto", + "tendermint-rpc", + "thiserror", + "tiny-bip39 1.0.0", + "tiny-keccak", + "tokio", + "tokio-stream", + "toml 0.8.19", + "tonic", + "tracing", + "tracing-subscriber", + "uuid 1.11.0", +] + +[[package]] +name = "ibc-relayer-cli" +version = "1.10.3" +dependencies = [ + "abscissa_core", + "clap 3.2.25", + "clap_complete 3.2.5", + "color-eyre", + "console", + "crossbeam-channel", + "dialoguer", + "dirs-next", + "eyre", + "flex-error", + "futures", + "hdpath", + "http 1.1.0", + "humantime", + "ibc-chain-registry", + "ibc-relayer", + "ibc-relayer-rest", + "ibc-relayer-types", + "ibc-telemetry", + "itertools 0.13.0", + "oneline-eyre", + "regex", + "serde", + "serde_json", + "signal-hook", + "subtle-encoding", + "tendermint", + "tendermint-light-client-verifier", + "tendermint-rpc", + "time", + "tokio", + "tracing", + "tracing-subscriber", +] + +[[package]] +name = "ibc-relayer-rest" +version = "0.29.3" +dependencies = [ + "axum 0.6.20", + "crossbeam-channel", + "ibc-relayer", + "ibc-relayer-types", + "serde", + "tokio", + "tracing", +] + +[[package]] +name = "ibc-relayer-types" +version = "0.29.3" +dependencies = [ + "bytes", + "derive_more", + "flex-error", + "ibc-proto", + "ics23", + "itertools 0.13.0", + "num-rational", + "primitive-types", + "prost 0.13.2", + "regex", + "serde", + "serde_derive", + "serde_json", + "subtle-encoding", + "tendermint", + "tendermint-light-client-verifier", + "tendermint-proto", + "time", + "tracing", + "uint", +] + +[[package]] +name = "ibc-telemetry" +version = "0.29.3" +dependencies = [ + "axum 0.6.20", + "dashmap", + "ibc-relayer-types", + "moka", + "once_cell", + "opentelemetry", + "opentelemetry-prometheus", + "prometheus", + "serde", + "serde_json", + "tendermint", + "tokio", + "tracing", +] + [[package]] name = "ibc-testkit" version = "0.54.0" -source = "git+https://github.com/heliaxdev/cosmos-ibc-rs?rev=38bd2a32f35117d4d9165a3c68c64ccd87ad56dd#38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" dependencies = [ "basecoin-store", "derive_more", @@ -3977,12 +4477,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.15.1", "serde", ] @@ -4044,7 +4544,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "rustix", "windows-sys 0.48.0", ] @@ -4082,6 +4582,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.9" @@ -4258,7 +4767,7 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", - "uuid 1.8.0", + "uuid 1.11.0", ] [[package]] @@ -4437,7 +4946,7 @@ checksum = "cb26336e6dc7cc76e7927d2c9e7e3bb376d7af65a6f56a0b16c47d18a9b1abc5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -4667,8 +5176,8 @@ checksum = "cb3371dfc7b772c540da1380123674a8e20583aca99907087d990ca58cf44203" dependencies = [ "log", "once_cell", - "rustls", - "rustls-webpki", + "rustls 0.21.12", + "rustls-webpki 0.101.7", "webpki-roots", ] @@ -4678,12 +5187,32 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] +[[package]] +name = "moka" +version = "0.12.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f" +dependencies = [ + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "once_cell", + "parking_lot", + "quanta", + "rustc_version 0.4.0", + "smallvec", + "tagptr", + "thiserror", + "triomphe", + "uuid 1.11.0", +] + [[package]] name = "more-asserts" version = "0.2.2" @@ -4733,7 +5262,7 @@ dependencies = [ name = "namada_apps" version = "0.45.1" dependencies = [ - "clap_complete", + "clap_complete 4.5.2", "clap_complete_nushell", "color-eyre", "eyre", @@ -4756,7 +5285,7 @@ dependencies = [ "bit-set", "borsh", "borsh-ext", - "clap", + "clap 4.5.4", "color-eyre", "config", "data-encoding", @@ -4803,7 +5332,7 @@ dependencies = [ "toml 0.5.11", "tracing", "tracing-appender", - "tracing-log", + "tracing-log 0.2.0", "tracing-subscriber", "zeroize", ] @@ -5170,7 +5699,7 @@ dependencies = [ "borsh-ext", "byte-unit", "bytes", - "clap", + "clap 4.5.4", "color-eyre", "data-encoding", "drain_filter_polyfill", @@ -5206,6 +5735,7 @@ dependencies = [ "regex", "rlimit", "rocksdb", + "serde", "serde_json", "sha2 0.9.9", "smooth-operator", @@ -5294,7 +5824,7 @@ dependencies = [ "borsh", "borsh-ext", "circular-queue", - "clap", + "clap 4.5.4", "data-encoding", "duration-str", "either", @@ -5350,7 +5880,7 @@ dependencies = [ "tempfile", "tendermint-rpc", "thiserror", - "tiny-bip39", + "tiny-bip39 0.8.2", "tokio", "toml 0.5.11", "tracing", @@ -5499,6 +6029,7 @@ dependencies = [ "flate2", "fs_extra", "hyper 0.14.27", + "ibc-relayer-cli", "ibc-testkit", "ics23", "itertools 0.12.1", @@ -5526,6 +6057,7 @@ dependencies = [ "tar", "tempfile", "tendermint-light-client", + "tendermint-testgen", "test-log", "tokio", "toml 0.5.11", @@ -5778,7 +6310,7 @@ dependencies = [ "slip10_ed25519", "smooth-operator", "thiserror", - "tiny-bip39", + "tiny-bip39 0.8.2", "tiny-hderive", "toml 0.5.11", "zeroize", @@ -5888,6 +6420,7 @@ dependencies = [ "autocfg", "num-integer", "num-traits 0.2.17", + "serde", ] [[package]] @@ -5924,7 +6457,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -5958,6 +6491,7 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.17", + "serde", ] [[package]] @@ -5998,7 +6532,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] @@ -6028,7 +6562,7 @@ checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -6040,7 +6574,7 @@ dependencies = [ "proc-macro-crate 2.0.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -6058,6 +6592,15 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "oneline-eyre" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "862f17a1e689c0ce8ca158ea48e776c5101c5d14fdfbed3e01c15f89604c3097" +dependencies = [ + "eyre", +] + [[package]] name = "oorandom" version = "11.1.3" @@ -6118,7 +6661,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -6139,6 +6682,63 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "opentelemetry" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4b8347cc26099d3aeee044065ecc3ae11469796b4d65d065a23a584ed92a6f" +dependencies = [ + "opentelemetry_api", + "opentelemetry_sdk", +] + +[[package]] +name = "opentelemetry-prometheus" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a9f186f6293ebb693caddd0595e66b74a6068fa51048e26e0bf9c95478c639c" +dependencies = [ + "opentelemetry", + "prometheus", + "protobuf", +] + +[[package]] +name = "opentelemetry_api" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed41783a5bf567688eb38372f2b7a8530f5a607a4b49d38dd7573236c23ca7e2" +dependencies = [ + "fnv", + "futures-channel", + "futures-util", + "indexmap 1.9.3", + "once_cell", + "pin-project-lite", + "thiserror", + "urlencoding", +] + +[[package]] +name = "opentelemetry_sdk" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b3a2a91fdbfdd4d212c0dcc2ab540de2c2bcbbd90be17de7a7daf8822d010c1" +dependencies = [ + "async-trait", + "crossbeam-channel", + "dashmap", + "fnv", + "futures-channel", + "futures-executor", + "futures-util", + "once_cell", + "opentelemetry_api", + "percent-encoding", + "rand 0.8.5", + "thiserror", +] + [[package]] name = "ordered-multimap" version = "0.7.3" @@ -6161,6 +6761,12 @@ dependencies = [ "zeroize", ] +[[package]] +name = "os_str_bytes" +version = "6.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1" + [[package]] name = "overload" version = "0.1.1" @@ -6384,7 +6990,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -6405,7 +7011,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" dependencies = [ "fixedbitset", - "indexmap 2.2.6", + "indexmap 2.6.0", ] [[package]] @@ -6435,7 +7041,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -6585,7 +7191,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" dependencies = [ "proc-macro2", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -6652,13 +7258,28 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] +[[package]] +name = "prometheus" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" +dependencies = [ + "cfg-if", + "fnv", + "lazy_static", + "memchr", + "parking_lot", + "protobuf", + "thiserror", +] + [[package]] name = "proptest" version = "1.4.0" @@ -6673,7 +7294,7 @@ dependencies = [ "rand 0.8.5", "rand_chacha 0.3.1", "rand_xorshift", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", "rusty-fork", "tempfile", "unarray", @@ -6735,7 +7356,7 @@ dependencies = [ "prost 0.12.3", "prost-types 0.12.3", "regex", - "syn 2.0.52", + "syn 2.0.87", "tempfile", "which", ] @@ -6763,7 +7384,7 @@ dependencies = [ "itertools 0.11.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -6776,7 +7397,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -6806,6 +7427,12 @@ dependencies = [ "prost 0.13.2", ] +[[package]] +name = "protobuf" +version = "2.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" + [[package]] name = "ptr_meta" version = "0.1.4" @@ -6835,6 +7462,21 @@ dependencies = [ "nix", ] +[[package]] +name = "quanta" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" +dependencies = [ + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi 0.11.0+wasi-snapshot-preview1", + "web-sys", + "winapi", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -6936,6 +7578,15 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "raw-cpuid" +version = "11.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "rayon" version = "1.5.3" @@ -7023,14 +7674,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.3", - "regex-syntax 0.8.2", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", ] [[package]] @@ -7044,13 +7695,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", ] [[package]] @@ -7061,9 +7712,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "region" @@ -7111,9 +7762,9 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-native-certs", - "rustls-pemfile", + "rustls 0.21.12", + "rustls-native-certs 0.6.3", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", @@ -7121,7 +7772,7 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", @@ -7130,6 +7781,12 @@ dependencies = [ "winreg", ] +[[package]] +name = "retry" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9166d72162de3575f950507683fac47e30f6f2c3836b71b7fbc61aa517c9c5f4" + [[package]] name = "rfc6979" version = "0.4.0" @@ -7193,7 +7850,7 @@ dependencies = [ "rkyv_derive", "seahash", "tinyvec", - "uuid 1.8.0", + "uuid 1.11.0", ] [[package]] @@ -7322,7 +7979,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.20", + "semver 1.0.23", ] [[package]] @@ -7346,10 +8003,39 @@ checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.7", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring 0.17.7", + "rustls-pki-types", + "rustls-webpki 0.102.8", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls" +version = "0.23.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +dependencies = [ + "log", + "once_cell", + "ring 0.17.7", + "rustls-pki-types", + "rustls-webpki 0.102.8", + "subtle", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -7357,7 +8043,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.2.0", + "rustls-pki-types", "schannel", "security-framework", ] @@ -7371,6 +8070,21 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -7381,6 +8095,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring 0.17.7", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.14" @@ -7478,7 +8203,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -7536,6 +8261,37 @@ dependencies = [ "zeroize", ] +[[package]] +name = "secp256k1" +version = "0.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +dependencies = [ + "bitcoin_hashes", + "rand 0.8.5", + "secp256k1-sys", + "serde", +] + +[[package]] +name = "secp256k1-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +dependencies = [ + "cc", +] + +[[package]] +name = "secrecy" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bd1c54ea06cfd2f6b63219704de0b9b4f72dcc2b8fdef820be6cd799780e91e" +dependencies = [ + "serde", + "zeroize", +] + [[package]] name = "security-framework" version = "2.9.2" @@ -7576,9 +8332,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -7606,9 +8362,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "serde" -version = "1.0.203" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -7654,13 +8410,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -7671,20 +8427,31 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af99884400da37c88f5e9146b7f1fd0fbcae8f6eec4e9da38b67d05486f814a6" +dependencies = [ + "itoa", + "serde", +] + [[package]] name = "serde_repr" version = "0.1.17" @@ -7693,14 +8460,14 @@ checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -7756,7 +8523,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "itoa", "ryu", "serde", @@ -7837,12 +8604,28 @@ dependencies = [ "memmap2 0.6.2", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "shlex" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" +[[package]] +name = "signal-hook" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +dependencies = [ + "libc", + "signal-hook-registry", +] + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -7937,7 +8720,7 @@ source = "git+https://github.com/heliaxdev/smooth-operator?tag=v0.7.0#0e182707f5 dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -8085,14 +8868,14 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] name = "subtle" -version = "2.4.1" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subtle-encoding" @@ -8122,9 +8905,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -8140,7 +8923,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -8155,6 +8938,18 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + [[package]] name = "sysinfo" version = "0.27.8" @@ -8190,6 +8985,12 @@ dependencies = [ "libc", ] +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + [[package]] name = "tap" version = "1.0.1" @@ -8267,7 +9068,7 @@ dependencies = [ "serde", "serde_json", "tendermint", - "toml 0.8.2", + "toml 0.8.19", "url", ] @@ -8296,6 +9097,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "tendermint-light-client-detector" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb1ac1607eb7a3393313558b339c36eebeba15aa7f2d101d1d47299e65825152" +dependencies = [ + "crossbeam-channel", + "derive_more", + "flex-error", + "futures", + "serde", + "serde_cbor", + "serde_derive", + "serde_json", + "static_assertions", + "tendermint", + "tendermint-light-client", + "tendermint-proto", + "tendermint-rpc", + "time", + "tracing", +] + [[package]] name = "tendermint-light-client-verifier" version = "0.38.1" @@ -8332,6 +9156,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02f96a2b8a0d3d0b59e4024b1a6bdc1589efc6af4709d08a480a20cc4ba90f63" dependencies = [ "async-trait", + "async-tungstenite", "bytes", "flex-error", "futures", @@ -8340,7 +9165,7 @@ dependencies = [ "pin-project", "rand 0.8.5", "reqwest", - "semver 1.0.20", + "semver 1.0.23", "serde", "serde_bytes", "serde_json", @@ -8354,7 +9179,7 @@ dependencies = [ "tokio", "tracing", "url", - "uuid 1.8.0", + "uuid 1.11.0", "walkdir", ] @@ -8374,6 +9199,15 @@ dependencies = [ "time", ] +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "terminal_size" version = "0.3.0" @@ -8408,7 +9242,7 @@ checksum = "7ba277e77219e9eea169e8508942db1bf5d8a41ff2db9b20aab5a5aadc9fa25d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -8446,22 +9280,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -8533,6 +9367,25 @@ dependencies = [ "zeroize", ] +[[package]] +name = "tiny-bip39" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" +dependencies = [ + "anyhow", + "hmac 0.12.1", + "once_cell", + "pbkdf2 0.11.0", + "rand 0.8.5", + "rustc-hash", + "sha2 0.10.8", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + [[package]] name = "tiny-hderive" version = "0.3.0" @@ -8605,7 +9458,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -8624,7 +9477,29 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.12", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.4", + "rustls-pki-types", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls 0.23.16", + "rustls-pki-types", "tokio", ] @@ -8661,7 +9536,7 @@ dependencies = [ "futures-util", "log", "tokio", - "tungstenite", + "tungstenite 0.20.1", ] [[package]] @@ -8715,21 +9590,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.2" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.2", + "toml_edit 0.22.22", ] [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] @@ -8740,7 +9615,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -8753,9 +9628,7 @@ version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.2.6", - "serde", - "serde_spanned", + "indexmap 2.6.0", "toml_datetime", "winnow 0.5.25", ] @@ -8766,11 +9639,24 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ - "indexmap 2.2.6", + "indexmap 2.6.0", "toml_datetime", "winnow 0.5.25", ] +[[package]] +name = "toml_edit" +version = "0.22.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +dependencies = [ + "indexmap 2.6.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow 0.6.20", +] + [[package]] name = "tonic" version = "0.12.2" @@ -8779,7 +9665,7 @@ checksum = "c6f6ba989e4b2c58ae83d862d3a3e27690b6e3ae630d0deb59f3697f32aa88ad" dependencies = [ "async-stream", "async-trait", - "axum", + "axum 0.7.5", "base64 0.22.1", "bytes", "h2 0.4.6", @@ -8792,8 +9678,11 @@ dependencies = [ "percent-encoding", "pin-project", "prost 0.13.2", + "rustls-native-certs 0.7.3", + "rustls-pemfile 2.2.0", "socket2 0.5.5", "tokio", + "tokio-rustls 0.26.0", "tokio-stream", "tower", "tower-layer", @@ -8811,7 +9700,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -8897,7 +9786,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -8930,6 +9819,17 @@ dependencies = [ "tracing", ] +[[package]] +name = "tracing-log" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + [[package]] name = "tracing-log" version = "0.2.0" @@ -8968,10 +9868,16 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.2.0", "tracing-serde", ] +[[package]] +name = "triomphe" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" + [[package]] name = "try-lock" version = "0.2.4" @@ -8997,6 +9903,27 @@ dependencies = [ "utf-8", ] +[[package]] +name = "tungstenite" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef1a641ea34f399a848dea702823bbecfb4c486f911735368f1f137cb8257e1" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http 1.1.0", + "httparse", + "log", + "rand 0.8.5", + "rustls 0.22.4", + "rustls-pki-types", + "sha1", + "thiserror", + "url", + "utf-8", +] + [[package]] name = "typed-builder" version = "0.19.1" @@ -9014,7 +9941,7 @@ checksum = "f9534daa9fd3ed0bd911d462a37f172228077e7abf18c18a5f67199d959205f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -9156,6 +10083,12 @@ dependencies = [ "serde", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "utf-8" version = "0.7.6" @@ -9186,9 +10119,12 @@ dependencies = [ [[package]] name = "uuid" -version = "1.8.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +dependencies = [ + "getrandom 0.2.15", +] [[package]] name = "valuable" @@ -9216,7 +10152,7 @@ checksum = "b3fd98999db9227cf28e59d83e1f120f42bc233d4b152e8fab9bc87d5bb1e0f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -9265,7 +10201,7 @@ dependencies = [ "multer", "percent-encoding", "pin-project", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "scoped-tls", "serde", "serde_json", @@ -9311,7 +10247,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", "wasm-bindgen-shared", ] @@ -9345,7 +10281,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -9492,15 +10428,15 @@ dependencies = [ "bytesize", "derive_builder", "hex", - "indexmap 2.2.6", + "indexmap 2.6.0", "schemars", - "semver 1.0.20", + "semver 1.0.23", "serde", "serde_cbor", "serde_json", "serde_yaml 0.9.34+deprecated", "thiserror", - "toml 0.8.2", + "toml 0.8.19", "url", ] @@ -9572,7 +10508,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29e3ac9b780c7dda0cac7a52a5d6d2d6707cc6e3451c9db209b6c758f40d7acb" dependencies = [ "indexmap 1.9.3", - "semver 1.0.20", + "semver 1.0.23", ] [[package]] @@ -9582,8 +10518,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ "bitflags 2.5.0", - "indexmap 2.2.6", - "semver 1.0.20", + "indexmap 2.6.0", + "semver 1.0.23", ] [[package]] @@ -9646,7 +10582,7 @@ dependencies = [ "indexmap 1.9.3", "libc", "once_cell", - "semver 1.0.20", + "semver 1.0.23", "serde", "serde_cbor", "serde_json", @@ -9970,9 +10906,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.8" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] @@ -10093,7 +11029,7 @@ checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] @@ -10113,7 +11049,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.87", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index bb602e5f35..f3edbc8719 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -118,9 +118,12 @@ fs_extra = "1.2.0" futures = "0.3" git2 = { version = "0.18.1", default-features = false } # branch yuji/derive-arbitrary -ibc = { git = "https://github.com/heliaxdev/cosmos-ibc-rs", rev = "38bd2a32f35117d4d9165a3c68c64ccd87ad56dd", features = ["serde"] } -ibc-derive = { git = "https://github.com/heliaxdev/cosmos-ibc-rs", rev = "38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" } -ibc-testkit = { git = "https://github.com/heliaxdev/cosmos-ibc-rs", rev = "38bd2a32f35117d4d9165a3c68c64ccd87ad56dd", default-features = false } +# ibc = { git = "https://github.com/heliaxdev/cosmos-ibc-rs", rev = "38bd2a32f35117d4d9165a3c68c64ccd87ad56dd", features = ["serde"] } +# ibc-derive = { git = "https://github.com/heliaxdev/cosmos-ibc-rs", rev = "38bd2a32f35117d4d9165a3c68c64ccd87ad56dd" } +# ibc-testkit = { git = "https://github.com/heliaxdev/cosmos-ibc-rs", rev = "38bd2a32f35117d4d9165a3c68c64ccd87ad56dd", default-features = false } +ibc = { path = "../ibc-rs/ibc", features = ["serde"] } +ibc-derive = { path = "../ibc-rs/ibc-derive" } +ibc-testkit = { path = "../ibc-rs/ibc-testkit", default-features = false } ics23 = "0.12.0" index-set = { git = "https://github.com/heliaxdev/index-set", tag = "v0.8.1", features = ["serialize-borsh", "serialize-serde"] } indexmap = { git = "https://github.com/heliaxdev/indexmap", tag = "2.2.4-heliax-1", features = ["borsh-schema", "serde"] } @@ -189,6 +192,7 @@ tendermint-config = "0.38.0" tendermint-light-client = "0.38.0" tendermint-proto = "0.38.0" tendermint-rpc = {version = "0.38.0", default-features = false} +tendermint-testgen = "0.38.0" test-log = {version = "0.2.14", default-features = false, features = ["trace"]} tiny-bip39 = {git = "https://github.com/anoma/tiny-bip39.git", rev = "bf0f6d8713589b83af7a917366ec31f5275c0e57"} tiny-hderive = {git = "https://github.com/heliaxdev/tiny-hderive.git", rev = "173ae03abed0cd25d88a5a13efac00af96b75b87"} @@ -207,7 +211,7 @@ tracing-appender = "0.2.2" tracing-log = "0.2.0" tracing-subscriber = {version = "0.3.7", default-features = false, features = ["env-filter", "fmt"]} typed-builder = "0.19.1" -wasmparser = "0.107.0" +warp = "0.3.6" wasm-instrument = {version = "0.4.0", features = ["sign_ext"]} wasmer = "4.3.5" wasmer-cache = "4.3.5" @@ -215,6 +219,7 @@ wasmer-compiler = "4.3.5" wasmer-compiler-singlepass = "4.3.5" wasmer-types = "4.3.5" wasmer-vm = "4.3.5" +wasmparser = "0.107.0" wasmtimer = "0.2.0" winapi = "0.3.9" xorf = { version = "0.11.0", features = ["serde"] } diff --git a/crates/core/src/key/mod.rs b/crates/core/src/key/mod.rs index 6075c9091b..39b7f59b2a 100644 --- a/crates/core/src/key/mod.rs +++ b/crates/core/src/key/mod.rs @@ -368,6 +368,12 @@ impl From<&PK> for PublicKeyHash { } } +impl From for [u8; address::HASH_LEN] { + fn from(PublicKeyHash(value): PublicKeyHash) -> Self { + value + } +} + /// Derive Tendermint raw hash from the public key pub trait PublicKeyTmRawHash { /// Derive Tendermint raw hash from the public key diff --git a/crates/ibc/src/context/client.rs b/crates/ibc/src/context/client.rs index 32a7e43935..442f93a0f6 100644 --- a/crates/ibc/src/context/client.rs +++ b/crates/ibc/src/context/client.rs @@ -219,9 +219,10 @@ impl TryFrom> for AnyConsensusState { type Error = ClientError; fn try_from(bytes: Vec) -> Result { + dbg!(&bytes); Any::decode(&bytes[..]) - .map_err(|e| ClientError::Other { - description: e.to_string(), + .map_err(|e: prost::DecodeError| ClientError::Other { + description: format!("decode AnyConsensusState {e}"), })? .try_into() } diff --git a/crates/ibc/src/context/common.rs b/crates/ibc/src/context/common.rs index 7f920d8cb3..2c665939d2 100644 --- a/crates/ibc/src/context/common.rs +++ b/crates/ibc/src/context/common.rs @@ -43,7 +43,7 @@ pub trait IbcCommonContext: IbcStorageContext { match self.storage().read_bytes(&key)? { Some(value) => Any::decode(&value[..]) .map_err(|e| ClientError::Other { - description: e.to_string(), + description: format!("client_state {e}"), })? .try_into() .map_err(ContextError::from), @@ -77,7 +77,7 @@ pub trait IbcCommonContext: IbcStorageContext { match self.storage().read_bytes(&key)? { Some(value) => Any::decode(&value[..]) .map_err(|e| ClientError::Other { - description: e.to_string(), + description: format!("consensus_state {e}"), })? .try_into() .map_err(ContextError::from), @@ -120,7 +120,7 @@ pub trait IbcCommonContext: IbcStorageContext { ) -> Result { Any::decode(&consensus_state[..]) .map_err(|e| ClientError::Other { - description: e.to_string(), + description: format!("decode_consensus_state_value {e}"), })? .try_into() .map_err(ContextError::from) @@ -138,7 +138,7 @@ pub trait IbcCommonContext: IbcStorageContext { let key = Key::parse(key).expect("the key should be parsable"); let height = storage::consensus_height(&key).map_err(|e| { ClientError::Other { - description: e.to_string(), + description: format!("consensus state heights: {e}"), } })?; heights.push(height); diff --git a/crates/ibc/src/lib.rs b/crates/ibc/src/lib.rs index ff5d8d34f4..92da126433 100644 --- a/crates/ibc/src/lib.rs +++ b/crates/ibc/src/lib.rs @@ -737,14 +737,14 @@ where // needed in actual txs to addresses whose VPs should be triggered let verifiers = Rc::new(RefCell::new(BTreeSet::
::new())); - let message = decode_message::(tx_data)?; + let message = decode_message::(tx_data).unwrap(); match message { IbcMessage::Transfer(msg) => { let token_transfer_ctx = TokenTransferContext::new( self.ctx.inner.clone(), verifiers.clone(), ); - self.insert_verifiers()?; + self.insert_verifiers().unwrap(); send_transfer_validate( &self.ctx, &token_transfer_ctx, @@ -763,6 +763,7 @@ where .map_err(Error::NftTransfer) } IbcMessage::Envelope(envelope) => { + dbg!(&envelope); validate(&self.ctx, &self.router, *envelope) .map_err(|e| Error::Context(Box::new(e))) } diff --git a/crates/ibc/src/vp/mod.rs b/crates/ibc/src/vp/mod.rs index 6df0eba624..ec5b8a2f3c 100644 --- a/crates/ibc/src/vp/mod.rs +++ b/crates/ibc/src/vp/mod.rs @@ -163,16 +163,16 @@ where .ok_or(VpError::NoTxData)?; // Pseudo execution and compare them - self.validate_state(&tx_data, keys_changed)?; + self.validate_state(&tx_data, keys_changed).unwrap(); // Validate the state according to the given IBC message - self.validate_with_msg(&tx_data)?; + self.validate_with_msg(&tx_data).unwrap(); // Validate the denom store if a denom key has been changed - self.validate_trace(keys_changed)?; + self.validate_trace(keys_changed).unwrap(); // Check the limits - self.check_limits(keys_changed)?; + self.check_limits(keys_changed).unwrap(); Ok(()) } diff --git a/crates/node/Cargo.toml b/crates/node/Cargo.toml index 239e77e273..35d0000057 100644 --- a/crates/node/Cargo.toml +++ b/crates/node/Cargo.toml @@ -24,6 +24,7 @@ testing = [ "clap", "lazy_static", "rand", + "serde", ] benches = [ "namada_apps_lib/benches", @@ -86,6 +87,7 @@ rayon.workspace = true regex.workspace = true rlimit.workspace = true rocksdb.workspace = true +serde = {workspace = true, optional = true} serde_json = {workspace = true, features = ["raw_value"]} sha2.workspace = true smooth-operator.workspace = true @@ -99,7 +101,7 @@ tower-abci.workspace = true tower.workspace = true tracing-subscriber = { workspace = true, optional = true, features = ["std", "json", "ansi", "tracing-log"]} tracing.workspace = true -warp = "0.3.2" +warp.workspace = true zstd.workspace = true [dev-dependencies] @@ -112,6 +114,7 @@ clap.workspace = true lazy_static.workspace= true proptest.workspace = true rand = { workspace = true, features = ["std"] } +serde.workspace = true test-log.workspace = true tokio-test.workspace = true diff --git a/crates/node/src/shell/testing/node.rs b/crates/node/src/shell/testing/node.rs index 7bffba9090..1eaab2f530 100644 --- a/crates/node/src/shell/testing/node.rs +++ b/crates/node/src/shell/testing/node.rs @@ -10,7 +10,7 @@ use color_eyre::eyre::{Report, Result}; use data_encoding::HEXUPPER; use itertools::Either; use lazy_static::lazy_static; -use namada_sdk::address::Address; +use namada_sdk::address::{self, Address}; use namada_sdk::chain::{BlockHeader, BlockHeight, Epoch}; use namada_sdk::collections::HashMap; use namada_sdk::control_flow::time::Duration; @@ -21,8 +21,9 @@ use namada_sdk::events::log::dumb_queries; use namada_sdk::events::Event; use namada_sdk::hash::Hash; use namada_sdk::io::Client; -use namada_sdk::key::tm_consensus_key_raw_hash; +use namada_sdk::key::{tm_consensus_key_raw_hash, PublicKeyHash}; use namada_sdk::proof_of_stake::storage::{ + get_consensus_key, read_consensus_validator_set_addresses, read_consensus_validator_set_addresses_with_stake, read_pos_params, validator_consensus_key_handle, }; @@ -39,7 +40,7 @@ use namada_sdk::tendermint_proto::google::protobuf::Timestamp; use namada_sdk::time::DateTimeUtc; use namada_sdk::tx::data::ResultCode; use namada_sdk::tx::event::{Batch as BatchAttr, Code as CodeAttr}; -use namada_sdk::{ethereum_structs, governance}; +use namada_sdk::{ethereum_structs, governance, tendermint_proto}; use regex::Regex; use tokio::sync::mpsc; @@ -50,7 +51,7 @@ use crate::ethereum_oracle::{ control, last_processed_block, try_process_eth_events, }; use crate::shell::testing::utils::TestDir; -use crate::shell::{EthereumOracleChannels, Shell}; +use crate::shell::{key_to_tendermint, EthereumOracleChannels, Shell}; use crate::shims::abcipp_shim_types::shim::request::{ FinalizeBlock, ProcessedTx, }; @@ -497,9 +498,10 @@ impl MockNode { .collect() }; // build finalize block abci request + let merkle_root = locked.state.in_mem().merkle_root().0; let req = FinalizeBlock { header: BlockHeader { - hash: Hash([0; 32]), + hash: Hash(merkle_root), #[allow(clippy::disallowed_methods)] time: header_time.unwrap_or_else(DateTimeUtc::now), next_validators_hash: Hash([0; 32]), @@ -548,7 +550,7 @@ impl MockNode { height, block::Response { block_id: tendermint::block::Id { - hash: tendermint::Hash::None, + hash: tendermint::Hash::Sha256(merkle_root), part_set_header: tendermint::block::parts::Header::default( ), }, @@ -729,6 +731,166 @@ impl MockNode { locked.commit(); } + /// TODO + fn handle_broadcast_tx_sync( + &self, + tx: Vec, + ) -> tendermint_rpc::endpoint::broadcast::tx_sync::Response { + let (proposer_address, votes) = self.prepare_request(); + + #[allow(clippy::disallowed_methods)] + let time = DateTimeUtc::now(); + let req = RequestProcessProposal { + txs: vec![tx.clone().into()], + proposer_address: proposer_address.clone().into(), + time: Some(Timestamp { + seconds: time.0.timestamp(), + nanos: time.0.timestamp_subsec_nanos() as i32, + }), + ..Default::default() + }; + let mut locked = self.shell.lock().unwrap(); + let height = + locked.state.in_mem().get_last_block_height().next_height(); + println!("Executing tx in block height {height}"); + let (result, tx_results) = locked.process_proposal(req); + + let mut errors: Vec<_> = tx_results + .iter() + .map(|e| { + if e.code == 0 { + NodeResults::Ok + } else { + NodeResults::Rejected(e.clone()) + } + }) + .collect(); + if result != tendermint::abci::response::ProcessProposal::Accept { + self.tx_result_codes.lock().unwrap().append(&mut errors); + panic!("Tx rejected in ProcessProposal") + } + + // process proposal succeeded, now run finalize block + + let time = { + #[allow(clippy::disallowed_methods)] + let time = DateTimeUtc::now(); + // Set the block time in the past to avoid non-deterministically + // starting new epochs + let dur = namada_sdk::time::Duration::minutes(10); + time - dur + }; + let req = FinalizeBlock { + header: BlockHeader { + hash: Hash([0; 32]), + #[allow(clippy::disallowed_methods)] + time, + next_validators_hash: Hash([0; 32]), + }, + block_hash: Hash([0; 32]), + byzantine_validators: vec![], + txs: [tx.clone()] + .into_iter() + .zip(tx_results) + .map(|(tx, result)| ProcessedTx { + tx: tx.into(), + result, + }) + .collect(), + proposer_address, + height: height.try_into().unwrap(), + decided_last_commit: tendermint::abci::types::CommitInfo { + round: 0u8.into(), + votes, + }, + }; + + // process the results + let resp = locked.finalize_block(req).unwrap(); + let mut error_codes = resp + .events + .iter() + .map(|e| { + let code = e + .read_attribute_opt::() + .unwrap() + .unwrap_or_default(); + if code == ResultCode::Ok { + NodeResults::Ok + } else { + NodeResults::Failed(code) + } + }) + .collect::>(); + let mut txs_results = resp + .events + .into_iter() + .filter_map(|e| e.read_attribute_opt::>().unwrap()) + .collect::>(); + self.tx_result_codes + .lock() + .unwrap() + .append(&mut error_codes); + + assert_eq!(txs_results.len(), 1); + let (Hash(hash), fst_res) = + txs_results.get(0).unwrap().iter().next().unwrap(); + let tx_res = tendermint_rpc::endpoint::broadcast::tx_sync::Response { + codespace: "".to_string(), + code: match fst_res { + Ok(res) if res.is_accepted() => tendermint::abci::Code::Ok, + _ => tendermint::abci::Code::Err(1_u32.try_into().unwrap()), + }, + data: bytes::Bytes::from(""), + log: "".to_string(), + hash: tendermint::Hash::Sha256(hash.clone()), + }; + + self.tx_results.lock().unwrap().append(&mut txs_results); + self.blocks.lock().unwrap().insert( + height, + block::Response { + block_id: tendermint::block::Id { + hash: tendermint::Hash::None, + part_set_header: tendermint::block::parts::Header::default( + ), + }, + block: tendermint::block::Block::new( + tendermint::block::Header { + version: tendermint::block::header::Version { + block: 0, + app: 0, + }, + chain_id: locked + .chain_id + .to_string() + .try_into() + .unwrap(), + height: 1u32.into(), + time: tendermint::Time::now(), + last_block_id: None, + last_commit_hash: None, + data_hash: None, + validators_hash: tendermint::Hash::None, + next_validators_hash: tendermint::Hash::None, + consensus_hash: tendermint::Hash::None, + app_hash: tendermint::AppHash::default(), + last_results_hash: None, + evidence_hash: None, + proposer_address: tendermint::account::Id::new( + [0u8; 20], + ), + }, + vec![tx], + tendermint::evidence::List::default(), + None, + ), + }, + ); + locked.commit(); + tx_res + } + // Check that applying a tx succeeded. fn success(&self) -> bool { let tx_result_codes = self.tx_result_codes.lock().unwrap(); @@ -778,6 +940,407 @@ impl MockNode { } self.clear_results(); } + + pub fn start_rpc_server( + self, + rt: &tokio::runtime::Runtime, + port: u16, + ) -> tokio::task::JoinHandle<()> { + let routes = { + use std::str::FromStr; + + use tendermint::node; + use tendermint::node::info::ProtocolVersionInfo; + use tendermint_rpc::endpoint::{abci_query, status}; + use tendermint_rpc::Method; + use warp::Filter; + + warp::post().and(warp::any().map(move|| (self.clone(), port))).and(warp::body::json()).then( + |(self_clone, port) :(MockNode, u16), request: RpcRequestWrapper| async move { + dbg!(&request); + + match request.method { + Method::Status => { + let (chain_id, BlockHeight(last_height), last_time, validator_pk) = { + let guard = self_clone + .shell + .lock() + .unwrap(); + let last_block = guard.state.in_mem().last_block.as_ref().unwrap(); + let last_epoch = guard.state.in_mem().last_epoch; + let validators = read_consensus_validator_set_addresses(&guard.state, last_epoch).unwrap(); + assert_eq!(validators.len(), 1); + let validator = validators.first().unwrap(); + let consensus_key = get_consensus_key::<_, governance::Store<_>>( + &guard.state, + &validator, last_epoch) + .unwrap() + .unwrap(); + + (guard.chain_id.to_string(), + last_block.height, + last_block.time, + consensus_key) + }; + + let validator_tm_pk = tendermint_proto::crypto::PublicKey { + sum: Some(key_to_tendermint(&validator_pk).unwrap()) + }; + let validator_address = <[u8;address::HASH_LEN]>::from( PublicKeyHash::from(&validator_pk)); + + let validator_info= tendermint::validator::Info { + address: tendermint::account::Id::new(validator_address), + pub_key: tendermint::PublicKey::try_from(validator_tm_pk).unwrap(), + power: tendermint::vote::Power::from(1_u32), + name: None, + proposer_priority: tendermint::validator::ProposerPriority::from(1_i64), + }; + + let response = status::Response { + node_info: node::Info { + protocol_version: ProtocolVersionInfo { + p2p: 0, + block: self_clone.block_height().0, + app: 0, + }, + id: node::Id::new([0_u8; 20]), + listen_addr: node::info::ListenAddress::new( + format!("tcp:127.0.0.1:{}", port - 1), + ), + network: tendermint::chain::Id::try_from( + chain_id, + ) + .unwrap(), + version: serde_json::from_str::< + tendermint::Version, + >( + "\"0.37.11\"" + ) + .unwrap(), + channels: serde_json::from_str::< + tendermint::channel::Channels, + >( + "\"01234\"" + ) + .unwrap(), + moniker: tendermint::Moniker::from_str( + "whatever", + ) + .unwrap(), + other: node::info::OtherInfo { + tx_index: node::info::TxIndexStatus::On, + rpc_address: format!( + "tcp:127.0.0.1:{port}" + ), + }, + }, + sync_info: status::SyncInfo { + earliest_block_hash: tendermint::Hash::None, + earliest_app_hash: tendermint::AppHash::try_from(vec![]).unwrap(), + earliest_block_height: tendermint::block::Height::from(1_u32), + earliest_block_time: tendermint::Time::now(), + latest_block_hash: tendermint::Hash::None, + latest_app_hash: tendermint::AppHash::try_from(vec![]).unwrap(), + latest_block_height: tendermint::block::Height::try_from(last_height).unwrap(), + latest_block_time: tendermint::Time::try_from(last_time).unwrap(), + catching_up: false, + }, + validator_info, + }; + + let response = RpcResponseWrapper { + jsonrpc: request.jsonrpc, + id: request.id, + result: Some(response), + error: None, + }; + serde_json::to_string(&response).unwrap() + } + Method::Commit => { + use tendermint_rpc::endpoint::commit; + use tendermint::block::signed_header::SignedHeader; + use tendermint::block; + + let commit::Request { + height, + } = serde_json::from_value(request.params).unwrap(); + + let (BlockHeight(last_height), chain_id, merkle_root, validator_pk) = { + let guard = + self_clone + .shell + .lock().unwrap(); + let last_epoch = guard.state.in_mem().last_epoch; + let validators = read_consensus_validator_set_addresses(&guard.state, last_epoch).unwrap(); + assert_eq!(validators.len(), 1); + let validator = validators.first().unwrap(); + let consensus_key = get_consensus_key::<_, governance::Store<_>>( + &guard.state, + &validator, last_epoch) + .unwrap() + .unwrap(); + + (guard.state.in_mem().get_last_block_height(), + guard + .chain_id + .to_string(), + guard.state.in_mem().merkle_root().0, + consensus_key) + }; + + let (canonical, height) = match height { + Some(height) => { + let height = u64::from(height); + ( + // Height is canonical only if there's another block committed after it + height < last_height, height) + }, + None => (false, last_height), + }; + let validator_address = <[u8;address::HASH_LEN]>::from( PublicKeyHash::from(&validator_pk)); + let height= block::Height::try_from(height).unwrap(); + + let vote_power= tendermint::vote::Power::from(1_u32); + let validators = tendermint::validator::Set::new( + todo!(), + None, + ); + + let header = + block::Header { + version: block::header::Version { + block: 0, + app: 0, + }, + chain_id: tendermint::chain::Id::try_from( + chain_id, + ) + .unwrap(), + height, + time: tendermint::Time::now(), + last_block_id: None, + last_commit_hash: None, + data_hash: None, + // TODO how to derive the hash? + validators_hash: tendermint::Hash::from_str("66E9EA666684BAFEE0CF25D118AB2FFD17DC642F50373E5D75A8424EE023152F").unwrap(), + next_validators_hash: tendermint::Hash::from_str("66E9EA666684BAFEE0CF25D118AB2FFD17DC642F50373E5D75A8424EE023152F").unwrap(), + consensus_hash: tendermint::Hash::None, + // Try to fill this in + app_hash: tendermint::AppHash::try_from(merkle_root.to_vec()).unwrap(), + last_results_hash: None, + evidence_hash: None, + proposer_address: tendermint::account::Id::new(validator_address), + }; + // The header hash included in Commit must match for tendermint-light-client verification + let header_hash = header.hash_with::(); + let response = commit::Response { + signed_header: SignedHeader::new( + header, + block::Commit { + height, + round: 0_u16.into(), + block_id: block::Id{ + hash: header_hash, + part_set_header: block::parts::Header::new( + 0, + tendermint::Hash::None, + ).unwrap(), + }, + signatures: vec![], + }).unwrap(), + canonical, + }; + + let response = RpcResponseWrapper { + jsonrpc: request.jsonrpc, + id: request.id, + result: Some(response), + error: None, + }; + serde_json::to_string(&response).unwrap() + } + Method::Validators => { + use tendermint_rpc::endpoint::validators; + use tendermint::block; + use tendermint::validator; + use tendermint::vote; + + let params: validators::Request = serde_json::from_value(request.params).unwrap(); + + let (BlockHeight(last_height), validator_pk) = { + let guard = self_clone + .shell + .lock() + .unwrap(); + let last_block = guard.state.in_mem().last_block.as_ref().unwrap(); + let last_epoch = guard.state.in_mem().last_epoch; + let validators = read_consensus_validator_set_addresses(&guard.state, last_epoch).unwrap(); + assert_eq!(validators.len(), 1); + let validator = validators.first().unwrap(); + let consensus_key = get_consensus_key::<_, governance::Store<_>>( + &guard.state, + &validator, last_epoch) + .unwrap() + .unwrap(); + (last_block.height, + consensus_key + ) + }; + let height = match params.height { + Some(height) => u64::from(height), + None => last_height, + }; + + let validator_tm_pk = tendermint_proto::crypto::PublicKey { + sum: Some(key_to_tendermint(&validator_pk).unwrap()) + }; + let validator_address = <[u8;address::HASH_LEN]>::from( PublicKeyHash::from(&validator_pk)); + let validator_info= tendermint::validator::Info { + address: tendermint::account::Id::new(validator_address), + pub_key: tendermint::PublicKey::try_from(validator_tm_pk).unwrap(), + power: tendermint::vote::Power::from(1_u32), + name: None, + proposer_priority: tendermint::validator::ProposerPriority::from(1_i64), + }; + + let block_height= block::Height::try_from(height).unwrap(); + let response = validators::Response::new( + block_height, + vec![validator_info], + 1, + ); + + let response = RpcResponseWrapper { + jsonrpc: request.jsonrpc, + id: request.id, + result: Some(response), + error: None, + }; + serde_json::to_string(&response).unwrap() + } + Method::AbciQuery => { + let abci_query::Request { + path, + data, + height, + prove, + } = serde_json::from_value(request.params).unwrap(); + let query_request = tendermint::abci::request::Query { + data: data.into(), + path: path.unwrap(), + height: height.unwrap_or_else(|| tendermint::block::Height::from(0_u32)), + prove, + }; + let tendermint::abci::response::Query { + code, + log, + info, + index, + key, + value, + proof, + height, + codespace, + } = self_clone + .shell + .lock() + .unwrap() + .query(query_request); + if prove { + dbg!(&proof.is_some()); + } + + let response = abci_query::Response { + response: abci_query::AbciQuery { + code, + log, + info, + index, + key: key.into(), + value: value.into(), + proof, + height, + codespace, + } + }; + let response = RpcResponseWrapper { + jsonrpc: request.jsonrpc, + id: request.id, + result: Some(response), + error: None, + }; + serde_json::to_string(&response).unwrap() + } + Method::BroadcastTxSync => { + use tendermint_rpc::endpoint::broadcast::tx_sync; + let tx_sync::Request{tx} = + serde_json::from_value(request.params).unwrap(); + dbg!(&tx.len()); + + let response = self_clone.handle_broadcast_tx_sync(tx); + let response = RpcResponseWrapper { + jsonrpc: request.jsonrpc, + id: request.id, + result: Some(response), + error: None, + }; + serde_json::to_string(&response).unwrap() + } + _ => { + dbg!(request.method); + format!( + "Unsupported method {:?}", + request.method + ) + } + } + }, + ) + }; + + // Spawn the server into a runtime + rt.spawn(async move { + warp::serve(routes).bind(([127, 0, 0, 1], port)).await + }) + } +} + +/// JSON-RPC request wrapper (i.e. message envelope) +/// +/// Copied from `tendermint_rpc::request::Wrapper` because its fields there are +/// private. +#[derive(Debug, serde::Deserialize, serde::Serialize)] +pub struct RpcRequestWrapper { + /// JSON-RPC version + jsonrpc: tendermint_rpc::Version, + + /// Identifier included in request + id: tendermint_rpc::Id, + + /// Request method + method: tendermint_rpc::Method, + + /// Request parameters (i.e. request object) + params: R, +} + +/// JSON-RPC response wrapper (i.e. message envelope) +/// +/// Copied from `tendermint_rpc::response::Wrapper` because its fields there are +/// private. +#[derive(Debug, serde::Deserialize, serde::Serialize, Clone)] +pub struct RpcResponseWrapper { + /// JSON-RPC version + jsonrpc: tendermint_rpc::Version, + + /// Identifier included in request + id: tendermint_rpc::Id, + + /// Results of request (if successful) + result: Option, + + /// Error message if unsuccessful + error: Option, } #[async_trait::async_trait(?Send)] diff --git a/crates/tests/Cargo.toml b/crates/tests/Cargo.toml index 663d9fe204..21d9418944 100644 --- a/crates/tests/Cargo.toml +++ b/crates/tests/Cargo.toml @@ -74,11 +74,14 @@ expectrl.workspace = true eyre.workspace = true flate2.workspace = true fs_extra.workspace = true +# hermes = { git = "https://github.com/heliaxdev/hermes", package = "ibc-relayer-cli", branch = "namada-0.45" } +hermes = { path = "../../../hermes/crates/relayer-cli", package = "ibc-relayer-cli" } once_cell.workspace = true proptest-state-machine.workspace = true rand.workspace = true tar.workspace = true tendermint-light-client.workspace = true +tendermint-testgen.workspace = true test-log.workspace = true toml.workspace = true diff --git a/crates/tests/src/integration.rs b/crates/tests/src/integration.rs index 00423e8dc0..e19dbe45af 100644 --- a/crates/tests/src/integration.rs +++ b/crates/tests/src/integration.rs @@ -1,4 +1,5 @@ mod helpers; +mod ibc; mod ledger_tests; mod masp; mod setup; diff --git a/crates/tests/src/integration/ibc.rs b/crates/tests/src/integration/ibc.rs new file mode 100644 index 0000000000..c82d35c0d5 --- /dev/null +++ b/crates/tests/src/integration/ibc.rs @@ -0,0 +1,496 @@ +use std::fs; +use std::io::Write; +use std::mem::ManuallyDrop; +use std::path::{Path, PathBuf}; +use std::str::FromStr; +use std::sync::{Arc, Mutex}; + +use color_eyre::eyre::{eyre, Result}; +use namada_apps_lib::cli::args; +use namada_apps_lib::config::genesis::templates::{self, load_and_validate}; +use namada_apps_lib::config::{self, TendermintMode}; +use namada_apps_lib::wallet; +use namada_apps_lib::wallet::defaults::derive_template_dir; +use namada_node::shell::testing::node::{ + mock_services, InnerMockNode, MockNode, MockServicesCfg, + MockServicesController, MockServicesPackage, SalvageableTestDir, +}; +use namada_node::shell::testing::utils::TestDir; +use namada_node::shell::Shell; +use namada_node::tendermint_config::net::Address as TendermintAddress; +use namada_sdk::address::Address; +use namada_sdk::chain::{ChainId, ChainIdPrefix}; +use namada_sdk::collections::HashMap; +use namada_sdk::dec::Dec; +use namada_sdk::io::StdIo; +use namada_sdk::tendermint::Timeout; +use namada_sdk::tendermint_proto::google::protobuf::Timestamp; +use namada_sdk::token; +use test_log::test; + +use super::setup; +use crate::e2e::setup::{ + constants, copy_wasm_to_chain_dir, default_port_offset, ensure_hot_key, +}; +use crate::integration::helpers::find_address; + +#[test] +fn test_transfers() { + // Spawn tokio runtime for RPC servers + let rt = tokio::runtime::Runtime::new().unwrap(); + + // 1. Setup 2 Namada chains with unique IDs + let (node_a, _services_a) = + initialize_genesis(0, |genesis| genesis, Some("chain-a")).unwrap(); + let nam_addr = find_address(&node_a, constants::NAM).unwrap(); + let test_dir_a = node_a.test_dir.path().to_owned(); + // Node A uses port 26777 + let port_a = 26777_u16; + let _rpc_handle_a = node_a.clone().start_rpc_server(&rt, port_a); + + let chain_id_a = node_a.shell.lock().unwrap().chain_id.clone(); + let (node_b, _services_b) = + initialize_genesis(1, |genesis| genesis, Some("chain-b")).unwrap(); + let test_dir_b = node_b.test_dir.path().to_owned(); + // Node B uses port 26783 + let port_b = 26783_u16; + let chain_id_b = node_b.shell.lock().unwrap().chain_id.clone(); + let _rpc_handle_b = node_b.clone().start_rpc_server(&rt, port_b); + + let nam_addr_b = find_address(&node_a, constants::NAM).unwrap(); + // The NAM address is the same on both chains because its derived from the + // same config, but that's ok + assert_eq!(nam_addr, nam_addr_b); + + // 2. Configure hermes + let hermes_config = make_hermes_config( + port_a, + &chain_id_a, + &test_dir_a, + port_b, + &chain_id_b, + &test_dir_b, + &nam_addr, + ) + .unwrap(); + + // 3. Add wallet keys in Hermes for the chains + for (node, chain_id) in [(&node_a, &chain_id_a), (&node_b, &chain_id_b)] { + let chain_dir = node.test_dir.path().join(chain_id.as_str()); + dbg!(chain_id); + hermes_add_keys(&hermes_config, chain_id, chain_dir); + } + + // NOTE: Must have a block header before channel setup, otherwise the IBC + // transaction fails with "No host block header" + node_a.finalize_and_commit(None); + node_b.finalize_and_commit(None); + + // 4. Setup a Hermes channel between the chains + hermes_create_channel(&hermes_config, &chain_id_a, &chain_id_b); + + // 5. Make a transfer + todo!() +} + +// Roughly equivalent to "hermes create channel" CLI command +fn hermes_create_channel( + config: &hermes::Config, + chain_a: &ChainId, + chain_b: &ChainId, +) { + use hermes::commands::{ + connection_delay, Channel, Connection, ForeignClient, Ordering, PortId, + }; + + let hermes_chain_a = + hermes::commands::ChainId::from_str(chain_a.as_str()).unwrap(); + let hermes_chain_b = + hermes::commands::ChainId::from_str(chain_b.as_str()).unwrap(); + + let chains = hermes::cli_utils::ChainHandlePair::spawn( + config, + &hermes_chain_a, + &hermes_chain_b, + ) + .unwrap(); + + let client_a = + ForeignClient::new(chains.src.clone(), chains.dst.clone()).unwrap(); + let client_b = ForeignClient::new(chains.dst.clone(), chains.src).unwrap(); + + // Create the connection. + let con = Connection::new(client_a, client_b, connection_delay()).unwrap(); + + let port_a = PortId::from_str("transfer").unwrap(); + let port_b = PortId::from_str("transfer").unwrap(); + let order = Ordering::Unordered; + // Finally create the channel. + let channel = Channel::new(con, order, port_a, port_b, None).unwrap(); +} + +// Roughly equivalent to "hermes keys add" CLI command +fn hermes_add_keys( + config: &hermes::Config, + chain_id: &ChainId, + chain_dir: PathBuf, +) { + let hermes_chain_id = + hermes::commands::ChainId::from_str(chain_id.as_str()).unwrap(); + let key_file = wallet::wallet_file(chain_dir); + let chain_config = config.find_chain(&hermes_chain_id).unwrap(); + let key_name = chain_config.key_name().to_string(); + // The default HD path from hermes + // `crates/relayer-cli/src/commands/keys/add.rs` + let hd_path = + hermes::commands::StandardHDPath::from_str("m/44'/118'/0'/0/0") + .unwrap(); + + let _key = hermes::commands::add_key( + &chain_config, + &key_name, + &key_file, + &hd_path, + false, + ) + .unwrap(); +} + +fn make_hermes_config( + port_a: u16, + chain_id_a: &ChainId, + dir_a: &Path, + port_b: u16, + chain_id_b: &ChainId, + dir_b: &Path, + nam: &Address, +) -> Result { + use toml::map::Map; + use toml::Value; + + let mut config = Map::new(); + + let mut global = Map::new(); + global.insert("log_level".to_owned(), Value::String("debug".to_owned())); + config.insert("global".to_owned(), Value::Table(global)); + + let mut mode = Map::new(); + let mut clients = Map::new(); + clients.insert("enabled".to_owned(), Value::Boolean(true)); + clients.insert("refresh".to_owned(), Value::Boolean(true)); + clients.insert("misbehaviour".to_owned(), Value::Boolean(true)); + mode.insert("clients".to_owned(), Value::Table(clients)); + + let mut connections = Map::new(); + connections.insert("enabled".to_owned(), Value::Boolean(false)); + mode.insert("connections".to_owned(), Value::Table(connections)); + + let mut channels = Map::new(); + channels.insert("enabled".to_owned(), Value::Boolean(false)); + mode.insert("channels".to_owned(), Value::Table(channels)); + + let mut packets = Map::new(); + packets.insert("enabled".to_owned(), Value::Boolean(true)); + packets.insert("clear_interval".to_owned(), Value::Integer(30)); + packets.insert("clear_on_start".to_owned(), Value::Boolean(true)); + packets.insert("tx_confirmation".to_owned(), Value::Boolean(true)); + mode.insert("packets".to_owned(), Value::Table(packets)); + + config.insert("mode".to_owned(), Value::Table(mode)); + + let mut telemetry = Map::new(); + telemetry.insert("enabled".to_owned(), Value::Boolean(false)); + telemetry.insert("host".to_owned(), Value::String("127.0.0.1".to_owned())); + telemetry.insert("port".to_owned(), Value::Integer(3001)); + config.insert("telemetry".to_owned(), Value::Table(telemetry)); + + let chains = vec![ + make_hermes_chain_config(port_a, chain_id_a, dir_a, nam), + make_hermes_chain_config(port_b, chain_id_b, dir_b, nam), + ]; + + config.insert("chains".to_owned(), Value::Array(chains)); + + let toml = toml::to_vec(&Value::Table(config)).unwrap(); + + let config: hermes::Config = toml::from_slice(&toml).unwrap(); + Ok(config) +} + +fn make_hermes_chain_config( + port: u16, + chain_id: &ChainId, + dir: &Path, + nam: &Address, +) -> toml::Value { + use toml::map::Map; + use toml::Value; + + let chain_id = chain_id.as_str(); + let rpc_addr = format!("127.0.0.1:{port}"); + + let mut table = Map::new(); + table.insert("mode".to_owned(), Value::String("push".to_owned())); + let url = format!("ws://{}/websocket", rpc_addr); + table.insert("url".to_owned(), Value::String(url)); + table.insert("batch_delay".to_owned(), Value::String("500ms".to_owned())); + let event_source = Value::Table(table); + + let mut chain = Map::new(); + chain.insert("id".to_owned(), Value::String(chain_id.to_owned())); + chain.insert("type".to_owned(), Value::String("Namada".to_owned())); + chain.insert( + "rpc_addr".to_owned(), + Value::String(format!("http://{rpc_addr}")), + ); + // The grpc isn't used for Namada, but it's required + chain.insert( + "grpc_addr".to_owned(), + Value::String("http://127.0.0.1:9090".to_owned()), + ); + chain.insert("event_source".to_owned(), event_source); + chain.insert("account_prefix".to_owned(), Value::String("".to_owned())); + chain.insert( + "key_name".to_owned(), + Value::String(ensure_hot_key(constants::CHRISTEL_KEY).to_owned()), + ); + chain.insert("store_prefix".to_owned(), Value::String("ibc".to_owned())); + let mut table = Map::new(); + table.insert("price".to_owned(), Value::Float(0.000001)); + table.insert("denom".to_owned(), Value::String(nam.to_string())); + chain.insert("gas_price".to_owned(), Value::Table(table)); + + chain.insert("max_block_time".to_owned(), Value::String("60s".to_owned())); + chain.insert( + "key_store_folder".to_owned(), + Value::String(dir.to_string_lossy().to_string()), + ); + + Value::Table(chain) +} + +/// Setup folders with genesis, configs, wasm, etc. +/// This is similar to the fn with same name in +/// `crates/tests/src/integration/setup.rs`, but it allows to setup multiple +/// nodes by offsetting their ports by the given `node_index`. +fn initialize_genesis( + node_index: u8, + mut update_genesis: impl FnMut( + templates::All, + ) -> templates::All, + chain_prefix: Option<&str>, +) -> Result<(MockNode, MockServicesController)> { + let working_dir = std::fs::canonicalize("../..").unwrap(); + let keep_temp = match std::env::var(setup::ENV_VAR_KEEP_TEMP) { + Ok(val) => val.to_ascii_lowercase() != "false", + _ => false, + }; + let test_dir = TestDir::new(); + let template_dir = derive_template_dir(&working_dir); + + // Copy genesis files to test directory. + let mut templates = templates::All::read_toml_files(&template_dir) + .expect("Missing genesis files"); + for (_, config) in templates.tokens.token.iter_mut() { + config.masp_params = Some(token::ShieldedParams { + max_reward_rate: Dec::from_str("0.1").unwrap(), + kp_gain_nom: Dec::from_str("0.1").unwrap(), + kd_gain_nom: Dec::from_str("0.1").unwrap(), + locked_amount_target: 1_000_000u64, + }); + } + let templates = update_genesis(templates); + let genesis_path = test_dir.path().join("int-test-genesis-src"); + std::fs::create_dir(&genesis_path) + .expect("Could not create test chain directory."); + templates + .write_toml_files(&genesis_path) + .expect("Could not write genesis files into test chain directory."); + + // Finalize the genesis config to derive the chain ID + let templates = load_and_validate(&genesis_path) + .expect("Missing or invalid genesis files"); + let genesis_time = Default::default(); + let chain_id_prefix = + ChainIdPrefix::from_str(chain_prefix.unwrap_or("integration-test")) + .unwrap(); + let genesis = config::genesis::chain::finalize( + templates, + chain_id_prefix.clone(), + genesis_time, + Timeout::from_str("30s").unwrap(), + ); + let chain_id = &genesis.metadata.chain_id; + + // Run `init-network` to generate the finalized genesis config, keys and + // addresses and update WASM checksums + let wasm_checksums_path = working_dir.join("wasm/checksums.json"); + let global_args = args::Global { + is_pre_genesis: true, + chain_id: Some(chain_id.clone()), + base_dir: test_dir.path().to_path_buf(), + wasm_dir: Some(test_dir.path().join(chain_id.as_str()).join("wasm")), + }; + + // Create genesis chain release archive + let release_archive_path = namada_apps_lib::client::utils::init_network( + global_args.clone(), + args::InitNetwork { + templates_path: genesis_path, + wasm_checksums_path, + chain_id_prefix, + consensus_timeout_commit: Timeout::from_str("30s").unwrap(), + archive_dir: Some(test_dir.path().to_path_buf()), + genesis_time, + }, + ); + + // Decode and unpack the release archive + let mut archive = { + let decoder = flate2::read::GzDecoder::new( + fs::File::open(&release_archive_path).unwrap(), + ); + tar::Archive::new(decoder) + }; + archive.unpack(&global_args.base_dir).unwrap(); + _ = archive; + + // Remove release archive + fs::remove_file(release_archive_path).unwrap(); + + let eth_bridge_params = genesis.get_eth_bridge_params(); + let auto_drive_services = { + // NB: for now, the only condition that + // dictates whether mock services should + // be enabled is if the Ethereum bridge + // is enabled at genesis + eth_bridge_params.is_some() + }; + let enable_eth_oracle = { + // NB: we only enable the oracle if the + // Ethereum bridge is enabled at genesis + eth_bridge_params.is_some() + }; + let services_cfg = MockServicesCfg { + auto_drive_services, + enable_eth_oracle, + }; + setup::finalize_wallet(&template_dir, &global_args, genesis); + create_node(node_index, test_dir, global_args, keep_temp, services_cfg) +} + +/// Create a mock ledger node. +/// This is similar to the fn with same name in +/// `crates/tests/src/integration/setup.rs`, but it allows to setup multiple +/// nodes by offsetting their ports by the given `index`. +fn create_node( + index: u8, + test_dir: TestDir, + global_args: args::Global, + keep_temp: bool, + services_cfg: MockServicesCfg, +) -> Result<(MockNode, MockServicesController)> { + // look up the chain id from the global file. + let chain_id = global_args.chain_id.unwrap_or_default(); + + // copy compiled wasms into the wasm directory + copy_wasm_to_chain_dir( + &std::fs::canonicalize("../..").unwrap(), + &global_args.base_dir, + &chain_id, + ); + + // instantiate and initialize the ledger node. + let MockServicesPackage { + auto_drive_services, + services, + shell_handlers, + controller, + } = mock_services(services_cfg); + + let config = { + let mut config = config::Ledger::new( + global_args.base_dir, + chain_id.clone(), + TendermintMode::Validator, + ); + let offset = default_port_offset(20 + index); + let incr_port = |addr: &mut TendermintAddress| { + if let TendermintAddress::Tcp { port, .. } = addr { + *port += offset; + } + }; + incr_port(&mut config.cometbft.p2p.laddr); + incr_port(&mut config.cometbft.rpc.laddr); + incr_port(&mut config.cometbft.proxy_app); + config + }; + + let node = MockNode(Arc::new(InnerMockNode { + shell: Mutex::new(Shell::new( + config, + global_args + .wasm_dir + .expect("Wasm path not provided to integration test setup."), + shell_handlers.tx_broadcaster, + shell_handlers.eth_oracle_channels, + None, + None, + 50 * 1024 * 1024, // 50 kiB + 50 * 1024 * 1024, // 50 kiB + )), + test_dir: SalvageableTestDir { + keep_temp, + test_dir: ManuallyDrop::new(test_dir), + }, + services, + tx_result_codes: Mutex::new(vec![]), + tx_results: Mutex::new(vec![]), + blocks: Mutex::new(HashMap::new()), + auto_drive_services, + })); + let init_req = + namada_apps_lib::tendermint::abci::request::InitChain { + time: Timestamp { + seconds: 0, + nanos: 0, + } + .try_into().unwrap(), + chain_id: chain_id.to_string(), + consensus_params: + namada_apps_lib::tendermint::consensus::params::Params { + block: namada_apps_lib::tendermint::block::Size { + max_bytes: 0, + max_gas: 0, + time_iota_ms: 0, + }, + evidence: + namada_apps_lib::tendermint::evidence::Params { + max_age_num_blocks: 0, + max_age_duration: namada_apps_lib::tendermint::evidence::Duration(core::time::Duration::MAX), + max_bytes: 0, + }, + validator: namada_apps_lib::tendermint::consensus::params::ValidatorParams { + pub_key_types: vec![] + }, + version: None, + abci: namada_apps_lib::tendermint::consensus::params::AbciParams { + vote_extensions_enable_height: None, + }, + }, + validators: vec![], + app_state_bytes: vec![].into(), + initial_height: 0_u32.into(), + }; + { + let mut locked = node.shell.lock().unwrap(); + locked + .init_chain(init_req, 1) + .map_err(|e| eyre!("Failed to initialize ledger: {:?}", e))?; + // set the height of the first block (should be 1) + locked.state.in_mem_mut().block.height = 1.into(); + locked.commit(); + } + + Ok((node, controller)) +} diff --git a/crates/tests/src/integration/ledger_tests.rs b/crates/tests/src/integration/ledger_tests.rs index 7649c72413..7e45b9687e 100644 --- a/crates/tests/src/integration/ledger_tests.rs +++ b/crates/tests/src/integration/ledger_tests.rs @@ -972,17 +972,20 @@ fn inflation() -> Result<()> { // This address doesn't matter for tests. But an argument is required. let validator_one_rpc = "http://127.0.0.1:26567"; // 1. start the ledger node - let (mut node, _services) = setup::initialize_genesis(|mut genesis| { - genesis.parameters.pos_params.max_inflation_rate = - Dec::from_str("0.1").unwrap(); - genesis.parameters.pgf_params.stewards_inflation_rate = - Dec::from_str("0.1").unwrap(); - genesis.parameters.pgf_params.pgf_inflation_rate = - Dec::from_str("0.1").unwrap(); - genesis.parameters.pgf_params.stewards = - BTreeSet::from_iter([defaults::albert_address()]); - genesis - })?; + let (mut node, _services) = setup::initialize_genesis( + |mut genesis| { + genesis.parameters.pos_params.max_inflation_rate = + Dec::from_str("0.1").unwrap(); + genesis.parameters.pgf_params.stewards_inflation_rate = + Dec::from_str("0.1").unwrap(); + genesis.parameters.pgf_params.pgf_inflation_rate = + Dec::from_str("0.1").unwrap(); + genesis.parameters.pgf_params.stewards = + BTreeSet::from_iter([defaults::albert_address()]); + genesis + }, + None, + )?; let pos_inflation = [ 114400000.785983, @@ -1376,13 +1379,16 @@ fn pgf_steward_change_commission() -> Result<()> { // This address doesn't matter for tests. But an argument is required. let validator_one_rpc = "http://127.0.0.1:26567"; // 1. start the ledger node - let (node, _services) = setup::initialize_genesis(|mut genesis| { - genesis.parameters.pgf_params.stewards_inflation_rate = - Dec::from_str("0.1").unwrap(); - genesis.parameters.pgf_params.stewards = - BTreeSet::from_iter([defaults::albert_address()]); - genesis - })?; + let (node, _services) = setup::initialize_genesis( + |mut genesis| { + genesis.parameters.pgf_params.stewards_inflation_rate = + Dec::from_str("0.1").unwrap(); + genesis.parameters.pgf_params.stewards = + BTreeSet::from_iter([defaults::albert_address()]); + genesis + }, + None, + )?; // Query pgf stewards let query_pgf = vec!["query-pgf", "--node", &validator_one_rpc]; diff --git a/crates/tests/src/integration/masp.rs b/crates/tests/src/integration/masp.rs index 9cd8aaf07f..36347ae750 100644 --- a/crates/tests/src/integration/masp.rs +++ b/crates/tests/src/integration/masp.rs @@ -4195,12 +4195,15 @@ fn masp_fee_payment_gas_limit() -> Result<()> { let validator_one_rpc = "http://127.0.0.1:26567"; // Download the shielded pool parameters before starting node let _ = FsShieldedUtils::new(PathBuf::new()); - let (mut node, _services) = setup::initialize_genesis(|mut genesis| { - // Set an insufficient gas limit for masp fee payment to force all - // transactions to fail - genesis.parameters.parameters.masp_fee_payment_gas_limit = 10_000; - genesis - })?; + let (mut node, _services) = setup::initialize_genesis( + |mut genesis| { + // Set an insufficient gas limit for masp fee payment to force all + // transactions to fail + genesis.parameters.parameters.masp_fee_payment_gas_limit = 10_000; + genesis + }, + None, + )?; _ = node.next_masp_epoch(); // Add the relevant viewing keys to the wallet otherwise the shielded @@ -4772,14 +4775,17 @@ fn masp_fee_payment_with_different_token() -> Result<()> { let validator_one_rpc = "http://127.0.0.1:26567"; // Download the shielded pool parameters before starting node let _ = FsShieldedUtils::new(PathBuf::new()); - let (mut node, _services) = setup::initialize_genesis(|mut genesis| { - // Whitelist BTC for gas payment - genesis.parameters.parameters.minimum_gas_price.insert( - "btc".into(), - DenominatedAmount::new(1.into(), token::Denomination(6)), - ); - genesis - })?; + let (mut node, _services) = setup::initialize_genesis( + |mut genesis| { + // Whitelist BTC for gas payment + genesis.parameters.parameters.minimum_gas_price.insert( + "btc".into(), + DenominatedAmount::new(1.into(), token::Denomination(6)), + ); + genesis + }, + None, + )?; _ = node.next_masp_epoch(); // Add the relevant viewing keys to the wallet otherwise the shielded diff --git a/crates/tests/src/integration/setup.rs b/crates/tests/src/integration/setup.rs index 807c44892d..f23c04c737 100644 --- a/crates/tests/src/integration/setup.rs +++ b/crates/tests/src/integration/setup.rs @@ -31,11 +31,11 @@ use namada_sdk::wallet::alias::Alias; use crate::e2e::setup::copy_wasm_to_chain_dir; /// Env. var for keeping temporary files created by the integration tests -const ENV_VAR_KEEP_TEMP: &str = "NAMADA_INT_KEEP_TEMP"; +pub const ENV_VAR_KEEP_TEMP: &str = "NAMADA_INT_KEEP_TEMP"; /// Setup a network with a single genesis validator node. pub fn setup() -> Result<(MockNode, MockServicesController)> { - initialize_genesis(|genesis| genesis) + initialize_genesis(|genesis| genesis, None) } /// Setup folders with genesis, configs, wasm, etc. @@ -43,6 +43,7 @@ pub fn initialize_genesis( mut update_genesis: impl FnMut( templates::All, ) -> templates::All, + chain_prefix: Option<&str>, ) -> Result<(MockNode, MockServicesController)> { let working_dir = std::fs::canonicalize("../..").unwrap(); let keep_temp = match std::env::var(ENV_VAR_KEEP_TEMP) { @@ -75,7 +76,9 @@ pub fn initialize_genesis( let templates = load_and_validate(&genesis_path) .expect("Missing or invalid genesis files"); let genesis_time = Default::default(); - let chain_id_prefix = ChainIdPrefix::from_str("integration-test").unwrap(); + let chain_id_prefix = + ChainIdPrefix::from_str(chain_prefix.unwrap_or("integration-test")) + .unwrap(); let genesis = config::genesis::chain::finalize( templates, chain_id_prefix.clone(), @@ -143,7 +146,7 @@ pub fn initialize_genesis( /// Add the address from the finalized genesis to the wallet. /// Additionally add the validator keys to the wallet. -fn finalize_wallet( +pub fn finalize_wallet( template_dir: &Path, global_args: &args::Global, genesis: Finalized,