diff --git a/Cargo.lock b/Cargo.lock index 3d7588b5b7..4ae149fa79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -443,6 +443,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + [[package]] name = "base64" version = "0.9.3" @@ -468,6 +474,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64ct" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" + [[package]] name = "bech32" version = "0.8.1" @@ -526,6 +538,27 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitcoin" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42b2a9a8e3c7544f5ce2b475f2f56580a3102b37e0ee001558ad4faedcf56cf4" +dependencies = [ + "bech32", + "bitcoin_hashes", + "secp256k1", + "serde 1.0.145", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "006cc91e1a1d99819bc5b8214be3555c1f0611b169f527a1fdc54ed1f2b745b0" +dependencies = [ + "serde 1.0.145", +] + [[package]] name = "bitflags" version = "1.2.1" @@ -730,6 +763,12 @@ dependencies = [ "syn", ] +[[package]] +name = "bytecount" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" + [[package]] name = "byteorder" version = "1.4.3" @@ -769,6 +808,37 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" +[[package]] +name = "camino" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" +dependencies = [ + "serde 1.0.145", +] + +[[package]] +name = "cargo-platform" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +dependencies = [ + "serde 1.0.145", +] + +[[package]] +name = "cargo_metadata" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.14", + "serde 1.0.145", + "serde_json", +] + [[package]] name = "cc" version = "1.0.73" @@ -960,12 +1030,29 @@ dependencies = [ "windows", ] +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + [[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "contracts" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1d1429e3bd78171c65aa010eabcdf8f863ba3254728dbfb0ad4b1545beac15c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "core-foundation" version = "0.9.3" @@ -1060,6 +1147,16 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "crossbeam-channel" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +dependencies = [ + "crossbeam-utils 0.7.2", + "maybe-uninit", +] + [[package]] name = "crossbeam-channel" version = "0.5.6" @@ -1077,10 +1174,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch", + "crossbeam-epoch 0.9.11", "crossbeam-utils 0.8.12", ] +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +dependencies = [ + "autocfg 1.1.0", + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", + "lazy_static", + "maybe-uninit", + "memoffset 0.5.6", + "scopeguard", +] + [[package]] name = "crossbeam-epoch" version = "0.9.11" @@ -1090,7 +1202,7 @@ dependencies = [ "autocfg 1.1.0", "cfg-if 1.0.0", "crossbeam-utils 0.8.12", - "memoffset", + "memoffset 0.6.5", "scopeguard", ] @@ -1120,6 +1232,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +dependencies = [ + "generic-array 0.14.6", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -1140,6 +1264,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array 0.14.6", + "subtle", +] + [[package]] name = "ct-codecs" version = "1.1.1" @@ -1281,6 +1415,15 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + [[package]] name = "derivative" version = "2.2.0" @@ -1344,6 +1487,27 @@ dependencies = [ "subtle", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[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 0.3.9", +] + [[package]] name = "doc-comment" version = "0.3.3" @@ -1382,6 +1546,18 @@ dependencies = [ "memmap2", ] +[[package]] +name = "ecdsa" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature", +] + [[package]] name = "ed25519" version = "1.5.2" @@ -1429,6 +1605,24 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +[[package]] +name = "elliptic-curve" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "ff", + "generic-array 0.14.6", + "group", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "encoding_rs" version = "0.8.31" @@ -1479,6 +1673,15 @@ dependencies = [ "syn", ] +[[package]] +name = "error-chain" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +dependencies = [ + "version_check 0.9.4", +] + [[package]] name = "escargot" version = "0.5.7" @@ -1590,6 +1793,16 @@ dependencies = [ "serde_bytes", ] +[[package]] +name = "ff" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "file-lock" version = "2.1.6" @@ -1845,8 +2058,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ "cfg-if 1.0.0", + "js-sys", "libc", "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1910,6 +2125,17 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "group" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "group-threshold-cryptography" version = "0.1.0" @@ -1973,6 +2199,12 @@ dependencies = [ "tracing 0.1.37", ] +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + [[package]] name = "hashbrown" version = "0.11.2" @@ -1991,6 +2223,15 @@ dependencies = [ "ahash", ] +[[package]] +name = "hdpath" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dafb09e5d85df264339ad786a147d9de1da13687a3697c52244297e5e7c32d9c" +dependencies = [ + "byteorder", +] + [[package]] name = "hdrhistogram" version = "7.5.2" @@ -2056,7 +2297,17 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" dependencies = [ - "crypto-mac", + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", "digest 0.9.0", ] @@ -2068,7 +2319,7 @@ checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", "generic-array 0.14.6", - "hmac", + "hmac 0.8.1", ] [[package]] @@ -2105,6 +2356,22 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +[[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 1.0.145", +] + [[package]] name = "hyper" version = "0.10.16" @@ -2312,6 +2579,61 @@ dependencies = [ "prost-types", "serde 1.0.145", "tendermint-proto 0.23.6", + "tonic", +] + +[[package]] +name = "ibc-relayer" +version = "0.14.0" +source = "git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2#f4703dfe2c1f25cc431279ab74f10f3e0f6827e2" +dependencies = [ + "anyhow", + "async-stream", + "bech32", + "bitcoin", + "bytes 1.2.1", + "crossbeam-channel 0.5.6", + "dirs-next", + "flex-error", + "futures 0.3.25", + "hdpath", + "hex", + "http", + "humantime", + "humantime-serde", + "ibc 0.14.0 (git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2)", + "ibc-proto 0.17.1 (git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2)", + "itertools", + "k256", + "moka", + "nanoid", + "num-bigint", + "num-rational", + "prost", + "prost-types", + "regex", + "retry", + "ripemd160", + "semver 1.0.14", + "serde 1.0.145", + "serde_derive", + "serde_json", + "sha2 0.10.6", + "signature", + "subtle-encoding", + "tendermint 0.23.6", + "tendermint-light-client", + "tendermint-light-client-verifier 0.23.6", + "tendermint-proto 0.23.6", + "tendermint-rpc 0.23.6", + "thiserror", + "tiny-bip39", + "tiny-keccak", + "tokio", + "toml", + "tonic", + "tracing 0.1.37", + "uint", ] [[package]] @@ -2454,6 +2776,19 @@ dependencies = [ "serde_json", ] +[[package]] +name = "k256" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa", + "elliptic-curve", + "sec1", + "sha2 0.9.9", +] + [[package]] name = "keccak" version = "0.1.2" @@ -2778,6 +3113,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +dependencies = [ + "autocfg 1.1.0", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -2894,7 +3238,29 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "975de676448231fcde04b9149d2543077e166b78fc29eae5aa219e7928410da2" dependencies = [ - "uuid", + "uuid 0.8.2", +] + +[[package]] +name = "moka" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "975fa04238144061e7f8df9746b2e9cd93ef85881da5548d842a7c6a4b614415" +dependencies = [ + "crossbeam-channel 0.5.6", + "crossbeam-epoch 0.8.2", + "crossbeam-utils 0.8.12", + "num_cpus", + "once_cell", + "parking_lot 0.12.1", + "quanta", + "scheduled-thread-pool", + "skeptic", + "smallvec 1.10.0", + "tagptr", + "thiserror", + "triomphe", + "uuid 1.2.1", ] [[package]] @@ -3104,6 +3470,9 @@ dependencies = [ "eyre", "file-serve", "fs_extra", + "ibc 0.14.0 (git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2)", + "ibc-proto 0.17.1 (git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2)", + "ibc-relayer", "itertools", "namada", "namada_apps", @@ -3116,7 +3485,12 @@ dependencies = [ "serde_json", "sha2 0.9.9", "tempfile", + "tendermint 0.23.6", + "tendermint-config 0.23.6", + "tendermint-proto 0.23.6", + "tendermint-rpc 0.23.6", "test-log", + "tokio", "toml", "tracing 0.1.37", "tracing-subscriber 0.3.16", @@ -3154,6 +3528,15 @@ dependencies = [ "thiserror", ] +[[package]] +name = "nanoid" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" +dependencies = [ + "rand 0.8.5", +] + [[package]] name = "native-tls" version = "0.2.10" @@ -3193,7 +3576,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -3206,7 +3589,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -3283,6 +3666,7 @@ dependencies = [ "autocfg 1.1.0", "num-integer", "num-traits 0.2.15", + "serde 1.0.145", ] [[package]] @@ -3336,6 +3720,7 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.15", + "serde 1.0.145", ] [[package]] @@ -3565,6 +3950,15 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac 0.8.0", +] + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -3661,6 +4055,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + [[package]] name = "pkg-config" version = "0.3.25" @@ -3869,6 +4274,17 @@ dependencies = [ "nix 0.21.2", ] +[[package]] +name = "pulldown-cmark" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34f197a544b0c9ab3ae46c359a7ec9cbbb5c7bf97054266fecb7ead794a181d6" +dependencies = [ + "bitflags", + "memchr", + "unicase 2.6.0", +] + [[package]] name = "pwasm-utils" version = "0.18.2" @@ -3880,6 +4296,22 @@ dependencies = [ "parity-wasm", ] +[[package]] +name = "quanta" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e31331286705f455e56cca62e0e717158474ff02b7936c1fa596d983f4ae27" +dependencies = [ + "crossbeam-utils 0.8.12", + "libc", + "mach", + "once_cell", + "raw-cpuid", + "wasi 0.10.0+wasi-snapshot-preview1", + "web-sys", + "winapi 0.3.9", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -4087,6 +4519,15 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "raw-cpuid" +version = "10.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6823ea29436221176fe662da99998ad3b4db2c7f31e7b6f5fe43adccd6320bb" +dependencies = [ + "bitflags", +] + [[package]] name = "rayon" version = "1.5.3" @@ -4105,7 +4546,7 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" dependencies = [ - "crossbeam-channel", + "crossbeam-channel 0.5.6", "crossbeam-deque", "crossbeam-utils 0.8.12", "num_cpus", @@ -4135,6 +4576,17 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.7", + "redox_syscall 0.2.16", + "thiserror", +] + [[package]] name = "regalloc" version = "0.0.31" @@ -4239,6 +4691,23 @@ dependencies = [ "winreg", ] +[[package]] +name = "retry" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac95c60a949a63fd2822f4964939662d8f2c16c4fa0624fd954bc6e703b9a3f6" + +[[package]] +name = "rfc6979" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +dependencies = [ + "crypto-bigint", + "hmac 0.11.0", + "zeroize", +] + [[package]] name = "ring" version = "0.16.20" @@ -4487,6 +4956,15 @@ dependencies = [ "windows-sys 0.36.1", ] +[[package]] +name = "scheduled-thread-pool" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "977a7519bff143a44f842fd07e80ad1329295bd71686457f18e496736f4bf9bf" +dependencies = [ + "parking_lot 0.12.1", +] + [[package]] name = "scopeguard" version = "1.1.0" @@ -4515,6 +4993,38 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "sec1" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" +dependencies = [ + "der", + "generic-array 0.14.6", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26947345339603ae8395f68e2f3d85a6b0a8ddfe6315818e80b8504415099db0" +dependencies = [ + "secp256k1-sys", + "serde 1.0.145", +] + +[[package]] +name = "secp256k1-sys" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "152e20a0fd0519390fc43ab404663af8a0b794273d2a91d60ad4a39f13ffe110" +dependencies = [ + "cc", +] + [[package]] name = "security-framework" version = "2.3.1" @@ -4556,6 +5066,15 @@ dependencies = [ "semver-parser 0.10.2", ] +[[package]] +name = "semver" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +dependencies = [ + "serde 1.0.145", +] + [[package]] name = "semver-parser" version = "0.7.0" @@ -4607,6 +5126,16 @@ dependencies = [ "serde 1.0.145", ] +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde 1.0.145", +] + [[package]] name = "serde_derive" version = "1.0.145" @@ -4773,9 +5302,13 @@ dependencies = [ [[package]] name = "signature" -version = "1.6.4" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +dependencies = [ + "digest 0.9.0", + "rand_core 0.6.4", +] [[package]] name = "simple-error" @@ -4783,6 +5316,21 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc47a29ce97772ca5c927f75bac34866b16d64e07f330c3248e2d7226623901b" +[[package]] +name = "skeptic" +version = "0.13.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" +dependencies = [ + "bytecount", + "cargo_metadata", + "error-chain", + "glob", + "pulldown-cmark", + "tempfile", + "walkdir", +] + [[package]] name = "slab" version = "0.4.7" @@ -4841,6 +5389,16 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -4930,6 +5488,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + [[package]] name = "tar" version = "0.4.38" @@ -5000,10 +5564,12 @@ dependencies = [ "ed25519-dalek", "flex-error", "futures 0.3.25", + "k256", "num-traits 0.2.15", "once_cell", "prost", "prost-types", + "ripemd160", "serde 1.0.145", "serde_bytes", "serde_json", @@ -5043,6 +5609,27 @@ dependencies = [ "url 2.3.1", ] +[[package]] +name = "tendermint-light-client" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=e6c684731f21bffd89886d3e91074b96aee074ba#e6c684731f21bffd89886d3e91074b96aee074ba" +dependencies = [ + "contracts", + "crossbeam-channel 0.4.4", + "derive_more", + "flex-error", + "futures 0.3.25", + "serde 1.0.145", + "serde_cbor", + "serde_derive", + "static_assertions", + "tendermint 0.23.6", + "tendermint-light-client-verifier 0.23.6", + "tendermint-rpc 0.23.6", + "time 0.3.15", + "tokio", +] + [[package]] name = "tendermint-light-client-verifier" version = "0.23.5" @@ -5131,7 +5718,7 @@ dependencies = [ "tokio", "tracing 0.1.37", "url 2.3.1", - "uuid", + "uuid 0.8.2", "walkdir", ] @@ -5164,7 +5751,7 @@ dependencies = [ "tokio", "tracing 0.1.37", "url 2.3.1", - "uuid", + "uuid 0.8.2", "walkdir", ] @@ -5302,6 +5889,34 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tiny_http" version = "0.11.0" @@ -5560,7 +6175,9 @@ dependencies = [ "pin-project", "prost", "prost-derive", + "rustls-native-certs", "tokio", + "tokio-rustls", "tokio-stream", "tokio-util 0.6.10", "tower", @@ -5812,6 +6429,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" +[[package]] +name = "triomphe" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1ee9bd9239c339d714d657fac840c6d2a4f9c45f4f9ec7b0975113458be78db" + [[package]] name = "try-lock" version = "0.2.3" @@ -5855,6 +6478,18 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +[[package]] +name = "uint" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + [[package]] name = "unicase" version = "1.4.2" @@ -5961,6 +6596,15 @@ dependencies = [ "getrandom 0.2.7", ] +[[package]] +name = "uuid" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" +dependencies = [ + "getrandom 0.2.7", +] + [[package]] name = "valuable" version = "0.1.0" @@ -6344,7 +6988,7 @@ dependencies = [ "indexmap", "libc", "loupe", - "memoffset", + "memoffset 0.6.5", "more-asserts", "region", "rkyv", diff --git a/Cargo.toml b/Cargo.toml index 5cfa43de02..dea09bc6d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,11 +40,13 @@ tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} tendermint-testgen = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} +tendermint-light-client = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} tendermint-light-client-verifier = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} # patched to a commit on the `eth-bridge-integration` branch of our fork ibc = {git = "https://github.com/heliaxdev/ibc-rs.git", rev = "f4703dfe2c1f25cc431279ab74f10f3e0f6827e2"} ibc-proto = {git = "https://github.com/heliaxdev/ibc-rs.git", rev = "f4703dfe2c1f25cc431279ab74f10f3e0f6827e2"} +ibc-relayer = {git = "https://github.com/heliaxdev/ibc-rs.git", rev = "f4703dfe2c1f25cc431279ab74f10f3e0f6827e2"} # patched to a commit on the `eth-bridge-integration` branch of our fork tower-abci = {git = "https://github.com/heliaxdev/tower-abci.git", rev = "fcc0014d0bda707109901abfa1b2f782d242f082"} diff --git a/apps/src/bin/anoma-client/cli.rs b/apps/src/bin/anoma-client/cli.rs index 841e4b56ae..8a769a66b1 100644 --- a/apps/src/bin/anoma-client/cli.rs +++ b/apps/src/bin/anoma-client/cli.rs @@ -18,6 +18,9 @@ pub async fn main() -> Result<()> { Sub::TxTransfer(TxTransfer(args)) => { tx::submit_transfer(ctx, args).await; } + Sub::TxIbcTransfer(TxIbcTransfer(args)) => { + tx::submit_ibc_transfer(ctx, args).await; + } Sub::TxUpdateVp(TxUpdateVp(args)) => { tx::submit_update_vp(ctx, args).await; } diff --git a/apps/src/bin/anoma/cli.rs b/apps/src/bin/anoma/cli.rs index 3737f63a8b..35b665a898 100644 --- a/apps/src/bin/anoma/cli.rs +++ b/apps/src/bin/anoma/cli.rs @@ -45,6 +45,7 @@ fn handle_command(cmd: cli::cmds::Anoma, raw_sub_cmd: String) -> Result<()> { cli::cmds::Anoma::Client(_) | cli::cmds::Anoma::TxCustom(_) | cli::cmds::Anoma::TxTransfer(_) + | cli::cmds::Anoma::TxIbcTransfer(_) | cli::cmds::Anoma::TxUpdateVp(_) | cli::cmds::Anoma::TxInitProposal(_) | cli::cmds::Anoma::TxVoteProposal(_) => { diff --git a/apps/src/lib/cli.rs b/apps/src/lib/cli.rs index a3d39ed73e..675e6a58c1 100644 --- a/apps/src/lib/cli.rs +++ b/apps/src/lib/cli.rs @@ -46,6 +46,7 @@ pub mod cmds { // Inlined commands from the client. TxCustom(TxCustom), TxTransfer(TxTransfer), + TxIbcTransfer(TxIbcTransfer), TxUpdateVp(TxUpdateVp), TxInitProposal(TxInitProposal), TxVoteProposal(TxVoteProposal), @@ -59,6 +60,7 @@ pub mod cmds { .subcommand(Ledger::def()) .subcommand(TxCustom::def()) .subcommand(TxTransfer::def()) + .subcommand(TxIbcTransfer::def()) .subcommand(TxUpdateVp::def()) .subcommand(TxInitProposal::def()) .subcommand(TxVoteProposal::def()) @@ -71,6 +73,8 @@ pub mod cmds { let ledger = SubCmd::parse(matches).map(Self::Ledger); let tx_custom = SubCmd::parse(matches).map(Self::TxCustom); let tx_transfer = SubCmd::parse(matches).map(Self::TxTransfer); + let tx_ibc_transfer = + SubCmd::parse(matches).map(Self::TxIbcTransfer); let tx_update_vp = SubCmd::parse(matches).map(Self::TxUpdateVp); let tx_init_proposal = SubCmd::parse(matches).map(Self::TxInitProposal); @@ -81,6 +85,7 @@ pub mod cmds { .or(ledger) .or(tx_custom) .or(tx_transfer) + .or(tx_ibc_transfer) .or(tx_update_vp) .or(tx_init_proposal) .or(tx_vote_proposal) @@ -144,6 +149,7 @@ pub mod cmds { // Simple transactions .subcommand(TxCustom::def().display_order(1)) .subcommand(TxTransfer::def().display_order(1)) + .subcommand(TxIbcTransfer::def().display_order(1)) .subcommand(TxUpdateVp::def().display_order(1)) .subcommand(TxInitAccount::def().display_order(1)) .subcommand(TxInitValidator::def().display_order(1)) @@ -174,6 +180,7 @@ pub mod cmds { use AnomaClientWithContext::*; let tx_custom = Self::parse_with_ctx(matches, TxCustom); let tx_transfer = Self::parse_with_ctx(matches, TxTransfer); + let tx_ibc_transfer = Self::parse_with_ctx(matches, TxIbcTransfer); let tx_update_vp = Self::parse_with_ctx(matches, TxUpdateVp); let tx_init_account = Self::parse_with_ctx(matches, TxInitAccount); let tx_init_validator = @@ -202,6 +209,7 @@ pub mod cmds { let utils = SubCmd::parse(matches).map(Self::WithoutContext); tx_custom .or(tx_transfer) + .or(tx_ibc_transfer) .or(tx_update_vp) .or(tx_init_account) .or(tx_init_validator) @@ -259,6 +267,7 @@ pub mod cmds { // Ledger cmds TxCustom(TxCustom), TxTransfer(TxTransfer), + TxIbcTransfer(TxIbcTransfer), QueryResult(QueryResult), TxUpdateVp(TxUpdateVp), TxInitAccount(TxInitAccount), @@ -781,6 +790,25 @@ pub mod cmds { } } + #[derive(Clone, Debug)] + pub struct TxIbcTransfer(pub args::TxIbcTransfer); + + impl SubCmd for TxIbcTransfer { + const CMD: &'static str = "ibc-transfer"; + + fn parse(matches: &ArgMatches) -> Option { + matches.subcommand_matches(Self::CMD).map(|matches| { + TxIbcTransfer(args::TxIbcTransfer::parse(matches)) + }) + } + + fn def() -> App { + App::new(Self::CMD) + .about("Send a signed IBC transfer transaction.") + .add_args::() + } + } + #[derive(Clone, Debug)] pub struct TxUpdateVp(pub args::TxUpdateVp); @@ -1210,6 +1238,7 @@ pub mod args { use std::path::PathBuf; use std::str::FromStr; + use namada::ibc::core::ics24_host::identifier::{ChannelId, PortId}; use namada::types::address::Address; use namada::types::chain::{ChainId, ChainIdPrefix}; use namada::types::governance::ProposalVote; @@ -1243,6 +1272,7 @@ pub mod args { const CHAIN_ID: Arg = arg("chain-id"); const CHAIN_ID_OPT: ArgOpt = CHAIN_ID.opt(); const CHAIN_ID_PREFIX: Arg = arg("chain-prefix"); + const CHANNEL_ID: Arg = arg("channel-id"); const CODE_PATH: Arg = arg("code-path"); const CODE_PATH_OPT: ArgOpt = CODE_PATH.opt(); const CONSENSUS_TIMEOUT_COMMIT: ArgDefault = arg_default( @@ -1279,6 +1309,10 @@ pub mod args { const MODE: ArgOpt = arg_opt("mode"); const NET_ADDRESS: Arg = arg("net-address"); const OWNER: ArgOpt = arg_opt("owner"); + const PORT_ID: ArgDefault = arg_default( + "port-id", + DefaultFn(|| PortId::from_str("transfer").unwrap()), + ); const PROPOSAL_OFFLINE: ArgFlag = flag("offline"); const PROTOCOL_KEY: ArgOpt = arg_opt("protocol-key"); const PRE_GENESIS_PATH: ArgOpt = arg_opt("pre-genesis-path"); @@ -1289,6 +1323,7 @@ pub mod args { const RAW_ADDRESS: Arg
= arg("address"); const RAW_ADDRESS_OPT: ArgOpt
= RAW_ADDRESS.opt(); const RAW_PUBLIC_KEY_OPT: ArgOpt = arg_opt("public-key"); + const RECEIVER: Arg = arg("receiver"); const REWARDS_CODE_PATH: ArgOpt = arg_opt("rewards-code-path"); const REWARDS_KEY: ArgOpt = arg_opt("rewards-key"); const SCHEME: ArgDefault = @@ -1301,6 +1336,8 @@ pub mod args { const STORAGE_KEY: Arg = arg("storage-key"); const SUB_PREFIX: ArgOpt = arg_opt("sub-prefix"); const TARGET: Arg = arg("target"); + const TIMEOUT_HEIGHT: ArgOpt = arg_opt("timeout-height"); + const TIMEOUT_SEC_OFFSET: ArgOpt = arg_opt("timeout-sec-offset"); const TOKEN_OPT: ArgOpt = TOKEN.opt(); const TOKEN: Arg = arg("token"); const TX_HASH: Arg = arg("tx-hash"); @@ -1476,6 +1513,80 @@ pub mod args { } } + /// IBC transfer transaction arguments + #[derive(Clone, Debug)] + pub struct TxIbcTransfer { + /// Common tx arguments + pub tx: Tx, + /// Transfer source address + pub source: WalletAddress, + /// Transfer target address + pub receiver: String, + /// Transferred token address + pub token: WalletAddress, + /// Transferred token address + pub sub_prefix: Option, + /// Transferred token amount + pub amount: token::Amount, + /// Port ID + pub port_id: PortId, + /// Channel ID + pub channel_id: ChannelId, + /// Timeout height of the destination chain + pub timeout_height: Option, + /// Timeout timestamp offset + pub timeout_sec_offset: Option, + } + + impl Args for TxIbcTransfer { + fn parse(matches: &ArgMatches) -> Self { + let tx = Tx::parse(matches); + let source = SOURCE.parse(matches); + let receiver = RECEIVER.parse(matches); + let token = TOKEN.parse(matches); + let sub_prefix = SUB_PREFIX.parse(matches); + let amount = AMOUNT.parse(matches); + let port_id = PORT_ID.parse(matches); + let channel_id = CHANNEL_ID.parse(matches); + let timeout_height = TIMEOUT_HEIGHT.parse(matches); + let timeout_sec_offset = TIMEOUT_SEC_OFFSET.parse(matches); + Self { + tx, + source, + receiver, + token, + sub_prefix, + amount, + port_id, + channel_id, + timeout_height, + timeout_sec_offset, + } + } + + fn def(app: App) -> App { + app.add_args::() + .arg(SOURCE.def().about( + "The source account address. The source's key is used to \ + produce the signature.", + )) + .arg(RECEIVER.def().about( + "The receiver address on the destination chain as string.", + )) + .arg(TOKEN.def().about("The transfer token.")) + .arg(SUB_PREFIX.def().about("The token's sub prefix.")) + .arg(AMOUNT.def().about("The amount to transfer in decimal.")) + .arg(PORT_ID.def().about("The port ID.")) + .arg(CHANNEL_ID.def().about("The channel ID.")) + .arg( + TIMEOUT_HEIGHT + .def() + .about("The timeout height of the destination chain."), + ) + .arg(TIMEOUT_SEC_OFFSET.def().about("The timeout as seconds.")) + } + } + /// Transaction to initialize a new account #[derive(Clone, Debug)] pub struct TxInitAccount { diff --git a/apps/src/lib/client/rpc.rs b/apps/src/lib/client/rpc.rs index ce6a542897..67b7a013ae 100644 --- a/apps/src/lib/client/rpc.rs +++ b/apps/src/lib/client/rpc.rs @@ -30,12 +30,13 @@ use namada::types::governance::{ VotePower, }; use namada::types::key::*; -use namada::types::storage::{Epoch, Key, KeySeg, PrefixValue}; +use namada::types::storage::{BlockHeight, Epoch, Key, KeySeg, PrefixValue}; use namada::types::token::{balance_key, Amount}; use namada::types::{address, storage, token}; use crate::cli::{self, args, Context}; use crate::client::tendermint_rpc_types::TxResponse; +use crate::facade::tendermint::merkle::proof::Proof; use crate::facade::tendermint_config::net::Address as TendermintAddress; use crate::facade::tendermint_rpc::error::Error as TError; use crate::facade::tendermint_rpc::query::Query; @@ -1295,6 +1296,26 @@ where }) } +/// Query a storage value and the proof without decoding. +pub async fn query_storage_value_bytes( + client: &HttpClient, + key: &storage::Key, + height: Option, + prove: bool, +) -> (Option>, Option) { + let data = None; + let response = unwrap_client_response( + RPC.shell() + .storage_value(client, data, height, prove, key) + .await, + ); + if response.data.is_empty() { + (None, response.proof) + } else { + (Some(response.data), response.proof) + } +} + /// Query a range of storage values with a matching prefix and decode them with /// [`BorshDeserialize`]. Returns an iterator of the storage keys paired with /// their associated values. diff --git a/apps/src/lib/client/tx.rs b/apps/src/lib/client/tx.rs index 0d369ba6b7..c8425e62da 100644 --- a/apps/src/lib/client/tx.rs +++ b/apps/src/lib/client/tx.rs @@ -8,6 +8,12 @@ use async_std::io::prelude::WriteExt; use async_std::io::{self}; use borsh::BorshSerialize; use itertools::Either::*; +use namada::ibc::applications::ics20_fungible_token_transfer::msgs::transfer::MsgTransfer; +use namada::ibc::signer::Signer; +use namada::ibc::timestamp::Timestamp as IbcTimestamp; +use namada::ibc::tx_msg::Msg; +use namada::ibc::Height as IbcHeight; +use namada::ibc_proto::cosmos::base::v1beta1::Coin; use namada::ledger::governance::storage as gov_storage; use namada::ledger::pos::{BondId, Bonds, Unbonds}; use namada::proto::Tx; @@ -16,7 +22,8 @@ use namada::types::governance::{ OfflineProposal, OfflineVote, Proposal, ProposalVote, }; use namada::types::key::*; -use namada::types::storage::Epoch; +use namada::types::storage::{Epoch, RESERVED_ADDRESS_PREFIX}; +use namada::types::time::DateTimeUtc; use namada::types::transaction::governance::{ InitProposalData, VoteProposalData, }; @@ -47,6 +54,7 @@ const TX_INIT_PROPOSAL: &str = "tx_init_proposal.wasm"; const TX_VOTE_PROPOSAL: &str = "tx_vote_proposal.wasm"; const TX_UPDATE_VP_WASM: &str = "tx_update_vp.wasm"; const TX_TRANSFER_WASM: &str = "tx_transfer.wasm"; +const TX_IBC_WASM: &str = "tx_ibc.wasm"; const VP_USER_WASM: &str = "vp_user.wasm"; const TX_BOND_WASM: &str = "tx_bond.wasm"; const TX_UNBOND_WASM: &str = "tx_unbond.wasm"; @@ -460,6 +468,116 @@ pub async fn submit_transfer(ctx: Context, args: args::TxTransfer) { process_tx(ctx, &args.tx, tx, Some(&args.source)).await; } +pub async fn submit_ibc_transfer(ctx: Context, args: args::TxIbcTransfer) { + let source = ctx.get(&args.source); + // Check that the source address exists on chain + let source_exists = + rpc::known_address(&source, args.tx.ledger_address.clone()).await; + if !source_exists { + eprintln!("The source address {} doesn't exist on chain.", source); + if !args.tx.force { + safe_exit(1) + } + } + + // We cannot check the receiver + + let token = ctx.get(&args.token); + // Check that the token address exists on chain + let token_exists = + rpc::known_address(&token, args.tx.ledger_address.clone()).await; + if !token_exists { + eprintln!("The token address {} doesn't exist on chain.", token); + if !args.tx.force { + safe_exit(1) + } + } + // Check source balance + let (sub_prefix, balance_key) = match args.sub_prefix { + Some(sub_prefix) => { + let sub_prefix = storage::Key::parse(sub_prefix).unwrap(); + let prefix = token::multitoken_balance_prefix(&token, &sub_prefix); + ( + Some(sub_prefix), + token::multitoken_balance_key(&prefix, &source), + ) + } + None => (None, token::balance_key(&token, &source)), + }; + let client = HttpClient::new(args.tx.ledger_address.clone()).unwrap(); + match rpc::query_storage_value::(&client, &balance_key).await + { + Some(balance) => { + if balance < args.amount { + eprintln!( + "The balance of the source {} of token {} is lower than \ + the amount to be transferred. Amount to transfer is {} \ + and the balance is {}.", + source, token, args.amount, balance + ); + if !args.tx.force { + safe_exit(1) + } + } + } + None => { + eprintln!( + "No balance found for the source {} of token {}", + source, token + ); + if !args.tx.force { + safe_exit(1) + } + } + } + let tx_code = ctx.read_wasm(TX_IBC_WASM); + + let denom = match sub_prefix { + // To parse IbcToken address, remove the address prefix + Some(sp) => sp.to_string().replace(RESERVED_ADDRESS_PREFIX, ""), + None => token.to_string(), + }; + let token = Some(Coin { + denom, + amount: args.amount.to_string(), + }); + + // this height should be that of the destination chain, not this chain + let timeout_height = match args.timeout_height { + Some(h) => IbcHeight::new(0, h), + None => IbcHeight::zero(), + }; + + let now: namada::tendermint::Time = DateTimeUtc::now().try_into().unwrap(); + let now: IbcTimestamp = now.into(); + let timeout_timestamp = if let Some(offset) = args.timeout_sec_offset { + (now + Duration::new(offset, 0)).unwrap() + } else if timeout_height.is_zero() { + // we cannot set 0 to both the height and the timestamp + (now + Duration::new(3600, 0)).unwrap() + } else { + IbcTimestamp::none() + }; + + let msg = MsgTransfer { + source_port: args.port_id, + source_channel: args.channel_id, + token, + sender: Signer::new(source.to_string()), + receiver: Signer::new(args.receiver), + timeout_height, + timeout_timestamp, + }; + tracing::debug!("IBC transfer message {:?}", msg); + let any_msg = msg.to_any(); + let mut data = vec![]; + prost::Message::encode(&any_msg, &mut data) + .expect("Encoding tx data shouldn't fail"); + + let tx = Tx::new(tx_code, Some(data)); + process_tx(ctx, &args.tx, tx, Some(&args.source)).await; +} + pub async fn submit_init_proposal(mut ctx: Context, args: args::InitProposal) { let file = File::open(&args.proposal_data).expect("File must exist."); let proposal: Proposal = diff --git a/apps/src/lib/client/utils.rs b/apps/src/lib/client/utils.rs index 8848726792..c6cd7c2485 100644 --- a/apps/src/lib/client/utils.rs +++ b/apps/src/lib/client/utils.rs @@ -362,7 +362,7 @@ pub async fn fetch_wasms_aux(base_dir: &Path, chain_id: &ChainId) { const TENDERMINT_NODE_ID_LENGTH: usize = 20; /// Derive Tendermint node ID from public key -fn id_from_pk(pk: &common::PublicKey) -> TendermintNodeId { +pub fn id_from_pk(pk: &common::PublicKey) -> TendermintNodeId { let mut bytes = [0u8; TENDERMINT_NODE_ID_LENGTH]; match pk { diff --git a/apps/src/lib/node/ledger/shell/queries.rs b/apps/src/lib/node/ledger/shell/queries.rs index 0a448af4a2..55df4f81e5 100644 --- a/apps/src/lib/node/ledger/shell/queries.rs +++ b/apps/src/lib/node/ledger/shell/queries.rs @@ -46,14 +46,10 @@ where // Invoke the root RPC handler - returns borsh-encoded data on success let result = namada::ledger::queries::handle_path(ctx, &request); match result { - Ok(ResponseQuery { - data, - info, - proof_ops, - }) => response::Query { + Ok(ResponseQuery { data, info, proof }) => response::Query { value: data, info, - proof_ops, + proof_ops: proof.map(Into::into), ..Default::default() }, Err(err) => response::Query { diff --git a/apps/src/lib/node/ledger/shims/abcipp_shim.rs b/apps/src/lib/node/ledger/shims/abcipp_shim.rs index e919610f8e..bda232f59c 100644 --- a/apps/src/lib/node/ledger/shims/abcipp_shim.rs +++ b/apps/src/lib/node/ledger/shims/abcipp_shim.rs @@ -149,7 +149,6 @@ impl AbcippShim { self.begin_block_request.take().unwrap().into(); let hash = self.get_hash(); end_block_request.hash = BlockHash::from(hash.clone()); - end_block_request.header.hash = hash; end_block_request.txs = txs; self.service .call(Request::FinalizeBlock(end_block_request)) diff --git a/apps/src/lib/node/ledger/shims/abcipp_shim_types.rs b/apps/src/lib/node/ledger/shims/abcipp_shim_types.rs index 5d9f2c420c..b6be70b284 100644 --- a/apps/src/lib/node/ledger/shims/abcipp_shim_types.rs +++ b/apps/src/lib/node/ledger/shims/abcipp_shim_types.rs @@ -249,7 +249,8 @@ pub mod shim { FinalizeBlock { hash: BlockHash::default(), header: Header { - hash: Hash::default(), + hash: Hash::try_from(header.app_hash.as_slice()) + .unwrap_or_default(), time: DateTimeUtc::try_from(header.time.unwrap()) .unwrap(), next_validators_hash: Hash::try_from( diff --git a/shared/src/ledger/ibc/handler.rs b/shared/src/ledger/ibc/handler.rs index 0759077e22..0c76f086eb 100644 --- a/shared/src/ledger/ibc/handler.rs +++ b/shared/src/ledger/ibc/handler.rs @@ -115,6 +115,8 @@ pub enum Error { SendingToken(String), #[error("Receiving a token error: {0}")] ReceivingToken(String), + #[error("IBC storage error: {0}")] + IbcStorage(storage::Error), } // This is needed to use `ibc::Handler::Error` with `IbcActions` in @@ -161,9 +163,8 @@ pub trait IbcActions { /// Transfer token fn transfer_token( &mut self, - src: &Address, - dest: &Address, - token: &Address, + src: &Key, + dest: &Key, amount: Amount, ) -> std::result::Result<(), Self::Error>; @@ -675,9 +676,17 @@ pub trait IbcActions { msg: &MsgRecvPacket, ) -> std::result::Result<(), Self::Error> { // check the packet data - if let Ok(data) = serde_json::from_slice(&msg.packet.data) { - self.receive_token(&msg.packet, &data)?; - } + let packet_ack = + if let Ok(data) = serde_json::from_slice(&msg.packet.data) { + match self.receive_token(&msg.packet, &data) { + Ok(_) => PacketAck::result_success(), + Err(_) => PacketAck::result_error( + "receiving a token failed".to_string(), + ), + } + } else { + PacketAck::result_error("unknown packet data".to_string()) + }; // store the receipt let receipt_key = storage::receipt_key( @@ -693,7 +702,7 @@ pub trait IbcActions { &msg.packet.destination_channel, msg.packet.sequence, ); - let ack = PacketAck::default().encode_to_vec(); + let ack = packet_ack.encode_to_vec(); let ack_commitment = sha2::Sha256::digest(&ack).to_vec(); self.write_ibc_data(&ack_key, ack_commitment)?; @@ -718,6 +727,14 @@ pub trait IbcActions { &mut self, msg: &MsgAcknowledgement, ) -> std::result::Result<(), Self::Error> { + let ack = PacketAck::try_from(msg.acknowledgement.clone()) + .map_err(Error::IbcData)?; + if !ack.is_success() { + if let Ok(data) = serde_json::from_slice(&msg.packet.data) { + self.refund_token(&msg.packet, &data)?; + } + } + let commitment_key = storage::commitment_key( &msg.packet.source_port, &msg.packet.source_channel, @@ -725,6 +742,14 @@ pub trait IbcActions { ); self.delete_ibc_data(&commitment_key)?; + // get and increment the next sequence ack + let port_channel_id = port_channel_id( + msg.packet.source_port.clone(), + msg.packet.source_channel, + ); + let seq_key = storage::next_sequence_ack_key(&port_channel_id); + self.get_and_inc_sequence(&seq_key)?; + let event = make_ack_event(msg.packet.clone()).try_into().unwrap(); self.emit_ibc_event(event)?; @@ -910,26 +935,27 @@ pub trait IbcActions { &mut self, msg: &MsgTransfer, ) -> std::result::Result<(), Self::Error> { - let data = FungibleTokenPacketData::from(msg.clone()); - let source = Address::decode(data.sender.clone()).map_err(|e| { - Error::SendingToken(format!( - "Invalid sender address: sender {}, error {}", - data.sender, e - )) - })?; - let token_str = - data.denomination.split('/').last().ok_or_else(|| { + let mut data = FungibleTokenPacketData::from(msg.clone()); + if let Some(hash) = storage::token_hash_from_denom(&data.denom) + .map_err(Error::IbcStorage)? + { + let denom_key = storage::ibc_denom_key(&hash); + let denom_bytes = + self.read_ibc_data(&denom_key)?.ok_or_else(|| { + Error::SendingToken(format!( + "No original denom: denom_key {}", + denom_key + )) + })?; + let denom = std::str::from_utf8(&denom_bytes).map_err(|e| { Error::SendingToken(format!( - "No token was specified: {}", - data.denomination + "Decoding the denom failed: denom_key {}, error {}", + denom_key, e )) })?; - let token = Address::decode(token_str).map_err(|e| { - Error::SendingToken(format!( - "Invalid token address: token {}, error {}", - token_str, e - )) - })?; + data.denom = denom.to_string(); + } + let token = storage::token(&data.denom).map_err(Error::IbcStorage)?; let amount = Amount::from_str(&data.amount).map_err(|e| { Error::SendingToken(format!( "Invalid amount: amount {}, error {}", @@ -937,25 +963,59 @@ pub trait IbcActions { )) })?; + let source_addr = Address::decode(&data.sender).map_err(|e| { + Error::SendingToken(format!( + "Invalid sender address: sender {}, error {}", + data.sender, e + )) + })?; + // check the denomination field let prefix = format!( "{}/{}/", msg.source_port.clone(), msg.source_channel.clone() ); - if data.denomination.starts_with(&prefix) { - // sink zone - let burn = Address::Internal(InternalAddress::IbcBurn); - self.transfer_token(&source, &burn, &token, amount)?; + let (source, target) = if data.denom.starts_with(&prefix) { + // the receiver's chain was the source + // transfer from the origin-specific account of the token + let key_prefix = storage::ibc_token_prefix(&data.denom) + .map_err(Error::IbcStorage)?; + let src = token::multitoken_balance_key(&key_prefix, &source_addr); + + let key_prefix = storage::ibc_account_prefix( + &msg.source_port, + &msg.source_channel, + &token, + ); + let burn = token::multitoken_balance_key( + &key_prefix, + &Address::Internal(InternalAddress::IbcBurn), + ); + (src, burn) } else { - // source zone - let escrow = - Address::Internal(InternalAddress::ibc_escrow_address( - msg.source_port.to_string(), - msg.source_channel.to_string(), - )); - self.transfer_token(&source, &escrow, &token, amount)?; - } + // this chain is the source + // escrow the amount of the token + let src = if data.denom == token.to_string() { + token::balance_key(&token, &source_addr) + } else { + let key_prefix = storage::ibc_token_prefix(&data.denom) + .map_err(Error::IbcStorage)?; + token::multitoken_balance_key(&key_prefix, &source_addr) + }; + + let key_prefix = storage::ibc_account_prefix( + &msg.source_port, + &msg.source_channel, + &token, + ); + let escrow = token::multitoken_balance_key( + &key_prefix, + &Address::Internal(InternalAddress::IbcEscrow), + ); + (src, escrow) + }; + self.transfer_token(&source, &target, amount)?; // send a packet let port_channel_id = @@ -976,50 +1036,82 @@ pub trait IbcActions { packet: &Packet, data: &FungibleTokenPacketData, ) -> std::result::Result<(), Self::Error> { - let dest = Address::decode(data.receiver.clone()).map_err(|e| { - Error::ReceivingToken(format!( - "Invalid receiver address: receiver {}, error {}", - data.receiver, e - )) - })?; - let token_str = - data.denomination.split('/').last().ok_or_else(|| { - Error::ReceivingToken(format!( - "No token was specified: {}", - data.denomination - )) - })?; - let token = Address::decode(token_str).map_err(|e| { - Error::ReceivingToken(format!( - "Invalid token address: token {}, error {}", - token_str, e - )) - })?; + let token = storage::token(&data.denom).map_err(Error::IbcStorage)?; let amount = Amount::from_str(&data.amount).map_err(|e| { Error::ReceivingToken(format!( "Invalid amount: amount {}, error {}", data.amount, e )) })?; + // The receiver should be an address because the origin-specific account + // key should be assigned internally + let dest_addr = Address::decode(&data.receiver).map_err(|e| { + Error::ReceivingToken(format!( + "Invalid receiver address: receiver {}, error {}", + data.receiver, e + )) + })?; let prefix = format!( "{}/{}/", packet.source_port.clone(), packet.source_channel.clone() ); - if data.denomination.starts_with(&prefix) { - // unescrow the token because this chain is the source - let escrow = - Address::Internal(InternalAddress::ibc_escrow_address( - packet.destination_port.to_string(), - packet.destination_channel.to_string(), - )); - self.transfer_token(&escrow, &dest, &token, amount)?; - } else { - // mint the token because the sender chain is the source - let mint = Address::Internal(InternalAddress::IbcMint); - self.transfer_token(&mint, &dest, &token, amount)?; - } + let (source, target) = match data.denom.strip_prefix(&prefix) { + Some(denom) => { + // unescrow the token because this chain was the source + let escrow_prefix = storage::ibc_account_prefix( + &packet.destination_port, + &packet.destination_channel, + &token, + ); + let escrow = token::multitoken_balance_key( + &escrow_prefix, + &Address::Internal(InternalAddress::IbcEscrow), + ); + let dest = if denom == token.to_string() { + token::balance_key(&token, &dest_addr) + } else { + let key_prefix = storage::ibc_token_prefix(denom) + .map_err(Error::IbcStorage)?; + token::multitoken_balance_key(&key_prefix, &dest_addr) + }; + (escrow, dest) + } + None => { + // mint the token because the sender chain is the source + let key_prefix = storage::ibc_account_prefix( + &packet.destination_port, + &packet.destination_channel, + &token, + ); + let mint = token::multitoken_balance_key( + &key_prefix, + &Address::Internal(InternalAddress::IbcMint), + ); + + // prefix the denom with the this chain port and channel + let denom = format!( + "{}/{}/{}", + &packet.destination_port, + &packet.destination_channel, + &data.denom + ); + let key_prefix = storage::ibc_token_prefix(&denom) + .map_err(Error::IbcStorage)?; + let dest = + token::multitoken_balance_key(&key_prefix, &dest_addr); + + // store the prefixed denom + let token_hash = storage::calc_hash(&denom); + let denom_key = storage::ibc_denom_key(token_hash); + self.write_ibc_data(&denom_key, denom.as_bytes())?; + + (mint, dest) + } + }; + self.transfer_token(&source, &target, amount)?; + Ok(()) } @@ -1029,25 +1121,7 @@ pub trait IbcActions { packet: &Packet, data: &FungibleTokenPacketData, ) -> std::result::Result<(), Self::Error> { - let dest = Address::decode(data.sender.clone()).map_err(|e| { - Error::ReceivingToken(format!( - "Invalid sender address: sender {}, error {}", - data.sender, e - )) - })?; - let token_str = - data.denomination.split('/').last().ok_or_else(|| { - Error::ReceivingToken(format!( - "No token was specified: {}", - data.denomination - )) - })?; - let token = Address::decode(token_str).map_err(|e| { - Error::ReceivingToken(format!( - "Invalid token address: token {}, error {}", - token_str, e - )) - })?; + let token = storage::token(&data.denom).map_err(Error::IbcStorage)?; let amount = Amount::from_str(&data.amount).map_err(|e| { Error::ReceivingToken(format!( "Invalid amount: amount {}, error {}", @@ -1055,24 +1129,56 @@ pub trait IbcActions { )) })?; + let dest_addr = Address::decode(&data.sender).map_err(|e| { + Error::SendingToken(format!( + "Invalid sender address: sender {}, error {}", + data.sender, e + )) + })?; + let prefix = format!( "{}/{}/", packet.source_port.clone(), packet.source_channel.clone() ); - if data.denomination.starts_with(&prefix) { - // mint the token because the sender chain is the sink zone - let mint = Address::Internal(InternalAddress::IbcMint); - self.transfer_token(&mint, &dest, &token, amount)?; + let (source, target) = if data.denom.starts_with(&prefix) { + // mint the token because the amount was burned + let key_prefix = storage::ibc_account_prefix( + &packet.source_port, + &packet.source_channel, + &token, + ); + let mint = token::multitoken_balance_key( + &key_prefix, + &Address::Internal(InternalAddress::IbcMint), + ); + let key_prefix = storage::ibc_token_prefix(&data.denom) + .map_err(Error::IbcStorage)?; + let dest = token::multitoken_balance_key(&key_prefix, &dest_addr); + (mint, dest) } else { - // unescrow the token because the sender chain is the source zone - let escrow = - Address::Internal(InternalAddress::ibc_escrow_address( - packet.source_port.to_string(), - packet.source_channel.to_string(), - )); - self.transfer_token(&escrow, &dest, &token, amount)?; - } + // unescrow the token because the acount was escrowed + let dest = if data.denom == token.to_string() { + token::balance_key(&token, &dest_addr) + } else { + let key_prefix = storage::ibc_token_prefix(&data.denom) + .map_err(Error::IbcStorage)?; + token::multitoken_balance_key(&key_prefix, &dest_addr) + }; + + let key_prefix = storage::ibc_account_prefix( + &packet.source_port, + &packet.source_channel, + &token, + ); + let escrow = token::multitoken_balance_key( + &key_prefix, + &Address::Internal(InternalAddress::IbcEscrow), + ); + (escrow, dest) + }; + self.transfer_token(&source, &target, amount)?; + Ok(()) } } diff --git a/shared/src/ledger/ibc/storage.rs b/shared/src/ledger/ibc/storage.rs index 51cfc8890e..ed47b4c68a 100644 --- a/shared/src/ledger/ibc/storage.rs +++ b/shared/src/ledger/ibc/storage.rs @@ -2,6 +2,7 @@ use std::str::FromStr; +use sha2::{Digest, Sha256}; use thiserror::Error; use crate::ibc::core::ics02_client::height::Height; @@ -16,7 +17,7 @@ use crate::ibc::core::ics24_host::path::{ SeqAcksPath, SeqRecvsPath, SeqSendsPath, }; use crate::ibc::core::ics24_host::Path; -use crate::types::address::{Address, InternalAddress}; +use crate::types::address::{Address, InternalAddress, HASH_LEN}; use crate::types::storage::{self, DbKeySeg, Key, KeySeg}; const CLIENTS_COUNTER: &str = "clients/counter"; @@ -24,6 +25,9 @@ const CONNECTIONS_COUNTER: &str = "connections/counter"; const CHANNELS_COUNTER: &str = "channelEnds/counter"; const CAPABILITIES_INDEX: &str = "capabilities/index"; const CAPABILITIES: &str = "capabilities"; +const DENOM: &str = "denom"; +/// Key segment for a multitoken related to IBC +pub const MULTITOKEN_STORAGE_KEY: &str = "ibc"; #[allow(missing_docs)] #[derive(Error, Debug)] @@ -34,6 +38,8 @@ pub enum Error { InvalidKey(String), #[error("Port capability error: {0}")] InvalidPortCapability(String), + #[error("Denom error: {0}")] + Denom(String), } /// IBC storage functions result @@ -54,6 +60,7 @@ pub enum IbcPrefix { Receipt, Ack, Event, + Denom, Unknown, } @@ -76,6 +83,7 @@ pub fn ibc_prefix(key: &Key) -> Option { "receipts" => IbcPrefix::Receipt, "acks" => IbcPrefix::Ack, "event" => IbcPrefix::Event, + "denom" => IbcPrefix::Denom, _ => IbcPrefix::Unknown, }) } @@ -482,3 +490,82 @@ pub fn capability(key: &Key) -> Result { ))), } } + +/// The storage key to get the denom name from the hashed token +pub fn ibc_denom_key(token_hash: impl AsRef) -> Key { + let path = format!("{}/{}", DENOM, token_hash.as_ref()); + ibc_key(path).expect("Creating a key for the denom key shouldn't fail") +} + +/// Key's prefix for the escrow, burn, or mint account +pub fn ibc_account_prefix( + port_id: &PortId, + channel_id: &ChannelId, + token: &Address, +) -> Key { + Key::from(token.to_db_key()) + .push(&MULTITOKEN_STORAGE_KEY.to_owned()) + .expect("Cannot obtain a storage key") + .push(&port_id.to_string().to_db_key()) + .expect("Cannot obtain a storage key") + .push(&channel_id.to_string().to_db_key()) + .expect("Cannot obtain a storage key") +} + +/// Token address from the denom string +pub fn token(denom: impl AsRef) -> Result
{ + let token_str = denom.as_ref().split('/').last().ok_or_else(|| { + Error::Denom(format!("No token was specified: {}", denom.as_ref())) + })?; + Address::decode(token_str).map_err(|e| { + Error::Denom(format!( + "Invalid token address: token {}, error {}", + token_str, e + )) + }) +} + +/// Get the hash of IBC token address from the denom string +pub fn token_hash_from_denom(denom: impl AsRef) -> Result> { + match denom + .as_ref() + .strip_prefix(&format!("{}/", MULTITOKEN_STORAGE_KEY)) + { + Some(addr_str) => { + let addr = Address::decode(addr_str).map_err(|e| { + Error::Denom(format!( + "Decoding the denom failed: ibc_token {}, error {}", + addr_str, e + )) + })?; + match addr { + Address::Internal(InternalAddress::IbcToken(h)) => Ok(Some(h)), + _ => Err(Error::Denom(format!( + "Unexpected address was given: {}", + addr + ))), + } + } + None => Ok(None), + } +} + +/// Hash the denom +pub fn calc_hash(denom: impl AsRef) -> String { + let mut hasher = Sha256::new(); + hasher.update(denom.as_ref()); + format!("{:.width$x}", hasher.finalize(), width = HASH_LEN) +} + +/// Key's prefix of the received token over IBC +pub fn ibc_token_prefix(denom: impl AsRef) -> Result { + let token = token(&denom)?; + let hash = calc_hash(&denom); + let ibc_token = Address::Internal(InternalAddress::IbcToken(hash)); + let prefix = Key::from(token.to_db_key()) + .push(&MULTITOKEN_STORAGE_KEY.to_owned()) + .expect("Cannot obtain a storage key") + .push(&ibc_token.to_db_key()) + .expect("Cannot obtain a storage key"); + Ok(prefix) +} diff --git a/shared/src/ledger/ibc/vp/denom.rs b/shared/src/ledger/ibc/vp/denom.rs new file mode 100644 index 0000000000..40e95c51c2 --- /dev/null +++ b/shared/src/ledger/ibc/vp/denom.rs @@ -0,0 +1,88 @@ +//! IBC validity predicate for denom + +use thiserror::Error; + +use super::Ibc; +use crate::ledger::ibc::storage; +use crate::ledger::native_vp::VpEnv; +use crate::ledger::storage::{self as ledger_storage, StorageHasher}; +use crate::types::ibc::data::{ + Error as IbcDataError, FungibleTokenPacketData, IbcMessage, +}; +use crate::types::storage::KeySeg; +use crate::vm::WasmCacheAccess; + +#[allow(missing_docs)] +#[derive(Error, Debug)] +pub enum Error { + #[error("Decoding TX data error: {0}")] + DecodingTxData(std::io::Error), + #[error("IBC data error: {0}")] + InvalidIbcData(IbcDataError), + #[error("Invalid packet data: {0}")] + PacketData(String), + #[error("Denom error: {0}")] + Denom(String), +} + +/// IBC channel functions result +pub type Result = std::result::Result; + +impl<'a, DB, H, CA> Ibc<'a, DB, H, CA> +where + DB: 'static + ledger_storage::DB + for<'iter> ledger_storage::DBIter<'iter>, + H: 'static + StorageHasher, + CA: 'static + WasmCacheAccess, +{ + pub(super) fn validate_denom(&self, tx_data: &[u8]) -> Result<()> { + let ibc_msg = IbcMessage::decode(tx_data)?; + let msg = ibc_msg.msg_recv_packet()?; + match serde_json::from_slice::( + &msg.packet.data, + ) { + Ok(data) => { + let denom = format!( + "{}/{}/{}", + &msg.packet.destination_port, + &msg.packet.destination_channel, + &data.denom + ); + let token_hash = storage::calc_hash(&denom); + let denom_key = storage::ibc_denom_key(&token_hash.raw()); + match self.ctx.read_bytes_post(&denom_key) { + Ok(Some(v)) => match std::str::from_utf8(&v) { + Ok(d) if d == denom => Ok(()), + Ok(d) => Err(Error::Denom(format!( + "Mismatch the denom: original {}, denom {}", + denom, d + ))), + Err(e) => Err(Error::Denom(format!( + "Decoding the denom failed: key {}, error {}", + denom_key, e + ))), + }, + _ => Err(Error::Denom(format!( + "Looking up the denom failed: Key {}", + denom_key + ))), + } + } + Err(e) => Err(Error::PacketData(format!( + "unknown packet data: error {}", + e + ))), + } + } +} + +impl From for Error { + fn from(err: IbcDataError) -> Self { + Self::InvalidIbcData(err) + } +} + +impl From for Error { + fn from(err: std::io::Error) -> Self { + Self::DecodingTxData(err) + } +} diff --git a/shared/src/ledger/ibc/vp/mod.rs b/shared/src/ledger/ibc/vp/mod.rs index 6ff04180bb..9e2c03b2d8 100644 --- a/shared/src/ledger/ibc/vp/mod.rs +++ b/shared/src/ledger/ibc/vp/mod.rs @@ -3,6 +3,7 @@ mod channel; mod client; mod connection; +mod denom; mod packet; mod port; mod sequence; @@ -46,6 +47,8 @@ pub enum Error { PacketError(packet::Error), #[error("Sequence validation error: {0}")] SequenceError(sequence::Error), + #[error("Denom validation error: {0}")] + DenomError(denom::Error), #[error("IBC event error: {0}")] IbcEvent(String), #[error("Decoding transaction data error: {0}")] @@ -141,6 +144,7 @@ where } IbcPrefix::Ack => self.validate_ack(key)?, IbcPrefix::Event => {} + IbcPrefix::Denom => self.validate_denom(tx_data)?, IbcPrefix::Unknown => { return Err(Error::KeyError(format!( "Invalid IBC-related key: {}", @@ -288,6 +292,12 @@ impl From for Error { } } +impl From for Error { + fn from(err: denom::Error) -> Self { + Self::DenomError(err) + } +} + /// A dummy header used for testing #[cfg(any(feature = "test", feature = "testing"))] pub fn get_dummy_header() -> crate::types::storage::Header { @@ -1570,7 +1580,7 @@ mod tests { .write(&key, PacketReceipt::default().as_bytes().to_vec()) .expect("write failed"); let key = ack_key(&get_port_id(), &get_channel_id(), sequence); - let ack = PacketAck::default().encode_to_vec(); + let ack = PacketAck::result_success().encode_to_vec(); write_log.write(&key, ack).expect("write failed"); let tx_code = vec![]; @@ -1648,7 +1658,7 @@ mod tests { write_log.commit_block(&mut storage).expect("commit failed"); // prepare data - let ack = PacketAck::default().encode_to_vec(); + let ack = PacketAck::result_success().encode_to_vec(); let proof_packet = CommitmentProofBytes::try_from(vec![0]).unwrap(); let proofs = Proofs::new(proof_packet, None, None, None, Height::new(0, 1)) @@ -1837,7 +1847,7 @@ mod tests { &msg.packet.destination_channel, msg.packet.sequence, ); - let ack = PacketAck::default().encode_to_vec(); + let ack = PacketAck::result_success().encode_to_vec(); write_log.write(&ack_key, ack).expect("write failed"); write_log.commit_tx(); @@ -1886,7 +1896,7 @@ mod tests { .expect("write failed"); let ack_key = ack_key(&get_port_id(), &get_channel_id(), Sequence::from(1)); - let ack = PacketAck::default().encode_to_vec(); + let ack = PacketAck::result_success().encode_to_vec(); write_log.write(&ack_key, ack).expect("write failed"); write_log.commit_tx(); diff --git a/shared/src/ledger/ibc/vp/packet.rs b/shared/src/ledger/ibc/vp/packet.rs index 207727e91c..aafb8890b6 100644 --- a/shared/src/ledger/ibc/vp/packet.rs +++ b/shared/src/ledger/ibc/vp/packet.rs @@ -6,7 +6,8 @@ use super::super::handler::{ self, make_send_packet_event, make_timeout_event, packet_from_message, }; use super::super::storage::{ - port_channel_sequence_id, Error as IbcStorageError, + ibc_denom_key, port_channel_sequence_id, token_hash_from_denom, + Error as IbcStorageError, }; use super::{Ibc, StateChange}; use crate::ibc::core::ics02_client::height::Height; @@ -32,8 +33,11 @@ use crate::ibc::core::ics24_host::identifier::{ }; use crate::ibc::core::ics26_routing::msgs::Ics26Envelope; use crate::ibc::proofs::Proofs; +use crate::ledger::native_vp::VpEnv; use crate::ledger::storage::{self, StorageHasher}; -use crate::types::ibc::data::{Error as IbcDataError, IbcMessage}; +use crate::types::ibc::data::{ + Error as IbcDataError, FungibleTokenPacketData, IbcMessage, +}; use crate::types::storage::Key; use crate::vm::WasmCacheAccess; @@ -64,6 +68,8 @@ pub enum Error { IbcEvent(String), #[error("IBC proof error: {0}")] Proof(String), + #[error("IBC denom error: {0}")] + Denom(String), } /// IBC packet functions result @@ -99,11 +105,12 @@ where let channel = self .channel_end(&(commitment_key.0.clone(), commitment_key.1)) .map_err(|e| Error::InvalidChannel(e.to_string()))?; - let packet = packet_from_message( + let mut packet = packet_from_message( &msg, commitment_key.2, channel.counterparty(), ); + self.update_denom(&mut packet)?; let commitment = self .get_packet_commitment(&commitment_key) .map_err(|_| { @@ -694,6 +701,39 @@ where Ok(()) } } + + fn update_denom(&self, packet: &mut Packet) -> Result<()> { + if let Ok(mut data) = + serde_json::from_slice::(&packet.data) + { + if let Some(token_hash) = token_hash_from_denom(&data.denom) + .map_err(|e| { + Error::Denom(format!("Invalid denom: error {}", e)) + })? + { + let denom_key = ibc_denom_key(&token_hash); + let denom_bytes = match self.ctx.read_bytes_pre(&denom_key) { + Ok(Some(v)) => v, + _ => { + return Err(Error::Denom(format!( + "No original denom: denom_key {}", + denom_key + ))); + } + }; + let denom = std::str::from_utf8(&denom_bytes).map_err(|e| { + Error::Denom(format!( + "Decoding the denom failed: denom_key {}, error {}", + denom_key, e + )) + })?; + data.denom = denom.to_string(); + packet.data = serde_json::to_vec(&data) + .expect("encoding the packet data shouldn't fail"); + } + } + Ok(()) + } } /// The proof for the counterpart channel should be in proofs.other_proof diff --git a/shared/src/ledger/ibc/vp/token.rs b/shared/src/ledger/ibc/vp/token.rs index 06181bdd45..1ef67d4543 100644 --- a/shared/src/ledger/ibc/vp/token.rs +++ b/shared/src/ledger/ibc/vp/token.rs @@ -10,6 +10,7 @@ use crate::ibc::applications::ics20_fungible_token_transfer::msgs::transfer::Msg use crate::ibc::core::ics04_channel::msgs::PacketMsg; use crate::ibc::core::ics04_channel::packet::Packet; use crate::ibc::core::ics26_routing::msgs::Ics26Envelope; +use crate::ledger::ibc::storage as ibc_storage; use crate::ledger::native_vp::{self, Ctx, NativeVp, VpEnv}; use crate::ledger::storage::{self as ledger_storage, StorageHasher}; use crate::proto::SignedTxData; @@ -18,9 +19,7 @@ use crate::types::ibc::data::{ Error as IbcDataError, FungibleTokenPacketData, IbcMessage, }; use crate::types::storage::Key; -use crate::types::token::{ - self, is_non_owner_balance_key, Amount, AmountParseError, -}; +use crate::types::token::{self, Amount, AmountParseError}; use crate::vm::WasmCacheAccess; #[allow(missing_docs)] @@ -32,20 +31,22 @@ pub enum Error { IbcMessage(IbcDataError), #[error("Invalid message error")] InvalidMessage, - #[error("Invalid address error")] + #[error("Invalid address error: {0}")] Address(AddressError), #[error("Token error")] NoToken, - #[error("Parsing amount error")] + #[error("Parsing amount error: {0}")] Amount(AmountParseError), - #[error("Decoding error")] + #[error("Decoding error: {0}")] Decoding(std::io::Error), - #[error("Decoding PacketData error")] + #[error("Decoding PacketData error: {0}")] DecodingPacketData(serde_json::Error), - #[error("Invalid token transfer error")] + #[error("Invalid token transfer error: {0}")] TokenTransfer(String), #[error("IBC message is required as transaction data")] NoTxData, + #[error("Invalid denom error: {0}")] + Denom(String), } /// Result for IBC token VP @@ -85,10 +86,26 @@ where // Check the non-onwer balance updates let keys_changed: HashSet = keys_changed .iter() - .filter(|k| is_non_owner_balance_key(k).is_some()) + .filter(|k| { + matches!( + token::is_any_multitoken_balance_key(k), + Some(( + _, + Address::Internal( + InternalAddress::IbcEscrow + | InternalAddress::IbcBurn + | InternalAddress::IbcMint + ) + )) + ) + }) .cloned() .collect(); - if keys_changed.len() != 1 { + if keys_changed.is_empty() { + // no account is checked by this VP + return Ok(true); + } else if keys_changed.len() > 1 { + // a transaction can update at most 1 special IBC account for now // a transaction can update at most 1 non-owner balance for now return Err(Error::TokenTransfer( "Invalid transfer for multiple non-owner balances".to_owned(), @@ -102,6 +119,9 @@ where Ics26Envelope::Ics4PacketMsg(PacketMsg::RecvPacket(msg)) => { self.validate_receiving_token(&msg.packet) } + Ics26Envelope::Ics4PacketMsg(PacketMsg::AckPacket(msg)) => { + self.validate_refunding_token(&msg.packet) + } Ics26Envelope::Ics4PacketMsg(PacketMsg::ToPacket(msg)) => { self.validate_refunding_token(&msg.packet) } @@ -120,22 +140,78 @@ where CA: 'static + WasmCacheAccess, { fn validate_sending_token(&self, msg: &MsgTransfer) -> Result { - let data = FungibleTokenPacketData::from(msg.clone()); - let token_str = - data.denomination.split('/').last().ok_or(Error::NoToken)?; - let token = Address::decode(token_str).map_err(Error::Address)?; + let mut data = FungibleTokenPacketData::from(msg.clone()); + if let Some(token_hash) = + ibc_storage::token_hash_from_denom(&data.denom).map_err(|e| { + Error::Denom(format!("Invalid denom: error {}", e)) + })? + { + let denom_key = ibc_storage::ibc_denom_key(&token_hash); + let denom_bytes = match self.ctx.read_bytes_pre(&denom_key) { + Ok(Some(v)) => v, + _ => { + return Err(Error::Denom(format!( + "No original denom: denom_key {}", + denom_key + ))); + } + }; + let denom = std::str::from_utf8(&denom_bytes).map_err(|e| { + Error::Denom(format!( + "Decoding the denom failed: denom_key {}, error {}", + denom_key, e + )) + })?; + data.denom = denom.to_string(); + } + let token = ibc_storage::token(&data.denom) + .map_err(|e| Error::Denom(e.to_string()))?; let amount = Amount::from_str(&data.amount).map_err(Error::Amount)?; + let denom = if let Some(denom) = data + .denom + .strip_prefix(&format!("{}/", ibc_storage::MULTITOKEN_STORAGE_KEY)) + { + let denom_key = ibc_storage::ibc_denom_key(&denom); + match self.ctx.read_bytes_pre(&denom_key)? { + Some(v) => std::str::from_utf8(&v) + .map_err(|e| { + Error::TokenTransfer(format!( + "Decoding the denom failed: denom_key {}, error {}", + denom_key, e + )) + })? + .to_string(), + None => { + return Err(Error::TokenTransfer(format!( + "No original denom: denom_key {}", + denom_key + ))); + } + } + } else { + data.denom.clone() + }; + // check the denomination field let prefix = format!( "{}/{}/", msg.source_port.clone(), msg.source_channel.clone() ); - let change = if data.denomination.starts_with(&prefix) { + let key_prefix = ibc_storage::ibc_account_prefix( + &msg.source_port, + &msg.source_channel, + &token, + ); + + let change = if denom.starts_with(&prefix) { // sink zone - let target = Address::Internal(InternalAddress::IbcBurn); - let target_key = token::balance_key(&token, &target); + // check the amount of the token has been burned + let target_key = token::multitoken_balance_key( + &key_prefix, + &Address::Internal(InternalAddress::IbcBurn), + ); let post = try_decode_token_amount( self.ctx.read_bytes_temp(&target_key)?, )? @@ -144,12 +220,11 @@ where post.change() } else { // source zone - let target = - Address::Internal(InternalAddress::ibc_escrow_address( - msg.source_port.to_string(), - msg.source_channel.to_string(), - )); - let target_key = token::balance_key(&token, &target); + // check the amount of the token has been escrowed + let target_key = token::multitoken_balance_key( + &key_prefix, + &Address::Internal(InternalAddress::IbcEscrow), + ); let pre = try_decode_token_amount(self.ctx.read_bytes_pre(&target_key)?)? .unwrap_or_default(); @@ -174,9 +249,8 @@ where let data: FungibleTokenPacketData = serde_json::from_slice(&packet.data) .map_err(Error::DecodingPacketData)?; - let token_str = - data.denomination.split('/').last().ok_or(Error::NoToken)?; - let token = Address::decode(token_str).map_err(Error::Address)?; + let token = ibc_storage::token(&data.denom) + .map_err(|e| Error::Denom(e.to_string()))?; let amount = Amount::from_str(&data.amount).map_err(Error::Amount)?; let prefix = format!( @@ -184,14 +258,18 @@ where packet.source_port.clone(), packet.source_channel.clone() ); - let change = if data.denomination.starts_with(&prefix) { + let key_prefix = ibc_storage::ibc_account_prefix( + &packet.destination_port, + &packet.destination_channel, + &token, + ); + let change = if data.denom.starts_with(&prefix) { // this chain is the source - let source = - Address::Internal(InternalAddress::ibc_escrow_address( - packet.destination_port.to_string(), - packet.destination_channel.to_string(), - )); - let source_key = token::balance_key(&token, &source); + // check the amount of the token has been unescrowed + let source_key = token::multitoken_balance_key( + &key_prefix, + &Address::Internal(InternalAddress::IbcEscrow), + ); let pre = try_decode_token_amount(self.ctx.read_bytes_pre(&source_key)?)? .unwrap_or_default(); @@ -202,8 +280,11 @@ where pre.change() - post.change() } else { // the sender is the source - let source = Address::Internal(InternalAddress::IbcMint); - let source_key = token::balance_key(&token, &source); + // check the amount of the token has been minted + let source_key = token::multitoken_balance_key( + &key_prefix, + &Address::Internal(InternalAddress::IbcMint), + ); let post = try_decode_token_amount( self.ctx.read_bytes_temp(&source_key)?, )? @@ -226,21 +307,27 @@ where let data: FungibleTokenPacketData = serde_json::from_slice(&packet.data) .map_err(Error::DecodingPacketData)?; - let token_str = - data.denomination.split('/').last().ok_or(Error::NoToken)?; + let token_str = data.denom.split('/').last().ok_or(Error::NoToken)?; let token = Address::decode(token_str).map_err(Error::Address)?; let amount = Amount::from_str(&data.amount).map_err(Error::Amount)?; - // check the denomination field + // check the denom field let prefix = format!( "{}/{}/", packet.source_port.clone(), packet.source_channel.clone() ); - let change = if data.denomination.starts_with(&prefix) { + let key_prefix = ibc_storage::ibc_account_prefix( + &packet.source_port, + &packet.source_channel, + &token, + ); + let change = if data.denom.starts_with(&prefix) { // sink zone: mint the token for the refund - let source = Address::Internal(InternalAddress::IbcMint); - let source_key = token::balance_key(&token, &source); + let source_key = token::multitoken_balance_key( + &key_prefix, + &Address::Internal(InternalAddress::IbcMint), + ); let post = try_decode_token_amount( self.ctx.read_bytes_temp(&source_key)?, )? @@ -249,12 +336,10 @@ where Amount::max().change() - post.change() } else { // source zone: unescrow the token for the refund - let source = - Address::Internal(InternalAddress::ibc_escrow_address( - packet.source_port.to_string(), - packet.source_channel.to_string(), - )); - let source_key = token::balance_key(&token, &source); + let source_key = token::multitoken_balance_key( + &key_prefix, + &Address::Internal(InternalAddress::IbcEscrow), + ); let pre = try_decode_token_amount(self.ctx.read_bytes_pre(&source_key)?)? .unwrap_or_default(); diff --git a/shared/src/ledger/protocol/mod.rs b/shared/src/ledger/protocol/mod.rs index 86b2a30290..f0750d3d9d 100644 --- a/shared/src/ledger/protocol/mod.rs +++ b/shared/src/ledger/protocol/mod.rs @@ -339,7 +339,8 @@ where gas_meter = slash_fund.ctx.gas_meter.into_inner(); result } - InternalAddress::IbcEscrow(_) + InternalAddress::IbcToken(_) + | InternalAddress::IbcEscrow | InternalAddress::IbcBurn | InternalAddress::IbcMint => { // validate the transfer diff --git a/shared/src/ledger/queries/mod.rs b/shared/src/ledger/queries/mod.rs index 1c66e3b4aa..22364daf49 100644 --- a/shared/src/ledger/queries/mod.rs +++ b/shared/src/ledger/queries/mod.rs @@ -131,7 +131,7 @@ pub mod tm { tendermint::abci::Code::Ok => Ok(EncodedResponseQuery { data: response.value, info: response.info, - proof_ops: response.proof.map(Into::into), + proof: response.proof, }), tendermint::abci::Code::Err(code) => { Err(Error::Query(response.info, code)) diff --git a/shared/src/ledger/queries/router.rs b/shared/src/ledger/queries/router.rs index 5702d99cac..cd8a265e50 100644 --- a/shared/src/ledger/queries/router.rs +++ b/shared/src/ledger/queries/router.rs @@ -94,7 +94,7 @@ macro_rules! handle_match { return Ok($crate::ledger::queries::EncodedResponseQuery { data, info: Default::default(), - proof_ops: None, + proof: None, }); }; } @@ -414,13 +414,13 @@ macro_rules! pattern_and_handler_to_method { let path = self.storage_value_path( $( $param ),* ); let $crate::ledger::queries::ResponseQuery { - data, info, proof_ops + data, info, proof } = client.request(path, data, height, prove).await?; Ok($crate::ledger::queries::ResponseQuery { data, info, - proof_ops, + proof, }) } } @@ -467,7 +467,7 @@ macro_rules! pattern_and_handler_to_method { let path = self.[<$handle _path>]( $( $param ),* ); let $crate::ledger::queries::ResponseQuery { - data, info, proof_ops + data, info, proof } = client.request(path, data, height, prove).await?; let decoded: $return_type = @@ -476,7 +476,7 @@ macro_rules! pattern_and_handler_to_method { Ok($crate::ledger::queries::ResponseQuery { data: decoded, info, - proof_ops, + proof, }) } } diff --git a/shared/src/ledger/queries/shell.rs b/shared/src/ledger/queries/shell.rs index eabb99b143..54b1e18609 100644 --- a/shared/src/ledger/queries/shell.rs +++ b/shared/src/ledger/queries/shell.rs @@ -1,5 +1,5 @@ use borsh::BorshSerialize; -use tendermint_proto::crypto::{ProofOp, ProofOps}; +use tendermint::merkle::proof::Proof; use crate::ledger::queries::types::{RequestCtx, RequestQuery}; use crate::ledger::queries::{require_latest_height, EncodedResponseQuery}; @@ -83,7 +83,7 @@ where let data = data.try_to_vec().into_storage_result()?; Ok(EncodedResponseQuery { data, - proof_ops: None, + proof: None, info: Default::default(), }) } @@ -138,13 +138,13 @@ where request.height, ) .into_storage_result()?; - Some(proof.into()) + Some(proof) } else { None }; Ok(EncodedResponseQuery { data: value, - proof_ops: proof, + proof, info: Default::default(), }) } @@ -154,13 +154,13 @@ where .storage .get_non_existence_proof(&storage_key, request.height) .into_storage_result()?; - Some(proof.into()) + Some(proof) } else { None }; Ok(EncodedResponseQuery { data: vec![], - proof_ops: proof, + proof, info: format!("No value found for key: {}", storage_key), }) } @@ -186,26 +186,25 @@ where }) .collect(); let data = data?; - let proof_ops = if request.prove { + let proof = if request.prove { let mut ops = vec![]; for PrefixValue { key, value } in &data { - let proof = ctx + let mut proof = ctx .storage .get_existence_proof(key, value.clone().into(), request.height) .into_storage_result()?; - let mut cur_ops: Vec = - proof.ops.into_iter().map(|op| op.into()).collect(); - ops.append(&mut cur_ops); + ops.append(&mut proof.ops); } // ops is not empty in this case - Some(ProofOps { ops }) + let proof = Proof { ops }; + Some(proof) } else { None }; let data = data.try_to_vec().into_storage_result()?; Ok(EncodedResponseQuery { data, - proof_ops, + proof, ..Default::default() }) } diff --git a/shared/src/ledger/queries/types.rs b/shared/src/ledger/queries/types.rs index dbc731705b..806a403322 100644 --- a/shared/src/ledger/queries/types.rs +++ b/shared/src/ledger/queries/types.rs @@ -1,4 +1,4 @@ -use tendermint_proto::crypto::ProofOps; +use tendermint::merkle::proof::Proof; use crate::ledger::storage::{DBIter, Storage, StorageHasher, DB}; use crate::ledger::storage_api; @@ -131,7 +131,7 @@ pub struct ResponseQuery { /// Non-deterministic log of the request execution pub info: String, /// Optional proof - used for storage value reads which request `prove` - pub proof_ops: Option, + pub proof: Option, } /// [`ResponseQuery`] with borsh-encoded `data` field diff --git a/shared/src/ledger/storage/mod.rs b/shared/src/ledger/storage/mod.rs index 636201a187..a87deedfc6 100644 --- a/shared/src/ledger/storage/mod.rs +++ b/shared/src/ledger/storage/mod.rs @@ -1,6 +1,6 @@ //! Ledger's state storage with key-value backed store and a merkle tree -mod ics23_specs; +pub mod ics23_specs; mod merkle_tree; #[cfg(any(test, feature = "testing"))] pub mod mockdb; diff --git a/shared/src/types/address.rs b/shared/src/types/address.rs index 57a9f299cf..069d57b856 100644 --- a/shared/src/types/address.rs +++ b/shared/src/types/address.rs @@ -53,18 +53,20 @@ mod internal { "ano::Proof of Stake "; pub const POS_SLASH_POOL: &str = "ano::Proof of Stake Slash Pool "; - pub const IBC: &str = - "ano::Inter-Blockchain Communication "; pub const PARAMETERS: &str = "ano::Protocol Parameters "; pub const GOVERNANCE: &str = "ano::Governance "; pub const SLASH_FUND: &str = "ano::Slash Fund "; + pub const IBC: &str = + "ibc::Inter-Blockchain Communication "; + pub const IBC_ESCROW: &str = + "ibc::IBC Escrow Address "; pub const IBC_BURN: &str = - "ano::IBC Burn Address "; + "ibc::IBC Burn Address "; pub const IBC_MINT: &str = - "ano::IBC Mint Address "; + "ibc::IBC Mint Address "; pub const ETH_BRIDGE: &str = "ano::ETH Bridge Address "; } @@ -75,6 +77,8 @@ const PREFIX_ESTABLISHED: &str = "est"; const PREFIX_IMPLICIT: &str = "imp"; /// Fixed-length address strings prefix for internal addresses. const PREFIX_INTERNAL: &str = "ano"; +/// Fixed-length address strings prefix for IBC addresses. +const PREFIX_IBC: &str = "ibc"; #[allow(missing_docs)] #[derive(Error, Debug)] @@ -178,7 +182,6 @@ impl Address { InternalAddress::PosSlashPool => { internal::POS_SLASH_POOL.to_string() } - InternalAddress::Ibc => internal::IBC.to_string(), InternalAddress::Parameters => { internal::PARAMETERS.to_string() } @@ -188,8 +191,12 @@ impl Address { InternalAddress::SlashFund => { internal::SLASH_FUND.to_string() } - InternalAddress::IbcEscrow(hash) => { - format!("{}::{}", PREFIX_INTERNAL, hash) + InternalAddress::Ibc => internal::IBC.to_string(), + InternalAddress::IbcToken(hash) => { + format!("{}::{}", PREFIX_IBC, hash) + } + InternalAddress::IbcEscrow => { + internal::IBC_ESCROW.to_string() } InternalAddress::IbcBurn => internal::IBC_BURN.to_string(), InternalAddress::IbcMint => internal::IBC_MINT.to_string(), @@ -232,36 +239,45 @@ impl Address { .map_err(|err| Error::new(ErrorKind::InvalidData, err))?; Ok(Address::Implicit(ImplicitAddress(pkh))) } - Some((PREFIX_INTERNAL, raw)) => match string { + Some((PREFIX_INTERNAL, _)) => match string { internal::POS => Ok(Address::Internal(InternalAddress::PoS)), internal::POS_SLASH_POOL => { Ok(Address::Internal(InternalAddress::PosSlashPool)) } - internal::IBC => Ok(Address::Internal(InternalAddress::Ibc)), internal::PARAMETERS => { Ok(Address::Internal(InternalAddress::Parameters)) } - internal::IBC_BURN => { - Ok(Address::Internal(InternalAddress::IbcBurn)) - } internal::GOVERNANCE => { Ok(Address::Internal(InternalAddress::Governance)) } internal::SLASH_FUND => { Ok(Address::Internal(InternalAddress::SlashFund)) } - internal::IBC_MINT => { - Ok(Address::Internal(InternalAddress::IbcMint)) - } internal::ETH_BRIDGE => { Ok(Address::Internal(InternalAddress::EthBridge)) } + _ => Err(Error::new( + ErrorKind::InvalidData, + "Invalid internal address", + )), + }, + Some((PREFIX_IBC, raw)) => match string { + internal::IBC => Ok(Address::Internal(InternalAddress::Ibc)), + internal::IBC_ESCROW => { + Ok(Address::Internal(InternalAddress::IbcEscrow)) + } + internal::IBC_BURN => { + Ok(Address::Internal(InternalAddress::IbcBurn)) + } + internal::IBC_MINT => { + Ok(Address::Internal(InternalAddress::IbcMint)) + } _ if raw.len() == HASH_LEN => Ok(Address::Internal( - InternalAddress::IbcEscrow(raw.to_string()), + InternalAddress::IbcToken(raw.to_string()), )), _ => Err(Error::new( ErrorKind::InvalidData, - "Invalid internal address", + "Invalid IBC internal address", )), }, _ => Err(Error::new( @@ -437,12 +453,14 @@ pub enum InternalAddress { PoS, /// Proof-of-stake slash pool contains slashed tokens PosSlashPool, - /// Inter-blockchain communication - Ibc, /// Protocol parameters Parameters, + /// Inter-blockchain communication + Ibc, + /// IBC-related token + IbcToken(String), /// Escrow for IBC token transfer - IbcEscrow(String), + IbcEscrow, /// Burn tokens with IBC token transfer IbcBurn, /// Mint tokens from this address with IBC token transfer @@ -456,13 +474,17 @@ pub enum InternalAddress { } impl InternalAddress { - /// Get an escrow address from the port ID and channel ID - pub fn ibc_escrow_address(port_id: String, channel_id: String) -> Self { + /// Get an IBC token address from the port ID and channel ID + pub fn ibc_token_address( + port_id: String, + channel_id: String, + token: &Address, + ) -> Self { let mut hasher = Sha256::new(); - let s = format!("{}/{}", port_id, channel_id); + let s = format!("{}/{}/{}", port_id, channel_id, token); hasher.update(&s); - let hash = format!("{:.width$X}", hasher.finalize(), width = HASH_LEN); - InternalAddress::IbcEscrow(hash) + let hash = format!("{:.width$x}", hasher.finalize(), width = HASH_LEN); + InternalAddress::IbcToken(hash) } } @@ -474,11 +496,12 @@ impl Display for InternalAddress { match self { Self::PoS => "PoS".to_string(), Self::PosSlashPool => "PosSlashPool".to_string(), - Self::Ibc => "IBC".to_string(), Self::Parameters => "Parameters".to_string(), Self::Governance => "Governance".to_string(), Self::SlashFund => "SlashFund".to_string(), - Self::IbcEscrow(hash) => format!("IbcEscrow: {}", hash), + Self::Ibc => "IBC".to_string(), + Self::IbcToken(hash) => format!("IbcToken: {}", hash), + Self::IbcEscrow => "IbcEscrow".to_string(), Self::IbcBurn => "IbcBurn".to_string(), Self::IbcMint => "IbcMint".to_string(), Self::EthBridge => "EthBridge".to_string(), @@ -712,11 +735,12 @@ pub mod testing { match InternalAddress::PoS { InternalAddress::PoS => {} InternalAddress::PosSlashPool => {} - InternalAddress::Ibc => {} InternalAddress::Governance => {} InternalAddress::SlashFund => {} InternalAddress::Parameters => {} - InternalAddress::IbcEscrow(_) => {} + InternalAddress::Ibc => {} + InternalAddress::IbcToken(_) => {} + InternalAddress::IbcEscrow => {} InternalAddress::IbcBurn => {} InternalAddress::IbcMint => {} InternalAddress::EthBridge => {} /* Add new addresses in the @@ -727,8 +751,9 @@ pub mod testing { Just(InternalAddress::PosSlashPool), Just(InternalAddress::Ibc), Just(InternalAddress::Parameters), - arb_port_channel_id() - .prop_map(|(p, c)| InternalAddress::ibc_escrow_address(p, c)), + Just(InternalAddress::Ibc), + arb_ibc_token(), + Just(InternalAddress::IbcEscrow), Just(InternalAddress::IbcBurn), Just(InternalAddress::IbcMint), Just(InternalAddress::Governance), @@ -737,8 +762,20 @@ pub mod testing { ] } - fn arb_port_channel_id() -> impl Strategy { - ("[a-zA-Z0-9_]{2,128}", any::()) - .prop_map(|(id, counter)| (id, format!("channel-{}", counter))) + fn arb_ibc_token() -> impl Strategy { + // use sha2::{Digest, Sha256}; + ("[a-zA-Z0-9_]{2,128}", any::()).prop_map(|(id, counter)| { + let mut hasher = sha2::Sha256::new(); + let s = format!( + "{}/{}/{}", + id, + format_args!("channel-{}", counter), + &nam() + ); + hasher.update(&s); + let hash = + format!("{:.width$x}", hasher.finalize(), width = HASH_LEN); + InternalAddress::IbcToken(hash) + }) } } diff --git a/shared/src/types/ibc/data.rs b/shared/src/types/ibc/data.rs index 4c5d5f2469..947142ab97 100644 --- a/shared/src/types/ibc/data.rs +++ b/shared/src/types/ibc/data.rs @@ -16,7 +16,9 @@ use crate::ibc::core::ics03_connection::msgs::conn_open_confirm::MsgConnectionOp use crate::ibc::core::ics03_connection::msgs::conn_open_init::MsgConnectionOpenInit; use crate::ibc::core::ics03_connection::msgs::conn_open_try::MsgConnectionOpenTry; use crate::ibc::core::ics03_connection::msgs::ConnectionMsg; -use crate::ibc::core::ics04_channel::msgs::acknowledgement::MsgAcknowledgement; +use crate::ibc::core::ics04_channel::msgs::acknowledgement::{ + Acknowledgement, MsgAcknowledgement, +}; use crate::ibc::core::ics04_channel::msgs::chan_close_confirm::MsgChannelCloseConfirm; use crate::ibc::core::ics04_channel::msgs::chan_close_init::MsgChannelCloseInit; use crate::ibc::core::ics04_channel::msgs::chan_open_ack::MsgChannelOpenAck; @@ -32,14 +34,14 @@ use crate::ibc::core::ics26_routing::error::Error as Ics26Error; use crate::ibc::core::ics26_routing::msgs::Ics26Envelope; use crate::ibc::downcast; use crate::ibc_proto::google::protobuf::Any; -use crate::ibc_proto::ibc::core::channel::v1::acknowledgement::Response; -use crate::ibc_proto::ibc::core::channel::v1::Acknowledgement; #[allow(missing_docs)] #[derive(Error, Debug)] pub enum Error { #[error("Decoding IBC data error: {0}")] DecodingData(prost::DecodeError), + #[error("Decoding Json data error: {0}")] + DecodingJsonData(serde_json::Error), #[error("Decoding message error: {0}")] DecodingMessage(Ics26Error), #[error("Downcast error: {0}")] @@ -326,39 +328,70 @@ impl Default for PacketReceipt { } /// Acknowledgement for a packet -#[derive(Clone, Debug)] -pub struct PacketAck(pub Acknowledgement); +#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum PacketAck { + /// Success Acknowledgement + Result(String), + /// Error Acknowledgement + Error(String), +} + +/// Success acknowledgement +const ACK_SUCCESS_B64: &str = "AQ=="; +/// Error acknowledgement +const ACK_ERR_STR: &str = + "error handling packet on destination chain: see events for details"; // TODO temporary type. add a new type for ack to ibc-rs impl PacketAck { + /// Success acknowledgement + pub fn result_success() -> Self { + Self::Result(ACK_SUCCESS_B64.to_string()) + } + + /// Acknowledgement with an error + pub fn result_error(err: String) -> Self { + Self::Error(format!("{}: {}", ACK_ERR_STR, err)) + } + + /// Check if the ack is for success + pub fn is_success(&self) -> bool { + match self { + Self::Result(_) => true, + Self::Error(_) => false, + } + } + /// Encode the ack pub fn encode_to_vec(&self) -> Vec { - serde_json::to_vec(&self.0) + serde_json::to_vec(&self) .expect("Encoding acknowledgement shouldn't fail") } } -impl Default for PacketAck { - fn default() -> Self { - Self(Acknowledgement { - response: Some(Response::Result(vec![1_u8])), - }) +impl TryFrom for PacketAck { + type Error = Error; + + fn try_from(ack: Acknowledgement) -> Result { + serde_json::from_slice(&ack.into_bytes()) + .map_err(Error::DecodingJsonData) } } // for the string to be used by the current reader impl Display for PacketAck { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { - write!(f, "{}", serde_json::to_string(&self.0).unwrap()) + write!(f, "{}", serde_json::to_string(&self).unwrap()) } } -// TODO temporary type. add a new type for ack to ibc-rs +// TODO temporary type. add a new type for packet data to ibc-rs /// Data to transfer a token #[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] pub struct FungibleTokenPacketData { /// the token denomination to be transferred - pub denomination: String, + pub denom: String, /// the token amount to be transferred pub amount: String, /// the sender address @@ -372,7 +405,7 @@ impl From for FungibleTokenPacketData { // TODO validation let token = msg.token.unwrap(); Self { - denomination: token.denom, + denom: token.denom, amount: token.amount, sender: msg.sender.to_string(), receiver: msg.receiver.to_string(), diff --git a/shared/src/types/token.rs b/shared/src/types/token.rs index 787a8855dc..8b811f6de8 100644 --- a/shared/src/types/token.rs +++ b/shared/src/types/token.rs @@ -9,7 +9,7 @@ use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; use serde::{Deserialize, Serialize}; use thiserror::Error; -use crate::types::address::{Address, Error as AddressError, InternalAddress}; +use crate::types::address::{Address, Error as AddressError}; use crate::types::ibc::data::FungibleTokenPacketData; use crate::types::storage::{DbKeySeg, Key, KeySeg}; @@ -302,24 +302,6 @@ pub fn is_any_token_balance_key(key: &Key) -> Option<&Address> { } } -/// Check if the given storage key is non-owner's balance key. If it is, returns -/// the address. -pub fn is_non_owner_balance_key(key: &Key) -> Option<&Address> { - match &key.segments[..] { - [ - DbKeySeg::AddressSeg(_), - DbKeySeg::StringSeg(key), - DbKeySeg::AddressSeg(owner), - ] if key == BALANCE_STORAGE_KEY => match owner { - Address::Internal(InternalAddress::IbcEscrow(_)) - | Address::Internal(InternalAddress::IbcBurn) - | Address::Internal(InternalAddress::IbcMint) => Some(owner), - _ => None, - }, - _ => None, - } -} - /// Check if the given storage key is multitoken balance key for the given /// token. If it is, returns the sub prefix and the owner. pub fn is_multitoken_balance_key<'a>( @@ -411,11 +393,8 @@ impl TryFrom for Transfer { Address::decode(&data.sender).map_err(TransferError::Address)?; let target = Address::decode(&data.receiver).map_err(TransferError::Address)?; - let token_str = data - .denomination - .split('/') - .last() - .ok_or(TransferError::NoToken)?; + let token_str = + data.denom.split('/').last().ok_or(TransferError::NoToken)?; let token = Address::decode(token_str).map_err(TransferError::Address)?; let amount = diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 74056ba00b..cfde6a52ac 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -17,11 +17,19 @@ namada_vp_prelude = {path = "../vp_prelude"} namada_tx_prelude = {path = "../tx_prelude"} chrono = {version = "0.4.22", default-features = false, features = ["clock", "std"]} concat-idents = "1.1.2" +ibc = {version = "0.14.0", default-features = false} +ibc-proto = {version = "0.17.1", default-features = false} +ibc-relayer = {version = "0.14.0", default-features = false} prost = "0.9.0" serde_json = {version = "1.0.65"} sha2 = "0.9.3" test-log = {version = "0.2.7", default-features = false, features = ["trace"]} tempfile = "3.2.0" +tendermint = "0.23.6" +tendermint-config = "0.23.6" +tendermint-proto = "0.23.6" +tendermint-rpc = {version = "0.23.6", features = ["http-client"]} +tokio = {version = "1.8.2", features = ["full"]} tracing = "0.1.30" tracing-subscriber = {version = "0.3.7", default-features = false, features = ["env-filter", "fmt"]} derivative = "2.2.0" diff --git a/tests/src/e2e.rs b/tests/src/e2e.rs index 0afc343098..df177f87dc 100644 --- a/tests/src/e2e.rs +++ b/tests/src/e2e.rs @@ -13,6 +13,7 @@ pub mod eth_bridge_tests; pub mod helpers; +pub mod ibc_tests; pub mod ledger_tests; pub mod setup; pub mod wallet_tests; diff --git a/tests/src/e2e/helpers.rs b/tests/src/e2e/helpers.rs index d0dd60a688..f087ee203d 100644 --- a/tests/src/e2e/helpers.rs +++ b/tests/src/e2e/helpers.rs @@ -13,6 +13,7 @@ use eyre::eyre; use namada::types::address::Address; use namada::types::key::*; use namada::types::storage::Epoch; +use namada_apps::config::genesis::genesis_config; use namada_apps::config::{Config, TendermintMode}; use super::setup::{sleep, Test, ENV_VAR_DEBUG, ENV_VAR_USE_PREBUILT_BINARIES}; @@ -55,6 +56,25 @@ pub fn get_actor_rpc(test: &Test, who: &Who) -> String { config.ledger.tendermint.rpc_address.to_string() } +/// Get the public key of the validator +pub fn get_validator_pk(test: &Test, who: &Who) -> Option { + let index = match who { + Who::NonValidator => return None, + Who::Validator(i) => i, + }; + let file = format!("{}.toml", test.net.chain_id.as_str()); + let path = test.test_dir.path().join(file); + let config = genesis_config::open_genesis_config(path).unwrap(); + let pk = config + .validator + .get(&format!("validator-{}", index)) + .unwrap() + .account_public_key + .as_ref() + .unwrap(); + Some(pk.to_public_key().unwrap()) +} + /// Find the address of an account by its alias from the wallet #[allow(dead_code)] pub fn find_keypair( diff --git a/tests/src/e2e/ibc_tests.rs b/tests/src/e2e/ibc_tests.rs new file mode 100644 index 0000000000..39f9c9f8af --- /dev/null +++ b/tests/src/e2e/ibc_tests.rs @@ -0,0 +1,1431 @@ +//! By default, these tests will run in release mode. This can be disabled +//! by setting environment variable `ANOMA_E2E_DEBUG=true`. For debugging, +//! you'll typically also want to set `RUST_BACKTRACE=1`, e.g.: +//! +//! ```ignore,shell +//! ANOMA_E2E_DEBUG=true RUST_BACKTRACE=1 cargo test e2e::ibc_tests -- --test-threads=1 --nocapture +//! ``` +//! +//! To keep the temporary files created by a test, use env var +//! `ANOMA_E2E_KEEP_TEMP=true`. + +use core::convert::TryFrom; +use core::str::FromStr; +use core::time::Duration; + +use color_eyre::eyre::Result; +use eyre::eyre; +use ibc::clients::ics07_tendermint::client_state::{ + AllowUpdate, ClientState as TmClientState, +}; +use ibc::clients::ics07_tendermint::consensus_state::ConsensusState as TmConsensusState; +use ibc::core::ics02_client::client_consensus::{ + AnyConsensusState, ConsensusState, +}; +use ibc::core::ics02_client::client_state::{AnyClientState, ClientState}; +use ibc::core::ics02_client::header::Header; +use ibc::core::ics02_client::height::Height; +use ibc::core::ics02_client::msgs::create_client::MsgCreateAnyClient; +use ibc::core::ics02_client::msgs::update_client::MsgUpdateAnyClient; +use ibc::core::ics02_client::trust_threshold::TrustThreshold; +use ibc::core::ics03_connection::connection::Counterparty as ConnCounterparty; +use ibc::core::ics03_connection::msgs::conn_open_ack::MsgConnectionOpenAck; +use ibc::core::ics03_connection::msgs::conn_open_confirm::MsgConnectionOpenConfirm; +use ibc::core::ics03_connection::msgs::conn_open_init::MsgConnectionOpenInit; +use ibc::core::ics03_connection::msgs::conn_open_try::MsgConnectionOpenTry; +use ibc::core::ics03_connection::version::Version as ConnVersion; +use ibc::core::ics04_channel::channel::{ + ChannelEnd, Counterparty as ChanCounterparty, Order as ChanOrder, + State as ChanState, +}; +use ibc::core::ics04_channel::msgs::acknowledgement::MsgAcknowledgement; +use ibc::core::ics04_channel::msgs::chan_close_confirm::MsgChannelCloseConfirm; +use ibc::core::ics04_channel::msgs::chan_close_init::MsgChannelCloseInit; +use ibc::core::ics04_channel::msgs::chan_open_ack::MsgChannelOpenAck; +use ibc::core::ics04_channel::msgs::chan_open_confirm::MsgChannelOpenConfirm; +use ibc::core::ics04_channel::msgs::chan_open_init::MsgChannelOpenInit; +use ibc::core::ics04_channel::msgs::chan_open_try::MsgChannelOpenTry; +use ibc::core::ics04_channel::msgs::recv_packet::MsgRecvPacket; +use ibc::core::ics04_channel::msgs::timeout::MsgTimeout; +use ibc::core::ics04_channel::msgs::timeout_on_close::MsgTimeoutOnClose; +use ibc::core::ics04_channel::packet::Packet; +use ibc::core::ics04_channel::Version as ChanVersion; +use ibc::core::ics23_commitment::commitment::CommitmentProofBytes; +use ibc::core::ics23_commitment::merkle::convert_tm_to_ics_merkle_proof; +use ibc::core::ics24_host::identifier::{ + ChainId, ClientId, ConnectionId, PortChannelId, PortId, +}; +use ibc::events::{from_tx_response_event, IbcEvent}; +use ibc::proofs::{ConsensusProof, Proofs}; +use ibc::signer::Signer; +use ibc::tx_msg::Msg; +use ibc_relayer::config::types::{MaxMsgNum, MaxTxSize, Memo}; +use ibc_relayer::config::{AddressType, ChainConfig, GasPrice, PacketFilter}; +use ibc_relayer::keyring::Store; +use ibc_relayer::light_client::tendermint::LightClient as TmLightClient; +use ibc_relayer::light_client::{LightClient, Verified}; +use namada::ledger::ibc::handler::{commitment_prefix, port_channel_id}; +use namada::ledger::ibc::storage::*; +use namada::ledger::storage::ics23_specs::ibc_proof_specs; +use namada::ledger::storage::Sha256Hasher; +use namada::types::address::{Address, InternalAddress}; +use namada::types::key::PublicKey; +use namada::types::storage::{BlockHeight, Key, RESERVED_ADDRESS_PREFIX}; +use namada::types::token::Amount; +use namada_apps::client::rpc::query_storage_value_bytes; +use namada_apps::client::utils::id_from_pk; +use setup::constants::*; +use tendermint::block::Header as TmHeader; +use tendermint::merkle::proof::Proof as TmProof; +use tendermint::trust_threshold::TrustThresholdFraction; +use tendermint_config::net::Address as TendermintAddress; +use tendermint_proto::Protobuf; +use tendermint_rpc::{Client, HttpClient, Url}; +use tokio::runtime::Runtime; + +use crate::e2e::helpers::{find_address, get_actor_rpc, get_validator_pk}; +use crate::e2e::setup::{self, sleep, AnomaCmd, Bin, Test, Who}; +use crate::{run, run_as}; + +#[test] +fn run_ledger_ibc() -> Result<()> { + let (test_a, test_b) = setup::two_single_node_nets()?; + + // Run Chain A + let mut ledger_a = + run_as!(test_a, Who::Validator(0), Bin::Node, &["ledger"], Some(40))?; + ledger_a.exp_string("Anoma ledger node started")?; + // Run Chain B + let mut ledger_b = + run_as!(test_b, Who::Validator(0), Bin::Node, &["ledger"], Some(40))?; + ledger_b.exp_string("Anoma ledger node started")?; + ledger_a.exp_string("This node is a validator")?; + ledger_b.exp_string("This node is a validator")?; + let _bg_ledger_a = ledger_a.background(); + let _bg_ledger_b = ledger_b.background(); + + sleep(5); + + let (client_id_a, client_id_b) = create_client(&test_a, &test_b)?; + + let (conn_id_a, conn_id_b) = + connection_handshake(&test_a, &test_b, &client_id_a, &client_id_b)?; + + let (port_channel_id_a, port_channel_id_b) = channel_handshake( + &test_a, + &test_b, + &client_id_a, + &client_id_b, + &conn_id_a, + &conn_id_b, + )?; + + // Transfer 100000 from the normal account on Chain A to Chain B + transfer_token( + &test_a, + &test_b, + &client_id_a, + &client_id_b, + &port_channel_id_a, + )?; + check_balances(&port_channel_id_a, &port_channel_id_b, &test_a, &test_b)?; + + // Transfer 50000 received over IBC on Chain B + transfer_received_token(&port_channel_id_b, &test_b)?; + check_balances_after_non_ibc(&port_channel_id_b, &test_b)?; + + // Transfer 50000 back from the origin-specific account on Chain B to Chain + // A + transfer_back( + &test_a, + &test_b, + &client_id_a, + &client_id_b, + &port_channel_id_b, + )?; + check_balances_after_back( + &port_channel_id_a, + &port_channel_id_b, + &test_a, + &test_b, + )?; + + // Transfer a token and it will time out and refund + transfer_timeout(&test_a, &test_b, &client_id_a, &port_channel_id_a)?; + // The balance should not be changed + check_balances_after_back( + &port_channel_id_a, + &port_channel_id_b, + &test_a, + &test_b, + )?; + + // Close the channel on Chain A + close_channel_init(&test_a, &port_channel_id_a)?; + + // Try transfer from Chain B and it will refund with TimeoutOnClose + transfer_timeout_on_close( + &test_a, + &test_b, + &client_id_a, + &client_id_b, + &port_channel_id_a, + &port_channel_id_b, + )?; + // The balance should not be changed + check_balances_after_back( + &port_channel_id_a, + &port_channel_id_b, + &test_a, + &test_b, + )?; + + // Close the channel on Chain B + close_channel_confirm( + &test_a, + &test_b, + &client_id_a, + &client_id_b, + &port_channel_id_a, + &port_channel_id_b, + )?; + + // Check a transfer will fail + try_transfer_on_close(&test_a, &test_b, &port_channel_id_a)?; + + Ok(()) +} + +fn create_client(test_a: &Test, test_b: &Test) -> Result<(ClientId, ClientId)> { + let height = query_height(test_b)?; + let client_state = make_client_state(test_b, height); + let height = client_state.latest_height(); + let message = MsgCreateAnyClient { + client_state, + consensus_state: make_consensus_state(test_b, height)?, + signer: Signer::new("test_a"), + }; + let height_a = submit_ibc_tx(test_a, message, ALBERT)?; + + let height = query_height(test_a)?; + let client_state = make_client_state(test_a, height); + let height = client_state.latest_height(); + let message = MsgCreateAnyClient { + client_state, + consensus_state: make_consensus_state(test_a, height)?, + signer: Signer::new("test_b"), + }; + let height_b = submit_ibc_tx(test_b, message, ALBERT)?; + + let client_id_a = match get_event(test_a, height_a)? { + Some(IbcEvent::CreateClient(event)) => event.client_id().clone(), + _ => return Err(eyre!("Transaction failed")), + }; + let client_id_b = match get_event(test_b, height_b)? { + Some(IbcEvent::CreateClient(event)) => event.client_id().clone(), + _ => return Err(eyre!("Transaction failed")), + }; + + // `client_id_a` represents the ID of the B's client on Chain A + Ok((client_id_a, client_id_b)) +} + +fn make_client_state(test: &Test, height: Height) -> AnyClientState { + let unbonding_period = Duration::new(1814400, 0); + let trusting_period = 2 * unbonding_period / 3; + let max_clock_drift = Duration::new(60, 0); + let chain_id = ChainId::from_str(test.net.chain_id.as_str()).unwrap(); + TmClientState::new( + chain_id, + TrustThreshold::default(), + trusting_period, + unbonding_period, + max_clock_drift, + height, + ibc_proof_specs::().into(), + vec!["upgrade".to_string(), "upgradedIBCState".to_string()], + AllowUpdate { + after_expiry: true, + after_misbehaviour: true, + }, + ) + .unwrap() + .wrap_any() +} + +fn make_consensus_state( + test: &Test, + height: Height, +) -> Result { + let header = query_header(test, height)?; + Ok(TmConsensusState::from(header).wrap_any()) +} + +fn update_client_with_height( + src_test: &Test, + target_test: &Test, + target_client_id: &ClientId, + target_height: Height, +) -> Result<()> { + // check the current(stale) state on the target chain + let key = client_state_key(target_client_id); + let (value, _) = query_value_with_proof(target_test, &key, target_height)?; + let client_state = match value { + Some(v) => AnyClientState::decode_vec(&v) + .map_err(|e| eyre!("Decoding the client state failed: {}", e))?, + None => { + return Err(eyre!( + "The client state doesn't exist: client ID {}", + target_client_id + )); + } + }; + let trusted_height = client_state.latest_height(); + + update_client( + src_test, + target_test, + target_client_id, + trusted_height, + target_height, + &client_state, + ) +} + +fn update_client( + src_test: &Test, + target_test: &Test, + client_id: &ClientId, + trusted_height: Height, + target_height: Height, + client_state: &AnyClientState, +) -> Result<()> { + let config = dummy_chain_config(src_test); + let pk = get_validator_pk(src_test, &Who::Validator(0)).unwrap(); + let peer_id = id_from_pk(&PublicKey::try_from_pk(&pk).unwrap()); + let mut light_client = + TmLightClient::from_config(&config, peer_id).unwrap(); + let Verified { target, supporting } = light_client + .header_and_minimal_set(trusted_height, target_height, client_state) + .map_err(|e| eyre!("Building the header failed: {}", e))?; + + for header in supporting { + let message = MsgUpdateAnyClient { + header: header.wrap_any(), + client_id: client_id.clone(), + signer: Signer::new("test"), + }; + submit_ibc_tx(target_test, message, ALBERT)?; + } + + let message = MsgUpdateAnyClient { + header: target.wrap_any(), + client_id: client_id.clone(), + signer: Signer::new("test"), + }; + submit_ibc_tx(target_test, message, ALBERT)?; + + Ok(()) +} + +fn dummy_chain_config(test: &Test) -> ChainConfig { + let addr = format!("http://{}", get_actor_rpc(test, &Who::Validator(0))); + let rpc_addr = Url::from_str(&addr).unwrap(); + // use only id and rpc_addr + ChainConfig { + id: ChainId::new(test.net.chain_id.as_str().to_string(), 0), + rpc_addr: rpc_addr.clone(), + websocket_addr: rpc_addr.clone(), + grpc_addr: rpc_addr, + rpc_timeout: Duration::new(10, 0), + account_prefix: "dummy".to_string(), + key_name: "dummy".to_string(), + key_store_type: Store::default(), + store_prefix: "dummy".to_string(), + default_gas: None, + max_gas: None, + gas_adjustment: None, + fee_granter: None, + max_msg_num: MaxMsgNum::default(), + max_tx_size: MaxTxSize::default(), + clock_drift: Duration::new(5, 0), + max_block_time: Duration::new(5, 0), + trusting_period: None, + memo_prefix: Memo::default(), + proof_specs: ibc_proof_specs::().into(), + trust_threshold: TrustThresholdFraction::ONE_THIRD, + gas_price: GasPrice::new(0.0, "dummy".to_string()), + packet_filter: PacketFilter::default(), + address_type: AddressType::Cosmos, + } +} + +fn connection_handshake( + test_a: &Test, + test_b: &Test, + client_id_a: &ClientId, + client_id_b: &ClientId, +) -> Result<(ConnectionId, ConnectionId)> { + let msg = MsgConnectionOpenInit { + client_id: client_id_a.clone(), + counterparty: ConnCounterparty::new( + client_id_b.clone(), + None, + commitment_prefix(), + ), + version: Some(ConnVersion::default()), + delay_period: Duration::new(1, 0), + signer: Signer::new("test_a"), + }; + // OpenInitConnection on Chain A + let height = submit_ibc_tx(test_a, msg, ALBERT)?; + let conn_id_a = match get_event(test_a, height)? { + Some(IbcEvent::OpenInitConnection(event)) => event + .connection_id() + .clone() + .ok_or(eyre!("No connection ID is set"))?, + _ => return Err(eyre!("Transaction failed")), + }; + + // get the proofs from Chain A + let height_a = query_height(test_a)?; + let (client_state, proofs) = + get_connection_proofs(test_a, client_id_a, &conn_id_a, height_a)?; + let counterparty = ConnCounterparty::new( + client_id_a.clone(), + Some(conn_id_a.clone()), + commitment_prefix(), + ); + let msg = MsgConnectionOpenTry { + previous_connection_id: None, + client_id: client_id_b.clone(), + client_state: Some(client_state), + counterparty, + counterparty_versions: vec![ConnVersion::default()], + proofs, + delay_period: Duration::new(1, 0), + signer: Signer::new("test_b"), + }; + // Update the client state of Chain A on Chain B + update_client_with_height(test_a, test_b, client_id_b, height_a)?; + // OpenTryConnection on Chain B + let height = submit_ibc_tx(test_b, msg, ALBERT)?; + let conn_id_b = match get_event(test_b, height)? { + Some(IbcEvent::OpenTryConnection(event)) => event + .connection_id() + .clone() + .ok_or(eyre!("No connection ID is set"))?, + _ => return Err(eyre!("Transaction failed")), + }; + + // get the A's proofs on Chain B + let height_b = query_height(test_b)?; + let (client_state, proofs) = + get_connection_proofs(test_b, client_id_b, &conn_id_b, height_b)?; + let msg = MsgConnectionOpenAck { + connection_id: conn_id_a.clone(), + counterparty_connection_id: conn_id_b.clone(), + client_state: Some(client_state), + proofs, + version: ConnVersion::default(), + signer: Signer::new("test_a"), + }; + // Update the client state of Chain B on Chain A + update_client_with_height(test_b, test_a, client_id_a, height_b)?; + // OpenAckConnection on Chain A + submit_ibc_tx(test_a, msg, ALBERT)?; + + // get the proofs on Chain A + let height_a = query_height(test_a)?; + let (_, proofs) = + get_connection_proofs(test_a, client_id_a, &conn_id_a, height_a)?; + let msg = MsgConnectionOpenConfirm { + connection_id: conn_id_b.clone(), + proofs, + signer: Signer::new("test_b"), + }; + // Update the client state of Chain A on Chain B + update_client_with_height(test_a, test_b, client_id_b, height_a)?; + // OpenConfirmConnection on Chain B + submit_ibc_tx(test_b, msg, ALBERT)?; + + Ok((conn_id_a, conn_id_b)) +} + +// get the proofs on the target height +fn get_connection_proofs( + test: &Test, + client_id: &ClientId, + conn_id: &ConnectionId, + target_height: Height, +) -> Result<(AnyClientState, Proofs)> { + // we need proofs at the height of the previous block + let query_height = target_height.decrement().unwrap(); + let key = connection_key(conn_id); + let (_, tm_proof) = query_value_with_proof(test, &key, query_height)?; + let connection_proof = convert_proof(tm_proof)?; + + let (client_state, client_state_proof, consensus_proof) = + get_client_states(test, client_id, query_height)?; + + let proofs = Proofs::new( + connection_proof, + Some(client_state_proof), + Some(consensus_proof), + None, + target_height, + ) + .map_err(|e| eyre!("Creating proofs failed: error {}", e))?; + + Ok((client_state, proofs)) +} + +fn channel_handshake( + test_a: &Test, + test_b: &Test, + client_id_a: &ClientId, + client_id_b: &ClientId, + conn_id_a: &ConnectionId, + conn_id_b: &ConnectionId, +) -> Result<(PortChannelId, PortChannelId)> { + // OpenInitChannel on Chain A + let port_id = PortId::from_str("test_port").unwrap(); + let counterparty = ChanCounterparty::new(port_id.clone(), None); + let channel = ChannelEnd::new( + ChanState::Init, + ChanOrder::Unordered, + counterparty, + vec![conn_id_a.clone()], + ChanVersion::ics20(), + ); + let msg = MsgChannelOpenInit { + port_id: port_id.clone(), + channel, + signer: Signer::new("test_a"), + }; + let height = submit_ibc_tx(test_a, msg, ALBERT)?; + let channel_id_a = + match get_event(test_a, height)? { + Some(IbcEvent::OpenInitChannel(event)) => event + .channel_id() + .cloned() + .ok_or(eyre!("No channel ID is set"))?, + _ => return Err(eyre!("Transaction failed")), + }; + let port_channel_id_a = port_channel_id(port_id.clone(), channel_id_a); + + // get the proofs from Chain A + let height_a = query_height(test_a)?; + let proofs = + get_channel_proofs(test_a, client_id_a, &port_channel_id_a, height_a)?; + let counterparty = + ChanCounterparty::new(port_id.clone(), Some(channel_id_a)); + let channel = ChannelEnd::new( + ChanState::TryOpen, + ChanOrder::Unordered, + counterparty, + vec![conn_id_b.clone()], + ChanVersion::ics20(), + ); + let msg = MsgChannelOpenTry { + port_id: port_id.clone(), + previous_channel_id: None, + channel, + counterparty_version: ChanVersion::ics20(), + proofs, + signer: Signer::new("test_b"), + }; + // Update the client state of Chain A on Chain B + update_client_with_height(test_a, test_b, client_id_b, height_a)?; + // OpenTryChannel on Chain B + let height = submit_ibc_tx(test_b, msg, ALBERT)?; + let channel_id_b = match get_event(test_b, height)? { + Some(IbcEvent::OpenTryChannel(event)) => event + .channel_id() + .cloned() + .ok_or(eyre!("No channel ID is set"))?, + _ => return Err(eyre!("Transaction failed")), + }; + let port_channel_id_b = port_channel_id(port_id.clone(), channel_id_b); + + // get the A's proofs on Chain B + let height_b = query_height(test_b)?; + let proofs = + get_channel_proofs(test_b, client_id_b, &port_channel_id_b, height_b)?; + let msg = MsgChannelOpenAck { + port_id: port_id.clone(), + channel_id: channel_id_a, + counterparty_channel_id: channel_id_b, + counterparty_version: ChanVersion::ics20(), + proofs, + signer: Signer::new("test_a"), + }; + // Update the client state of Chain B on Chain A + update_client_with_height(test_b, test_a, client_id_a, height_b)?; + // OpenAckChannel on Chain A + submit_ibc_tx(test_a, msg, ALBERT)?; + + // get the proofs on Chain A + let height_a = query_height(test_a)?; + let proofs = + get_channel_proofs(test_a, client_id_a, &port_channel_id_a, height_a)?; + let msg = MsgChannelOpenConfirm { + port_id, + channel_id: channel_id_b, + proofs, + signer: Signer::new("test_b"), + }; + // Update the client state of Chain A on Chain B + update_client_with_height(test_a, test_b, client_id_b, height_a)?; + // OpenConfirmChannel on Chain B + submit_ibc_tx(test_b, msg, ALBERT)?; + + Ok((port_channel_id_a, port_channel_id_b)) +} + +fn close_channel_init( + test: &Test, + port_channel_id: &PortChannelId, +) -> Result<()> { + let msg = MsgChannelCloseInit { + port_id: port_channel_id.port_id.clone(), + channel_id: port_channel_id.channel_id, + signer: Signer::new("test"), + }; + // CloseInitChannel on Chain A + submit_ibc_tx(test, msg, ALBERT)?; + + Ok(()) +} + +fn close_channel_confirm( + test_a: &Test, + test_b: &Test, + client_id_a: &ClientId, + client_id_b: &ClientId, + port_channel_id_a: &PortChannelId, + port_channel_id_b: &PortChannelId, +) -> Result<()> { + // get the proofs on Chain A + let height_a = query_height(test_a)?; + let proofs = + get_channel_proofs(test_a, client_id_a, port_channel_id_a, height_a)?; + let msg = MsgChannelCloseConfirm { + port_id: port_channel_id_b.port_id.clone(), + channel_id: port_channel_id_b.channel_id, + proofs, + signer: Signer::new("test_b"), + }; + // Update the client state of Chain A on Chain B + update_client_with_height(test_a, test_b, client_id_b, height_a)?; + // CloseConfirmChannel on Chain B + submit_ibc_tx(test_b, msg, ALBERT)?; + + Ok(()) +} + +fn get_channel_proofs( + test: &Test, + client_id: &ClientId, + port_channel_id: &PortChannelId, + target_height: Height, +) -> Result { + // we need proofs at the height of the previous block + let query_height = target_height.decrement().unwrap(); + let key = channel_key(port_channel_id); + let (_, tm_proof) = query_value_with_proof(test, &key, query_height)?; + let proof = convert_proof(tm_proof)?; + + let (_, client_state_proof, consensus_proof) = + get_client_states(test, client_id, query_height)?; + + Proofs::new( + proof, + Some(client_state_proof), + Some(consensus_proof), + None, + target_height, + ) + .map_err(|e| eyre!("Creating proofs failed: error {}", e)) +} + +// get the client state, the proof of the client state, and the proof of the +// consensus state +fn get_client_states( + test: &Test, + client_id: &ClientId, + target_height: Height, // should have been already decremented +) -> Result<(AnyClientState, CommitmentProofBytes, ConsensusProof)> { + let key = client_state_key(client_id); + let (value, tm_proof) = query_value_with_proof(test, &key, target_height)?; + let client_state = match value { + Some(v) => AnyClientState::decode_vec(&v) + .map_err(|e| eyre!("Decoding the client state failed: {}", e))?, + None => { + return Err(eyre!( + "The client state doesn't exist: client ID {}", + client_id + )); + } + }; + let client_state_proof = convert_proof(tm_proof)?; + + let height = client_state.latest_height(); + let key = consensus_state_key(client_id, height); + let (_, tm_proof) = query_value_with_proof(test, &key, target_height)?; + let proof = convert_proof(tm_proof)?; + let consensus_proof = ConsensusProof::new(proof, height) + .map_err(|e| eyre!("Creating ConsensusProof failed: error {}", e))?; + + Ok((client_state, client_state_proof, consensus_proof)) +} + +fn transfer_token( + test_a: &Test, + test_b: &Test, + client_id_a: &ClientId, + client_id_b: &ClientId, + port_channel_id_a: &PortChannelId, +) -> Result<()> { + // Send a token from Chain A + let receiver = find_address(test_b, BERTHA)?; + let height = transfer( + test_a, + ALBERT, + &receiver, + NAM, + &Amount::from(100000_f64), + port_channel_id_a, + None, + None, + )?; + let packet = match get_event(test_a, height)? { + Some(IbcEvent::SendPacket(event)) => event.packet, + _ => return Err(eyre!("Transaction failed")), + }; + + let height_a = query_height(test_a)?; + let proofs = get_commitment_proof(test_a, &packet, height_a)?; + let msg = MsgRecvPacket { + packet, + proofs, + signer: Signer::new("test_b"), + }; + // Update the client state of Chain A on Chain B + update_client_with_height(test_a, test_b, client_id_b, height_a)?; + // Receive the token on Chain B + let height = submit_ibc_tx(test_b, msg, ALBERT)?; + let (acknowledgement, packet) = match get_event(test_b, height)? { + Some(IbcEvent::WriteAcknowledgement(event)) => { + (event.ack, event.packet) + } + _ => return Err(eyre!("Transaction failed")), + }; + + // get the proof on Chain B + let height_b = query_height(test_b)?; + let proofs = get_ack_proof(test_b, &packet, height_b)?; + let msg = MsgAcknowledgement { + packet, + acknowledgement: acknowledgement.into(), + proofs, + signer: Signer::new("test_a"), + }; + // Update the client state of Chain B on Chain A + update_client_with_height(test_b, test_a, client_id_a, height_b)?; + // Acknowledge on Chain A + submit_ibc_tx(test_a, msg, ALBERT)?; + + Ok(()) +} + +fn transfer_received_token( + port_channel_id: &PortChannelId, + test: &Test, +) -> Result<()> { + let xan = find_address(test, NAM)?; + // token received via the port and channel + let denom = format!( + "{}/{}/{}", + port_channel_id.port_id, port_channel_id.channel_id, xan + ); + let sub_prefix = ibc_token_prefix(denom) + .unwrap() + .sub_key() + .unwrap() + .to_string(); + + let rpc = get_actor_rpc(test, &Who::Validator(0)); + let tx_args = [ + "transfer", + "--source", + BERTHA, + "--target", + ALBERT, + "--token", + NAM, + "--sub-prefix", + &sub_prefix, + "--amount", + "50000", + "--fee-amount", + "0", + "--gas-limit", + "0", + "--fee-token", + NAM, + "--ledger-address", + &rpc, + ]; + let mut client = run!(test, Bin::Client, tx_args, Some(40))?; + client.exp_string("Transaction is valid.")?; + client.assert_success(); + + Ok(()) +} + +/// Give the token back after transfer_token +fn transfer_back( + test_a: &Test, + test_b: &Test, + client_id_a: &ClientId, + client_id_b: &ClientId, + port_channel_id_b: &PortChannelId, +) -> Result<()> { + let xan = find_address(test_b, NAM)?.to_string(); + let receiver = find_address(test_a, ALBERT)?; + + // Chain A was the source for the sent token + let denom_raw = format!( + "{}/{}/{}", + port_channel_id_b.port_id, port_channel_id_b.channel_id, xan + ); + let hash = calc_hash(&denom_raw); + let ibc_token = Address::Internal(InternalAddress::IbcToken(hash)); + // Need the address prefix for ibc-transfer command + let sub_prefix = format!( + "{}/{}{}", + MULTITOKEN_STORAGE_KEY, RESERVED_ADDRESS_PREFIX, ibc_token + ); + // Send a token from Chain B + let height = transfer( + test_b, + BERTHA, + &receiver, + NAM, + &Amount::from(50000_f64), + port_channel_id_b, + Some(sub_prefix), + None, + )?; + let packet = match get_event(test_b, height)? { + Some(IbcEvent::SendPacket(event)) => event.packet, + _ => return Err(eyre!("Transaction failed")), + }; + + let height_b = query_height(test_b)?; + let proofs = get_commitment_proof(test_b, &packet, height_b)?; + let msg = MsgRecvPacket { + packet, + proofs, + signer: Signer::new("test_a"), + }; + // Update the client state of Chain B on Chain A + update_client_with_height(test_b, test_a, client_id_a, height_b)?; + // Receive the token on Chain A + let height = submit_ibc_tx(test_a, msg, ALBERT)?; + let (acknowledgement, packet) = match get_event(test_a, height)? { + Some(IbcEvent::WriteAcknowledgement(event)) => { + (event.ack, event.packet) + } + _ => return Err(eyre!("Transaction failed")), + }; + + // get the proof on Chain A + let height_a = query_height(test_a)?; + let proofs = get_ack_proof(test_a, &packet, height_a)?; + let msg = MsgAcknowledgement { + packet, + acknowledgement: acknowledgement.into(), + proofs, + signer: Signer::new("test_b"), + }; + // Update the client state of Chain A on Chain B + update_client_with_height(test_a, test_b, client_id_b, height_a)?; + // Acknowledge on Chain B + submit_ibc_tx(test_b, msg, ALBERT)?; + + Ok(()) +} + +fn transfer_timeout( + test_a: &Test, + test_b: &Test, + client_id_a: &ClientId, + port_channel_id_a: &PortChannelId, +) -> Result<()> { + let receiver = find_address(test_b, BERTHA)?; + + // Send a token from Chain A + let height = transfer( + test_a, + ALBERT, + &receiver, + NAM, + &Amount::from(100000_f64), + port_channel_id_a, + None, + Some(Duration::new(5, 0)), + )?; + let packet = match get_event(test_a, height)? { + Some(IbcEvent::SendPacket(event)) => event.packet, + _ => return Err(eyre!("Transaction failed")), + }; + + // wait for the timeout + sleep(5); + + let height_b = query_height(test_b)?; + let proofs = get_receipt_absence_proof(test_b, &packet, height_b)?; + let msg = MsgTimeout { + next_sequence_recv: packet.sequence, + packet, + proofs, + signer: Signer::new("test_a"), + }; + // Update the client state of Chain B on Chain A + update_client_with_height(test_b, test_a, client_id_a, height_b)?; + // Timeout on Chain A + submit_ibc_tx(test_a, msg, ALBERT)?; + + Ok(()) +} + +fn transfer_timeout_on_close( + test_a: &Test, + test_b: &Test, + client_id_a: &ClientId, + client_id_b: &ClientId, + port_channel_id_a: &PortChannelId, + port_channel_id_b: &PortChannelId, +) -> Result<()> { + let receiver = find_address(test_a, ALBERT)?; + + // Send a token from Chain B + let height = transfer( + test_b, + BERTHA, + &receiver, + NAM, + &Amount::from(100000_f64), + port_channel_id_b, + None, + None, + )?; + let packet = match get_event(test_b, height)? { + Some(IbcEvent::SendPacket(event)) => event.packet, + _ => return Err(eyre!("Transaction failed")), + }; + + // get the proof for the receipt and the channel on Chain A + let height_a = query_height(test_a)?; + let proofs_receipt = get_receipt_absence_proof(test_a, &packet, height_a)?; + let proofs_closed = + get_channel_proofs(test_a, client_id_a, port_channel_id_a, height_a)?; + let proofs = Proofs::new( + proofs_receipt.object_proof().clone(), + proofs_closed.client_proof().clone(), + proofs_closed.consensus_proof(), + Some(proofs_closed.object_proof().clone()), + proofs_receipt.height(), + ) + .unwrap(); + let msg = MsgTimeoutOnClose { + next_sequence_recv: packet.sequence, + packet, + proofs, + signer: Signer::new("test_b"), + }; + // Update the client state of Chain A on Chain B + update_client_with_height(test_a, test_b, client_id_b, height_a)?; + // TimeoutOnClose on Chain B + submit_ibc_tx(test_b, msg, ALBERT)?; + + Ok(()) +} + +fn try_transfer_on_close( + test_a: &Test, + test_b: &Test, + port_channel_id_a: &PortChannelId, +) -> Result<()> { + let receiver = find_address(test_b, BERTHA)?; + // Send a token from Chain A + match transfer( + test_a, + ALBERT, + &receiver, + NAM, + &Amount::from(100000_f64), + port_channel_id_a, + None, + None, + ) { + Ok(_) => Err(eyre!( + "Sending a token succeeded in spite of closing the channel" + )), + Err(_) => Ok(()), + } +} + +fn get_commitment_proof( + test: &Test, + packet: &Packet, + target_height: Height, +) -> Result { + // we need proofs at the height of the previous block + let query_height = target_height.decrement().unwrap(); + let key = commitment_key( + &packet.source_port, + &packet.source_channel, + packet.sequence, + ); + let (_, tm_proof) = query_value_with_proof(test, &key, query_height)?; + let commitment_proof = convert_proof(tm_proof)?; + + Proofs::new(commitment_proof, None, None, None, target_height) + .map_err(|e| eyre!("Creating proofs failed: error {}", e)) +} + +fn get_ack_proof( + test: &Test, + packet: &Packet, + target_height: Height, +) -> Result { + // we need proofs at the height of the previous block + let query_height = target_height.decrement().unwrap(); + let key = ack_key( + &packet.destination_port, + &packet.destination_channel, + packet.sequence, + ); + let (_, tm_proof) = query_value_with_proof(test, &key, query_height)?; + let ack_proof = convert_proof(tm_proof)?; + + Proofs::new(ack_proof, None, None, None, target_height) + .map_err(|e| eyre!("Creating proofs failed: error {}", e)) +} + +fn get_receipt_absence_proof( + test: &Test, + packet: &Packet, + target_height: Height, +) -> Result { + // we need proofs at the height of the previous block + let query_height = target_height.decrement().unwrap(); + let key = receipt_key( + &packet.destination_port, + &packet.destination_channel, + packet.sequence, + ); + let (_, tm_proof) = query_value_with_proof(test, &key, query_height)?; + let absence_proof = convert_proof(tm_proof)?; + + Proofs::new(absence_proof, None, None, None, target_height) + .map_err(|e| eyre!("Creating proofs failed: error {}", e)) +} + +fn submit_ibc_tx( + test: &Test, + message: impl Msg + std::fmt::Debug, + signer: &str, +) -> Result { + let data_path = test.test_dir.path().join("tx.data"); + let data = make_ibc_data(message); + std::fs::write(&data_path, data).expect("writing data failed"); + + let code_path = wasm_abs_path(TX_IBC_WASM); + let code_path = code_path.to_string_lossy(); + let data_path = data_path.to_string_lossy(); + let rpc = get_actor_rpc(test, &Who::Validator(0)); + let mut client = run!( + test, + Bin::Client, + [ + "tx", + "--code-path", + &code_path, + "--data-path", + &data_path, + "--signer", + signer, + "--fee-amount", + "0", + "--gas-limit", + "0", + "--fee-token", + NAM, + "--ledger-address", + &rpc + ], + Some(40) + )?; + client.exp_string("Transaction applied")?; + check_tx_height(test, &mut client) +} + +#[allow(clippy::too_many_arguments)] +fn transfer( + test: &Test, + sender: impl AsRef, + receiver: &Address, + token: impl AsRef, + amount: &Amount, + port_channel_id: &PortChannelId, + sub_prefix: Option, + timeout_sec: Option, +) -> Result { + let rpc = get_actor_rpc(test, &Who::Validator(0)); + + let receiver = receiver.to_string(); + let amount = amount.to_string(); + let port_id = port_channel_id.port_id.to_string(); + let channel_id = port_channel_id.channel_id.to_string(); + let mut tx_args = vec![ + "ibc-transfer", + "--source", + sender.as_ref(), + "--receiver", + &receiver, + "--signer", + sender.as_ref(), + "--token", + token.as_ref(), + "--amount", + &amount, + "--channel-id", + &channel_id, + "--port-id", + &port_id, + "--ledger-address", + &rpc, + ]; + let sp = sub_prefix.clone().unwrap_or_default(); + if sub_prefix.is_some() { + tx_args.push("--sub-prefix"); + tx_args.push(&sp); + } + let timeout = timeout_sec.unwrap_or_default().as_secs().to_string(); + if timeout_sec.is_some() { + tx_args.push("--timeout-sec-offset"); + tx_args.push(&timeout); + } + + let mut client = run!(test, Bin::Client, tx_args, Some(40))?; + client.exp_string("Transaction applied")?; + check_tx_height(test, &mut client) +} + +fn check_tx_height(test: &Test, client: &mut AnomaCmd) -> Result { + let (unread, matched) = client.exp_regex("\"height\": .*,")?; + let height_str = matched + .trim() + .rsplit_once(' ') + .unwrap() + .1 + .replace('"', "") + .replace(',', ""); + let height = height_str.parse().unwrap(); + + let (_unread, matched) = client.exp_regex("\"code\": .*,")?; + let code = matched + .trim() + .rsplit_once(' ') + .unwrap() + .1 + .replace('"', "") + .replace(',', ""); + if code != "0" { + return Err(eyre!( + "The IBC transfer transaction failed: unread {}", + unread + )); + } + + // wait for the next block to use the app hash + while height as u64 + 1 > query_height(test)?.revision_height { + sleep(1); + } + + Ok(height) +} + +fn make_ibc_data(message: impl Msg) -> Vec { + let msg = message.to_any(); + let mut tx_data = vec![]; + prost::Message::encode(&msg, &mut tx_data) + .expect("encoding IBC message shouldn't fail"); + tx_data +} + +fn query_height(test: &Test) -> Result { + let rpc = get_actor_rpc(test, &Who::Validator(0)); + let ledger_address = TendermintAddress::from_str(&rpc).unwrap(); + let client = HttpClient::new(ledger_address).unwrap(); + let rt = Runtime::new().unwrap(); + + let status = rt + .block_on(client.status()) + .map_err(|e| eyre!("Getting the status failed: {}", e))?; + + Ok(Height::new(0, status.sync_info.latest_block_height.into())) +} + +fn query_header(test: &Test, height: Height) -> Result { + let rpc = get_actor_rpc(test, &Who::Validator(0)); + let ledger_address = TendermintAddress::from_str(&rpc).unwrap(); + let client = HttpClient::new(ledger_address).unwrap(); + let height = height.revision_height as u32; + let result = Runtime::new() + .unwrap() + .block_on(client.blockchain(height, height)); + match result { + Ok(mut response) => match response.block_metas.pop() { + Some(meta) => Ok(meta.header), + None => Err(eyre!("No meta exists")), + }, + Err(e) => Err(eyre!("Header query failed: {}", e)), + } +} + +fn get_event(test: &Test, height: u32) -> Result> { + let rpc = get_actor_rpc(test, &Who::Validator(0)); + let ledger_address = TendermintAddress::from_str(&rpc).unwrap(); + let client = HttpClient::new(ledger_address).unwrap(); + + let response = Runtime::new() + .unwrap() + .block_on(client.block_results(height)) + .map_err(|e| eyre!("block_results() for an IBC event failed: {}", e))?; + let tx_results = response.txs_results.ok_or_else(|| { + eyre!("No transaction has been executed: height {}", height) + })?; + for result in tx_results { + if result.code.is_err() { + return Err(eyre!( + "The transaction failed: code {:?}, log {}", + result.code, + result.log + )); + } + } + let events = response + .end_block_events + .ok_or_else(|| eyre!("IBC event was not found: height {}", height))?; + for event in &events { + // The height will be set, but not be used + let dummy_height = Height::new(0, 0); + match from_tx_response_event(dummy_height, event) { + Some(ibc_event) => return Ok(Some(ibc_event)), + None => continue, + } + } + // No IBC event was found + Ok(None) +} + +fn query_value_with_proof( + test: &Test, + key: &Key, + height: Height, +) -> Result<(Option>, TmProof)> { + let rpc = get_actor_rpc(test, &Who::Validator(0)); + let ledger_address = TendermintAddress::from_str(&rpc).unwrap(); + let client = HttpClient::new(ledger_address).unwrap(); + let result = Runtime::new().unwrap().block_on(query_storage_value_bytes( + &client, + key, + Some(BlockHeight(height.revision_height)), + true, + )); + match result { + (value, Some(proof)) => Ok((value, proof)), + _ => Err(eyre!("Query failed: key {}", key)), + } +} + +fn convert_proof(tm_proof: TmProof) -> Result { + let merkle_proof = convert_tm_to_ics_merkle_proof(&tm_proof) + .map_err(|e| eyre!("Proof conversion to MerkleProof failed: {}", e))?; + CommitmentProofBytes::try_from(merkle_proof).map_err(|e| { + eyre!("Proof conversion to CommitmentProofBytes failed: {}", e) + }) +} + +/// Check balances after IBC transfer +fn check_balances( + src_port_channel_id: &PortChannelId, + dest_port_channel_id: &PortChannelId, + test_a: &Test, + test_b: &Test, +) -> Result<()> { + let token = find_address(test_a, NAM)?; + + // Check the balances on Chain A + let rpc_a = get_actor_rpc(test_a, &Who::Validator(0)); + let query_args = + vec!["balance", "--token", NAM, "--ledger-address", &rpc_a]; + let mut client = run!(test_a, Bin::Client, query_args, Some(40))?; + // Check the source balance + let expected = ": 900000, owned by albert".to_string(); + client.exp_string(&expected)?; + // Check the escrowed balance + let key_prefix = ibc_account_prefix( + &src_port_channel_id.port_id, + &src_port_channel_id.channel_id, + &token, + ); + let sub_prefix = key_prefix.sub_key().unwrap().to_string(); + let expected = format!( + "with {}: 100000, owned by {}", + sub_prefix, + Address::Internal(InternalAddress::IbcEscrow) + ); + client.exp_string(&expected)?; + client.assert_success(); + + // Check the balance on Chain B + let denom = format!( + "{}/{}/{}", + &dest_port_channel_id.port_id, &dest_port_channel_id.channel_id, &token, + ); + let key_prefix = ibc_token_prefix(&denom)?; + let sub_prefix = key_prefix.sub_key().unwrap().to_string(); + let rpc_b = get_actor_rpc(test_b, &Who::Validator(0)); + let query_args = vec![ + "balance", + "--owner", + BERTHA, + "--token", + NAM, + "--sub-prefix", + &sub_prefix, + "--ledger-address", + &rpc_b, + ]; + let expected = format!("NAM with {}: 100000", sub_prefix); + let mut client = run!(test_b, Bin::Client, query_args, Some(40))?; + client.exp_string(&expected)?; + client.assert_success(); + Ok(()) +} + +/// Check balances after non IBC transfer +fn check_balances_after_non_ibc( + port_channel_id: &PortChannelId, + test: &Test, +) -> Result<()> { + // Check the balance on Chain B + let token = find_address(test, NAM)?; + let denom = format!( + "{}/{}/{}", + port_channel_id.port_id, port_channel_id.channel_id, token + ); + let key_prefix = ibc_token_prefix(denom)?; + let sub_prefix = key_prefix.sub_key().unwrap().to_string(); + + // Check the source + let rpc = get_actor_rpc(test, &Who::Validator(0)); + let query_args = vec![ + "balance", + "--owner", + BERTHA, + "--token", + NAM, + "--sub-prefix", + &sub_prefix, + "--ledger-address", + &rpc, + ]; + let expected = format!("NAM with {}: 50000", sub_prefix); + let mut client = run!(test, Bin::Client, query_args, Some(40))?; + client.exp_string(&expected)?; + client.assert_success(); + + // Check the traget + let query_args = vec![ + "balance", + "--owner", + ALBERT, + "--token", + NAM, + "--sub-prefix", + &sub_prefix, + "--ledger-address", + &rpc, + ]; + let expected = format!("NAM with {}: 50000", sub_prefix); + let mut client = run!(test, Bin::Client, query_args, Some(40))?; + client.exp_string(&expected)?; + client.assert_success(); + + Ok(()) +} + +/// Check balances after IBC transfer back +fn check_balances_after_back( + src_port_channel_id: &PortChannelId, + dest_port_channel_id: &PortChannelId, + test_a: &Test, + test_b: &Test, +) -> Result<()> { + let token = find_address(test_b, NAM)?; + + // Check the balances on Chain A + let rpc_a = get_actor_rpc(test_a, &Who::Validator(0)); + let query_args = + vec!["balance", "--token", NAM, "--ledger-address", &rpc_a]; + let mut client = run!(test_a, Bin::Client, query_args, Some(40))?; + // Check the source balance + let expected = ": 950000, owned by albert".to_string(); + client.exp_string(&expected)?; + // Check the escrowed balance + let key_prefix = ibc_account_prefix( + &src_port_channel_id.port_id, + &src_port_channel_id.channel_id, + &token, + ); + let sub_prefix = key_prefix.sub_key().unwrap().to_string(); + let expected = format!( + "with {}: 50000, owned by {}", + sub_prefix, + Address::Internal(InternalAddress::IbcEscrow) + ); + client.exp_string(&expected)?; + client.assert_success(); + + // Check the balance on Chain B + let denom = format!( + "{}/{}/{}", + &dest_port_channel_id.port_id, &dest_port_channel_id.channel_id, &token, + ); + let key_prefix = ibc_token_prefix(&denom)?; + let sub_prefix = key_prefix.sub_key().unwrap().to_string(); + let rpc_b = get_actor_rpc(test_b, &Who::Validator(0)); + let query_args = vec![ + "balance", + "--owner", + BERTHA, + "--token", + NAM, + "--sub-prefix", + &sub_prefix, + "--ledger-address", + &rpc_b, + ]; + let expected = format!("NAM with {}: 0", sub_prefix); + let mut client = run!(test_b, Bin::Client, query_args, Some(40))?; + client.exp_string(&expected)?; + client.assert_success(); + Ok(()) +} diff --git a/tests/src/e2e/setup.rs b/tests/src/e2e/setup.rs index 3d6ff5e951..0e9ff75811 100644 --- a/tests/src/e2e/setup.rs +++ b/tests/src/e2e/setup.rs @@ -57,6 +57,9 @@ pub struct Network { pub chain_id: ChainId, } +/// Offset the ports used in the network configuration to avoid shared resources +pub const ANOTHER_CHAIN_PORT_OFFSET: u16 = 1001; + /// Add `num` validators to the genesis config. Note that called from inside /// the [`network`]'s first argument's closure, there is 1 validator already /// present to begin with, so e.g. `add_validators(1, _)` will configure a @@ -89,8 +92,28 @@ pub fn single_node_net() -> Result { network(|genesis| genesis, None) } +/// Setup two networks with a single genesis validator node. +pub fn two_single_node_nets() -> Result<(Test, Test)> { + Ok(( + network(|genesis| genesis, None)?, + network(set_another_address, None)?, + )) +} + +fn set_another_address(mut genesis: GenesisConfig) -> GenesisConfig { + let validator_0 = genesis.validator.get_mut("validator-0").unwrap(); + let mut net_address_0 = + SocketAddr::from_str(validator_0.net_address.as_ref().unwrap()) + .unwrap(); + let current_port = net_address_0.port(); + net_address_0.set_port(current_port + ANOTHER_CHAIN_PORT_OFFSET); + validator_0.net_address = Some(net_address_0.to_string()); + genesis +} + +/// Setup a configurable network. pub fn network( - update_genesis: impl Fn(GenesisConfig) -> GenesisConfig, + mut update_genesis: impl FnMut(GenesisConfig) -> GenesisConfig, consensus_timeout_commit: Option<&'static str>, ) -> Result { INIT.call_once(|| { @@ -783,6 +806,7 @@ pub mod constants { pub const TX_INIT_PROPOSAL: &str = "wasm_for_tests/tx_init_proposal.wasm"; pub const TX_WRITE_STORAGE_KEY_WASM: &str = "wasm_for_tests/tx_write_storage_key.wasm"; + pub const TX_IBC_WASM: &str = "wasm/tx_ibc.wasm"; pub const VP_ALWAYS_TRUE_WASM: &str = "wasm_for_tests/vp_always_true.wasm"; pub const VP_ALWAYS_FALSE_WASM: &str = "wasm_for_tests/vp_always_false.wasm"; diff --git a/tests/src/vm_host_env/ibc.rs b/tests/src/vm_host_env/ibc.rs index 9a8ead4be7..4b21e97b79 100644 --- a/tests/src/vm_host_env/ibc.rs +++ b/tests/src/vm_host_env/ibc.rs @@ -64,8 +64,8 @@ use namada::ledger::tx_env::TxEnv; use namada::proto::Tx; use namada::tendermint_proto::Protobuf; use namada::types::address::{self, Address, InternalAddress}; -use namada::types::ibc::data::FungibleTokenPacketData; -use namada::types::storage::{self, BlockHash, BlockHeight}; +use namada::types::ibc::data::{FungibleTokenPacketData, PacketAck}; +use namada::types::storage::{self, BlockHash, BlockHeight, Key}; use namada::types::token::{self, Amount}; use namada::vm::{wasm, WasmCacheRwAccess}; use namada_tx_prelude::StorageWrite; @@ -146,16 +146,16 @@ pub fn validate_ibc_vp_from_tx<'a>( pub fn validate_token_vp_from_tx<'a>( tx_env: &'a TestTxEnv, tx: &'a Tx, - addr: &Address, + target: &Key, ) -> std::result::Result { let (verifiers, keys_changed) = tx_env .write_log .verifiers_and_changed_keys(&tx_env.verifiers); - if !verifiers.contains(addr) { + if !keys_changed.contains(target) { panic!( - "The given token address {} isn't part of the tx verifiers set: \ + "The given target address {} isn't part of the tx verifiers set: \ {:#?}", - addr, verifiers + target, keys_changed, ); } let (vp_wasm_cache, _vp_cache_dir) = @@ -176,40 +176,6 @@ pub fn validate_token_vp_from_tx<'a>( TestIbcTokenVp { token }.validate(tx.data.as_ref().unwrap()) } -// /// Initialize the native token VP for the given address -// pub fn init_token_vp_from_tx<'a>( -// tx_env: &'a TestTxEnv, -// tx: &'a Tx, -// addr: &Address, -// ) -> (TestIbcTokenVp<'a>, TempDir) { -// let (verifiers, keys_changed) = tx_env -// .write_log -// .verifiers_and_changed_keys(&tx_env.verifiers); -// if !verifiers.contains(addr) { -// panic!( -// "The given token address {} isn't part of the tx verifiers set: \ -// {:#?}", -// addr, verifiers -// ); -// } -// let (vp_wasm_cache, vp_cache_dir) = -// wasm::compilation_cache::common::testing::cache(); - -// let ctx = Ctx::new( -// &ADDRESS, -// &tx_env.storage, -// &tx_env.write_log, -// tx, -// VpGasMeter::new(0), -// &keys_changed, -// &verifiers, -// vp_wasm_cache, -// ); -// let token = IbcToken { ctx }; - -// (TestIbcTokenVp { token }, vp_cache_dir) -// } - /// Initialize the test storage. Requires initialized [`tx_host_env::ENV`]. pub fn init_storage() -> (Address, Address) { tx_host_env::with(|env| { @@ -584,7 +550,7 @@ pub fn msg_packet_recv(packet: Packet) -> MsgRecvPacket { pub fn msg_packet_ack(packet: Packet) -> MsgAcknowledgement { MsgAcknowledgement { packet, - acknowledgement: vec![0].into(), + acknowledgement: PacketAck::result_success().encode_to_vec().into(), proofs: dummy_proofs(), signer: Signer::new("test"), } @@ -601,7 +567,7 @@ pub fn received_packet( let timeout_timestamp = (Timestamp::now() + Duration::from_secs(100)).unwrap(); let data = FungibleTokenPacketData { - denomination: token, + denom: token, amount: 100u64.to_string(), sender: address::testing::gen_established_address().to_string(), receiver: receiver.to_string(), diff --git a/tests/src/vm_host_env/mod.rs b/tests/src/vm_host_env/mod.rs index 3325c6eb6a..c44cc25c2e 100644 --- a/tests/src/vm_host_env/mod.rs +++ b/tests/src/vm_host_env/mod.rs @@ -23,6 +23,7 @@ mod tests { use itertools::Itertools; use namada::ibc::tx_msg::Msg; use namada::ledger::ibc::handler::IbcActions; + use namada::ledger::ibc::storage as ibc_storage; use namada::ledger::ibc::vp::{ get_dummy_header as tm_dummy_header, Error as IbcError, }; @@ -1215,11 +1216,14 @@ mod tests { let result = ibc::validate_ibc_vp_from_tx(&env, &tx); assert!(result.expect("validation failed unexpectedly")); // Check if the token was escrowed - let escrow = address::Address::Internal( - address::InternalAddress::ibc_escrow_address( - msg.source_port.to_string(), - msg.source_channel.to_string(), - ), + let key_prefix = ibc_storage::ibc_account_prefix( + &msg.source_port, + &msg.source_channel, + &token, + ); + let escrow = token::multitoken_balance_key( + &key_prefix, + &address::Address::Internal(address::InternalAddress::IbcEscrow), ); let token_vp_result = ibc::validate_token_vp_from_tx(&env, &tx, &escrow); @@ -1266,6 +1270,12 @@ mod tests { let (port_id, channel_id, channel_writes) = ibc::prepare_opened_channel(&conn_id, false); writes.extend(channel_writes); + // the origin-specific token + let denom = format!("{}/{}/{}", port_id, channel_id, token); + let key_prefix = ibc_storage::ibc_token_prefix(&denom).unwrap(); + let key = token::multitoken_balance_key(&key_prefix, &sender); + let init_bal = Amount::from(1_000_000_000u64); + writes.insert(key, init_bal.try_to_vec().unwrap()); writes.into_iter().for_each(|(key, val)| { tx_host_env::with(|env| { env.storage.write(&key, &val).expect("write error"); @@ -1274,8 +1284,9 @@ mod tests { // Start a transaction to send a packet // Set this chain is the sink zone - let token = format!("{}/{}/{}", port_id, channel_id, token); - let msg = ibc::msg_transfer(port_id, channel_id, token, &sender); + let denom = format!("{}/{}/{}", port_id, channel_id, token); + let msg = + ibc::msg_transfer(port_id.clone(), channel_id, denom, &sender); let mut tx_data = vec![]; msg.to_any().encode(&mut tx_data).expect("encoding failed"); let tx = Tx { @@ -1294,8 +1305,12 @@ mod tests { let result = ibc::validate_ibc_vp_from_tx(&env, &tx); assert!(result.expect("validation failed unexpectedly")); // Check if the token was burned - let burn = - address::Address::Internal(address::InternalAddress::IbcBurn); + let key_prefix = + ibc_storage::ibc_account_prefix(&port_id, &channel_id, &token); + let burn = token::multitoken_balance_key( + &key_prefix, + &address::Address::Internal(address::InternalAddress::IbcBurn), + ); let result = ibc::validate_token_vp_from_tx(&env, &tx, &burn); assert!(result.expect("token validation failed unexpectedly")); } @@ -1313,6 +1328,13 @@ mod tests { let (port_id, channel_id, channel_writes) = ibc::prepare_opened_channel(&conn_id, false); writes.extend(channel_writes); + // the origin-specific token + let denom = format!("{}/{}/{}", port_id, channel_id, token); + let key_prefix = ibc_storage::ibc_token_prefix(&denom).unwrap(); + let key = token::multitoken_balance_key(&key_prefix, &receiver); + let init_bal = Amount::from(1_000_000_000u64); + writes.insert(key, init_bal.try_to_vec().unwrap()); + writes.into_iter().for_each(|(key, val)| { tx_host_env::with(|env| { env.storage.write(&key, &val).expect("write error"); @@ -1321,7 +1343,7 @@ mod tests { // packet let packet = ibc::received_packet( - port_id, + port_id.clone(), channel_id, ibc::sequence(1), token.to_string(), @@ -1348,8 +1370,12 @@ mod tests { let result = ibc::validate_ibc_vp_from_tx(&env, &tx); assert!(result.expect("validation failed unexpectedly")); // Check if the token was minted - let mint = - address::Address::Internal(address::InternalAddress::IbcMint); + let key_prefix = + ibc_storage::ibc_account_prefix(&port_id, &channel_id, &token); + let mint = token::multitoken_balance_key( + &key_prefix, + &address::Address::Internal(address::InternalAddress::IbcMint), + ); let result = ibc::validate_token_vp_from_tx(&env, &tx, &mint); assert!(result.expect("token validation failed unexpectedly")); } @@ -1373,20 +1399,19 @@ mod tests { }); }); // escrow in advance - let counterparty = ibc::dummy_channel_counterparty(); - let escrow = address::Address::Internal( - address::InternalAddress::ibc_escrow_address( - port_id.to_string(), - channel_id.to_string(), - ), + let key_prefix = + ibc_storage::ibc_account_prefix(&port_id, &channel_id, &token); + let escrow = token::multitoken_balance_key( + &key_prefix, + &address::Address::Internal(address::InternalAddress::IbcEscrow), ); - let key = token::balance_key(&token, &escrow); let val = Amount::from(1_000_000_000u64).try_to_vec().unwrap(); tx_host_env::with(|env| { - env.storage.write(&key, &val).expect("write error"); + env.storage.write(&escrow, &val).expect("write error"); }); // Set this chain as the source zone + let counterparty = ibc::dummy_channel_counterparty(); let token = format!( "{}/{}/{}", counterparty.port_id().clone(), @@ -1612,11 +1637,14 @@ mod tests { let result = ibc::validate_ibc_vp_from_tx(&env, &tx); assert!(result.expect("validation failed unexpectedly")); // Check if the token was refunded - let escrow = address::Address::Internal( - address::InternalAddress::ibc_escrow_address( - packet.source_port.to_string(), - packet.source_channel.to_string(), - ), + let key_prefix = ibc_storage::ibc_account_prefix( + &packet.source_port, + &packet.source_channel, + &token, + ); + let escrow = token::multitoken_balance_key( + &key_prefix, + &address::Address::Internal(address::InternalAddress::IbcEscrow), ); let result = ibc::validate_token_vp_from_tx(&env, &tx, &escrow); assert!(result.expect("token validation failed unexpectedly")); @@ -1681,11 +1709,14 @@ mod tests { let result = ibc::validate_ibc_vp_from_tx(&env, &tx); assert!(result.expect("validation failed unexpectedly")); // Check if the token was refunded - let escrow = address::Address::Internal( - address::InternalAddress::ibc_escrow_address( - packet.source_port.to_string(), - packet.source_channel.to_string(), - ), + let key_prefix = ibc_storage::ibc_account_prefix( + &packet.source_port, + &packet.source_channel, + &token, + ); + let escrow = token::multitoken_balance_key( + &key_prefix, + &address::Address::Internal(address::InternalAddress::IbcEscrow), ); let result = ibc::validate_token_vp_from_tx(&env, &tx, &escrow); assert!(result.expect("token validation failed unexpectedly")); diff --git a/tx_prelude/src/ibc.rs b/tx_prelude/src/ibc.rs index cd2f0a1293..e17270cfb9 100644 --- a/tx_prelude/src/ibc.rs +++ b/tx_prelude/src/ibc.rs @@ -3,13 +3,12 @@ pub use namada::ledger::ibc::handler::{Error, IbcActions, Result}; use namada::ledger::storage_api::{StorageRead, StorageWrite}; use namada::ledger::tx_env::TxEnv; -use namada::types::address::Address; pub use namada::types::ibc::IbcEvent; use namada::types::storage::{BlockHeight, Key}; use namada::types::time::Rfc3339String; use namada::types::token::Amount; -use crate::token::transfer; +use crate::token::transfer_with_keys; use crate::Ctx; impl IbcActions for Ctx { @@ -50,12 +49,11 @@ impl IbcActions for Ctx { fn transfer_token( &mut self, - src: &Address, - dest: &Address, - token: &Address, + src: &Key, + dest: &Key, amount: Amount, ) -> std::result::Result<(), Self::Error> { - transfer(self, src, dest, token, None, amount)?; + transfer_with_keys(self, src, dest, amount)?; Ok(()) } diff --git a/wasm/Cargo.lock b/wasm/Cargo.lock index 9d63d52b84..47ddc5d7bb 100644 --- a/wasm/Cargo.lock +++ b/wasm/Cargo.lock @@ -23,7 +23,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom", + "getrandom 0.2.7", "once_cell", "version_check", ] @@ -146,7 +146,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", ] [[package]] @@ -161,6 +161,27 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "async-stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" +dependencies = [ + "async-stream-impl", + "futures-core", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "async-trait" version = "0.1.58" @@ -172,6 +193,22 @@ dependencies = [ "syn", ] +[[package]] +name = "async-tungstenite" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e00550829ef8e2c4115250d0ee43305649b0fa95f78a32ce5b07da0b73d95c5c" +dependencies = [ + "futures-io", + "futures-util", + "log", + "pin-project-lite", + "tokio", + "tokio-rustls", + "tungstenite", + "webpki-roots", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -193,12 +230,24 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + [[package]] name = "base64" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64ct" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" + [[package]] name = "bech32" version = "0.8.1" @@ -220,6 +269,27 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitcoin" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42b2a9a8e3c7544f5ce2b475f2f56580a3102b37e0ee001558ad4faedcf56cf4" +dependencies = [ + "bech32", + "bitcoin_hashes", + "secp256k1", + "serde", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "006cc91e1a1d99819bc5b8214be3555c1f0611b169f527a1fdc54ed1f2b745b0" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -333,6 +403,12 @@ dependencies = [ "syn", ] +[[package]] +name = "bytecount" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" + [[package]] name = "byteorder" version = "1.4.3" @@ -345,6 +421,37 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" +[[package]] +name = "camino" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.14", + "serde", + "serde_json", +] + [[package]] name = "cc" version = "1.0.73" @@ -400,12 +507,39 @@ dependencies = [ "syn", ] +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + [[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "contracts" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1d1429e3bd78171c65aa010eabcdf8f863ba3254728dbfb0ad4b1545beac15c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.3" @@ -490,6 +624,16 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "crossbeam-channel" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +dependencies = [ + "crossbeam-utils 0.7.2", + "maybe-uninit", +] + [[package]] name = "crossbeam-channel" version = "0.5.6" @@ -497,7 +641,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils", + "crossbeam-utils 0.8.12", ] [[package]] @@ -507,8 +651,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch", - "crossbeam-utils", + "crossbeam-epoch 0.9.11", + "crossbeam-utils 0.8.12", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +dependencies = [ + "autocfg", + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", + "lazy_static", + "maybe-uninit", + "memoffset 0.5.6", + "scopeguard", ] [[package]] @@ -519,11 +678,22 @@ checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg", "cfg-if 1.0.0", - "crossbeam-utils", - "memoffset", + "crossbeam-utils 0.8.12", + "memoffset 0.6.5", "scopeguard", ] +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg", + "cfg-if 0.1.10", + "lazy_static", +] + [[package]] name = "crossbeam-utils" version = "0.8.12" @@ -539,6 +709,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -549,6 +731,35 @@ dependencies = [ "typenum", ] +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ct-logs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" +dependencies = [ + "sct", +] + [[package]] name = "curve25519-dalek" version = "3.2.0" @@ -659,6 +870,15 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + [[package]] name = "derivative" version = "2.2.0" @@ -701,6 +921,27 @@ dependencies = [ "subtle", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[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 = "dynasm" version = "1.2.3" @@ -727,6 +968,18 @@ dependencies = [ "memmap2", ] +[[package]] +name = "ecdsa" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature", +] + [[package]] name = "ed25519" version = "1.5.2" @@ -769,6 +1022,24 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +[[package]] +name = "elliptic-curve" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "ff", + "generic-array", + "group", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "enum-iterator" version = "0.7.0" @@ -810,6 +1081,15 @@ dependencies = [ "syn", ] +[[package]] +name = "error-chain" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +dependencies = [ + "version_check", +] + [[package]] name = "eyre" version = "0.6.8" @@ -848,6 +1128,16 @@ dependencies = [ "serde_bytes", ] +[[package]] +name = "ff" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "fixedbitset" version = "0.4.2" @@ -870,6 +1160,15 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + [[package]] name = "futures" version = "0.3.24" @@ -878,6 +1177,7 @@ checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" dependencies = [ "futures-channel", "futures-core", + "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -900,12 +1200,34 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" +[[package]] +name = "futures-executor" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" +[[package]] +name = "futures-macro" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "futures-sink" version = "0.3.24" @@ -924,11 +1246,16 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" dependencies = [ + "futures-channel", "futures-core", + "futures-io", + "futures-macro", "futures-sink", "futures-task", + "memchr", "pin-project-lite", "pin-utils", + "slab", ] [[package]] @@ -941,6 +1268,19 @@ dependencies = [ "version_check", ] +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + [[package]] name = "getrandom" version = "0.2.7" @@ -949,7 +1289,7 @@ checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if 1.0.0", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -969,6 +1309,23 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "group" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "gumdrop" version = "0.8.1" @@ -990,23 +1347,82 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.11.2" +name = "h2" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util 0.7.4", + "tracing", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ "ahash", ] +[[package]] +name = "hdpath" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dafb09e5d85df264339ad786a147d9de1da13687a3697c52244297e5e7c32d9c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "headers" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +dependencies = [ + "base64", + "bitflags", + "bytes", + "headers-core", + "http", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http", +] + [[package]] name = "heck" version = "0.3.3" @@ -1031,6 +1447,149 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[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.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-proxy" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca815a891b24fdfb243fa3239c86154392b0953ee584aa1a2a1f66d20cbe75cc" +dependencies = [ + "bytes", + "futures", + "headers", + "http", + "hyper", + "hyper-rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "tower-service", + "webpki", +] + +[[package]] +name = "hyper-rustls" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" +dependencies = [ + "ct-logs", + "futures-util", + "hyper", + "log", + "rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "webpki", + "webpki-roots", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + [[package]] name = "iana-time-zone" version = "0.1.51" @@ -1093,6 +1652,61 @@ dependencies = [ "prost-types", "serde", "tendermint-proto", + "tonic", +] + +[[package]] +name = "ibc-relayer" +version = "0.14.0" +source = "git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2#f4703dfe2c1f25cc431279ab74f10f3e0f6827e2" +dependencies = [ + "anyhow", + "async-stream", + "bech32", + "bitcoin", + "bytes", + "crossbeam-channel 0.5.6", + "dirs-next", + "flex-error", + "futures", + "hdpath", + "hex", + "http", + "humantime", + "humantime-serde", + "ibc", + "ibc-proto", + "itertools", + "k256", + "moka", + "nanoid", + "num-bigint", + "num-rational", + "prost", + "prost-types", + "regex", + "retry", + "ripemd160", + "semver 1.0.14", + "serde", + "serde_derive", + "serde_json", + "sha2 0.10.6", + "signature", + "subtle-encoding", + "tendermint", + "tendermint-light-client", + "tendermint-light-client-verifier", + "tendermint-proto", + "tendermint-rpc", + "thiserror", + "tiny-bip39", + "tiny-keccak", + "tokio", + "toml", + "tonic", + "tracing", + "uint", ] [[package]] @@ -1117,6 +1731,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "indenter" version = "0.3.3" @@ -1134,6 +1758,15 @@ dependencies = [ "serde", ] +[[package]] +name = "input_buffer" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" +dependencies = [ + "bytes", +] + [[package]] name = "instant" version = "0.1.12" @@ -1167,6 +1800,19 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "k256" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa", + "elliptic-curve", + "sec1", + "sha2 0.9.9", +] + [[package]] name = "keccak" version = "0.1.2" @@ -1212,7 +1858,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand", + "rand 0.8.5", "serde", "sha2 0.9.9", ] @@ -1252,6 +1898,16 @@ dependencies = [ "cc", ] +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.17" @@ -1300,6 +1956,12 @@ dependencies = [ "regex-automata", ] +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + [[package]] name = "memchr" version = "2.5.0" @@ -1315,6 +1977,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +dependencies = [ + "autocfg", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -1330,6 +2001,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + [[package]] name = "miniz_oxide" version = "0.5.4" @@ -1339,6 +2016,40 @@ dependencies = [ "adler", ] +[[package]] +name = "mio" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.36.1", +] + +[[package]] +name = "moka" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "975fa04238144061e7f8df9746b2e9cd93ef85881da5548d842a7c6a4b614415" +dependencies = [ + "crossbeam-channel 0.5.6", + "crossbeam-epoch 0.8.2", + "crossbeam-utils 0.8.12", + "num_cpus", + "once_cell", + "parking_lot", + "quanta", + "scheduled-thread-pool", + "skeptic", + "smallvec", + "tagptr", + "thiserror", + "triomphe", + "uuid 1.2.1", +] + [[package]] name = "more-asserts" version = "0.2.2" @@ -1379,7 +2090,7 @@ dependencies = [ "prost", "prost-types", "pwasm-utils", - "rand", + "rand 0.8.5", "rand_core 0.6.4", "rayon", "rust_decimal", @@ -1428,6 +2139,9 @@ dependencies = [ "chrono", "concat-idents", "derivative", + "ibc", + "ibc-proto", + "ibc-relayer", "namada", "namada_tx_prelude", "namada_vp_prelude", @@ -1435,7 +2149,12 @@ dependencies = [ "serde_json", "sha2 0.9.9", "tempfile", + "tendermint", + "tendermint-config", + "tendermint-proto", + "tendermint-rpc", "test-log", + "tokio", "tracing", "tracing-subscriber", ] @@ -1477,7 +2196,7 @@ name = "namada_wasm" version = "0.9.0" dependencies = [ "borsh", - "getrandom", + "getrandom 0.2.7", "namada", "namada_tests", "namada_tx_prelude", @@ -1490,6 +2209,15 @@ dependencies = [ "wee_alloc", ] +[[package]] +name = "nanoid" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" +dependencies = [ + "rand 0.8.5", +] + [[package]] name = "num-bigint" version = "0.4.3" @@ -1499,6 +2227,7 @@ dependencies = [ "autocfg", "num-integer", "num-traits", + "serde", ] [[package]] @@ -1522,6 +2251,19 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + [[package]] name = "num-traits" version = "0.2.15" @@ -1583,6 +2325,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + [[package]] name = "parity-wasm" version = "0.42.2" @@ -1590,19 +2338,84 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" [[package]] -name = "paste" -version = "1.0.9" +name = "parking_lot" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] [[package]] -name = "pest" -version = "2.4.0" +name = "parking_lot_core" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ - "thiserror", - "ucd-trie", + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "paste" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac 0.8.0", +] + +[[package]] +name = "peg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07c0b841ea54f523f7aa556956fbd293bcbe06f2e67d2eb732b7278aaf1d166a" +dependencies = [ + "peg-macros", + "peg-runtime", +] + +[[package]] +name = "peg-macros" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aa52829b8decbef693af90202711348ab001456803ba2a98eb4ec8fb70844c" +dependencies = [ + "peg-runtime", + "proc-macro2", + "quote", +] + +[[package]] +name = "peg-runtime" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c719dcf55f09a3a7e764c6649ab594c18a177e3599c467983cdf644bfc0a4088" + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pest" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" +dependencies = [ + "thiserror", + "ucd-trie", ] [[package]] @@ -1615,6 +2428,26 @@ dependencies = [ "indexmap", ] +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -1627,6 +2460,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + [[package]] name = "ppv-lite86" version = "0.2.16" @@ -1686,8 +2530,8 @@ dependencies = [ "lazy_static", "num-traits", "quick-error 2.0.1", - "rand", - "rand_chacha", + "rand 0.8.5", + "rand_chacha 0.3.1", "rand_xorshift", "regex-syntax", "rusty-fork", @@ -1767,6 +2611,17 @@ dependencies = [ "syn", ] +[[package]] +name = "pulldown-cmark" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d9cc634bc78768157b5cbfe988ffcd1dcba95cd2b2f03a88316c08c6d00ed63" +dependencies = [ + "bitflags", + "memchr", + "unicase", +] + [[package]] name = "pwasm-utils" version = "0.18.2" @@ -1778,6 +2633,22 @@ dependencies = [ "parity-wasm", ] +[[package]] +name = "quanta" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e31331286705f455e56cca62e0e717158474ff02b7936c1fa596d983f4ae27" +dependencies = [ + "crossbeam-utils 0.8.12", + "libc", + "mach", + "once_cell", + "raw-cpuid", + "wasi 0.10.2+wasi-snapshot-preview1", + "web-sys", + "winapi", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -1799,6 +2670,19 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + [[package]] name = "rand" version = "0.8.5" @@ -1806,10 +2690,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", + "rand_chacha 0.3.1", "rand_core 0.6.4", ] +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + [[package]] name = "rand_chacha" version = "0.3.1" @@ -1825,6 +2719,9 @@ name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] [[package]] name = "rand_core" @@ -1832,7 +2729,16 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.7", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", ] [[package]] @@ -1844,6 +2750,15 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "raw-cpuid" +version = "10.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6823ea29436221176fe662da99998ad3b4db2c7f31e7b6f5fe43adccd6320bb" +dependencies = [ + "bitflags", +] + [[package]] name = "rayon" version = "1.5.3" @@ -1862,9 +2777,9 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" dependencies = [ - "crossbeam-channel", + "crossbeam-channel 0.5.6", "crossbeam-deque", - "crossbeam-utils", + "crossbeam-utils 0.8.12", "num_cpus", ] @@ -1877,6 +2792,17 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.7", + "redox_syscall", + "thiserror", +] + [[package]] name = "regalloc" version = "0.0.31" @@ -1944,6 +2870,38 @@ dependencies = [ "bytecheck", ] +[[package]] +name = "retry" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac95c60a949a63fd2822f4964939662d8f2c16c4fa0624fd954bc6e703b9a3f6" + +[[package]] +name = "rfc6979" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +dependencies = [ + "crypto-bigint", + "hmac 0.11.0", + "zeroize", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + [[package]] name = "ripemd160" version = "0.9.1" @@ -2009,7 +2967,32 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" dependencies = [ - "semver", + "semver 0.11.0", +] + +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64", + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +dependencies = [ + "openssl-probe", + "rustls", + "schannel", + "security-framework", ] [[package]] @@ -2083,6 +3066,34 @@ dependencies = [ "safe-regex-compiler", ] +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + +[[package]] +name = "scheduled-thread-pool" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "977a7519bff143a44f842fd07e80ad1329295bd71686457f18e496736f4bf9bf" +dependencies = [ + "parking_lot", +] + [[package]] name = "scopeguard" version = "1.1.0" @@ -2095,12 +3106,77 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "seahash" version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "sec1" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" +dependencies = [ + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26947345339603ae8395f68e2f3d85a6b0a8ddfe6315818e80b8504415099db0" +dependencies = [ + "secp256k1-sys", + "serde", +] + +[[package]] +name = "secp256k1-sys" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "152e20a0fd0519390fc43ab404663af8a0b794273d2a91d60ad4a39f13ffe110" +dependencies = [ + "cc", +] + +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "0.11.0" @@ -2110,6 +3186,15 @@ dependencies = [ "semver-parser", ] +[[package]] +name = "semver" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +dependencies = [ + "serde", +] + [[package]] name = "semver-parser" version = "0.10.2" @@ -2137,6 +3222,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + [[package]] name = "serde_derive" version = "1.0.145" @@ -2170,6 +3265,30 @@ dependencies = [ "syn", ] +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.5", +] + [[package]] name = "sha2" version = "0.9.9" @@ -2216,23 +3335,70 @@ dependencies = [ ] [[package]] -name = "signature" -version = "1.6.4" +name = "signal-hook-registry" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] [[package]] -name = "simple-error" -version = "0.2.3" +name = "signature" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +dependencies = [ + "digest 0.9.0", + "rand_core 0.6.4", +] + +[[package]] +name = "simple-error" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc47a29ce97772ca5c927f75bac34866b16d64e07f330c3248e2d7226623901b" +[[package]] +name = "skeptic" +version = "0.13.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" +dependencies = [ + "bytecount", + "cargo_metadata", + "error-chain", + "glob", + "pulldown-cmark", + "tempfile", + "walkdir", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + [[package]] name = "smallvec" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "sp-std" version = "3.0.0" @@ -2250,12 +3416,34 @@ dependencies = [ "sha2 0.9.9", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "subtle" version = "2.4.1" @@ -2300,6 +3488,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + [[package]] name = "target-lexicon" version = "0.12.4" @@ -2331,10 +3525,12 @@ dependencies = [ "ed25519-dalek", "flex-error", "futures", + "k256", "num-traits", "once_cell", "prost", "prost-types", + "ripemd160", "serde", "serde_bytes", "serde_json", @@ -2348,6 +3544,40 @@ dependencies = [ "zeroize", ] +[[package]] +name = "tendermint-config" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=e6c684731f21bffd89886d3e91074b96aee074ba#e6c684731f21bffd89886d3e91074b96aee074ba" +dependencies = [ + "flex-error", + "serde", + "serde_json", + "tendermint", + "toml", + "url", +] + +[[package]] +name = "tendermint-light-client" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=e6c684731f21bffd89886d3e91074b96aee074ba#e6c684731f21bffd89886d3e91074b96aee074ba" +dependencies = [ + "contracts", + "crossbeam-channel 0.4.4", + "derive_more", + "flex-error", + "futures", + "serde", + "serde_cbor", + "serde_derive", + "static_assertions", + "tendermint", + "tendermint-light-client-verifier", + "tendermint-rpc", + "time", + "tokio", +] + [[package]] name = "tendermint-light-client-verifier" version = "0.23.6" @@ -2377,6 +3607,39 @@ dependencies = [ "time", ] +[[package]] +name = "tendermint-rpc" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=e6c684731f21bffd89886d3e91074b96aee074ba#e6c684731f21bffd89886d3e91074b96aee074ba" +dependencies = [ + "async-trait", + "async-tungstenite", + "bytes", + "flex-error", + "futures", + "getrandom 0.2.7", + "http", + "hyper", + "hyper-proxy", + "hyper-rustls", + "peg", + "pin-project", + "serde", + "serde_bytes", + "serde_json", + "subtle-encoding", + "tendermint", + "tendermint-config", + "tendermint-proto", + "thiserror", + "time", + "tokio", + "tracing", + "url", + "uuid 0.8.2", + "walkdir", +] + [[package]] name = "tendermint-testgen" version = "0.23.6" @@ -2458,6 +3721,140 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-stream" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + [[package]] name = "toml" version = "0.5.9" @@ -2467,6 +3864,39 @@ dependencies = [ "serde", ] +[[package]] +name = "tonic" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" +dependencies = [ + "async-stream", + "async-trait", + "base64", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "prost-derive", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "tokio-stream", + "tokio-util 0.6.10", + "tower", + "tower-layer", + "tower-service", + "tracing", + "tracing-futures", +] + [[package]] name = "tonic-build" version = "0.6.2" @@ -2479,6 +3909,38 @@ dependencies = [ "syn", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap", + "pin-project", + "pin-project-lite", + "rand 0.8.5", + "slab", + "tokio", + "tokio-util 0.7.4", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + [[package]] name = "tracing" version = "0.1.37" @@ -2512,6 +3974,16 @@ dependencies = [ "once_cell", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-subscriber" version = "0.3.16" @@ -2527,12 +3999,43 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "triomphe" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1ee9bd9239c339d714d657fac840c6d2a4f9c45f4f9ec7b0975113458be78db" + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "tungstenite" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ada8297e8d70872fa9a551d93250a9f407beb9f37ef86494eb20012a2ff7c24" +dependencies = [ + "base64", + "byteorder", + "bytes", + "http", + "httparse", + "input_buffer", + "log", + "rand 0.8.5", + "sha-1", + "url", + "utf-8", +] + [[package]] name = "tx_template" version = "0.9.0" dependencies = [ "borsh", - "getrandom", + "getrandom 0.2.7", "namada_tests", "namada_tx_prelude", "wee_alloc", @@ -2550,12 +4053,48 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +[[package]] +name = "uint" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + [[package]] name = "unicode-ident" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-segmentation" version = "1.10.0" @@ -2574,6 +4113,44 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + +[[package]] +name = "uuid" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" +dependencies = [ + "getrandom 0.2.7", +] + [[package]] name = "version_check" version = "0.9.4" @@ -2585,7 +4162,7 @@ name = "vp_template" version = "0.9.0" dependencies = [ "borsh", - "getrandom", + "getrandom 0.2.7", "namada_tests", "namada_vp_prelude", "wee_alloc", @@ -2600,6 +4177,39 @@ dependencies = [ "libc", ] +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2883,7 +4493,7 @@ dependencies = [ "indexmap", "libc", "loupe", - "memoffset", + "memoffset 0.6.5", "more-asserts", "region", "rkyv", @@ -2926,6 +4536,35 @@ dependencies = [ "wast", ] +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +dependencies = [ + "webpki", +] + [[package]] name = "wee_alloc" version = "0.4.5" @@ -2980,6 +4619,106 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + [[package]] name = "zeroize" version = "1.5.7" diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml index 086fa05cae..062d9fb3dc 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -13,15 +13,19 @@ borsh = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4 borsh-derive = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"} borsh-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"} borsh-schema-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"} -# patched to a commit on the `eth-bridge-integration` branch of our fork +# patched to a commit on the `eth-bridge-integration+consensus-timeout` branch of our fork tendermint = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} +tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} +tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} tendermint-testgen = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} +tendermint-light-client = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} tendermint-light-client-verifier = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} # patched to a commit on the `eth-bridge-integration` branch of our fork ibc = {git = "https://github.com/heliaxdev/ibc-rs.git", rev = "f4703dfe2c1f25cc431279ab74f10f3e0f6827e2"} ibc-proto = {git = "https://github.com/heliaxdev/ibc-rs.git", rev = "f4703dfe2c1f25cc431279ab74f10f3e0f6827e2"} +ibc-relayer = {git = "https://github.com/heliaxdev/ibc-rs.git", rev = "f4703dfe2c1f25cc431279ab74f10f3e0f6827e2"} [profile.release] # smaller and faster wasm (https://rustwasm.github.io/book/reference/code-size.html#compiling-with-link-time-optimizations-lto) @@ -29,4 +33,4 @@ lto = true # simply terminate on panics, no unwinding panic = "abort" # tell llvm to optimize for size (https://rustwasm.github.io/book/reference/code-size.html#tell-llvm-to-optimize-for-size-instead-of-speed) -opt-level = 'z' \ No newline at end of file +opt-level = 'z' diff --git a/wasm/checksums.json b/wasm/checksums.json index 496d1c7a0f..334d35de07 100644 --- a/wasm/checksums.json +++ b/wasm/checksums.json @@ -1,15 +1,15 @@ { - "tx_bond.wasm": "tx_bond.04d6847800dad11990b42e8f2981a4a79d06d6d0c981c3d70c929e5b6a4f348b.wasm", - "tx_ibc.wasm": "tx_ibc.6ab530398ed8e276a8af7f231edbfae984b7e84eeb854714ba9339c5bed9d330.wasm", - "tx_init_account.wasm": "tx_init_account.578d987351e6ae42baa7849ae167e3ba33f3a62dba51cd47b0fa6d3ea6e4f128.wasm", - "tx_init_proposal.wasm": "tx_init_proposal.71e27610210622fa53c3de58351761cca839681a4f450d4eff6b46bde3ae85a5.wasm", - "tx_init_validator.wasm": "tx_init_validator.269f065ff683782db2fdcac6e2485e80cbebb98929671a42eeb01703e0bbd8f5.wasm", - "tx_transfer.wasm": "tx_transfer.784325cf7763faf8d75797960cda6fbabbd343f3c6f7e6785f60f5e0911a6bb5.wasm", - "tx_unbond.wasm": "tx_unbond.ed13fa636d138ac4e35f2b4f31a6b4d3bed67e6b998dc6325f90711a2aca3704.wasm", - "tx_update_vp.wasm": "tx_update_vp.c4050e597116203eba5afde946a014afb067bdeaaae417377214a80c38a3786b.wasm", - "tx_vote_proposal.wasm": "tx_vote_proposal.ece325881aad1c8a29f715c2f435c3335e08e51eed837c00ce0f7bbaddbefe50.wasm", - "tx_withdraw.wasm": "tx_withdraw.408fc10b3744c398258124e5e48e3449f6baf82a263df26911586a3382fbceb9.wasm", - "vp_testnet_faucet.wasm": "vp_testnet_faucet.ae9a681dc2c1bd244b0575474fa4a364af56fa75833950693ca52ab25018c97d.wasm", - "vp_token.wasm": "vp_token.468de153dc5ce3af208bd762de3e85be48bc631012ec5f0947af95168da6cb93.wasm", - "vp_user.wasm": "vp_user.c101016a85a72f40da7f33e5d9061cfd2e3274eaac75a71c59c9ab4ed9896ffd.wasm" + "tx_bond.wasm": "tx_bond.000eed39938217390eb7e19302581342591de9535b93a08896d3f6d39cc0998d.wasm", + "tx_ibc.wasm": "tx_ibc.e4ac6fabf931d58742f6dfe72a833a17d3976a6c4bbed1406fcdf4c1d5eaac70.wasm", + "tx_init_account.wasm": "tx_init_account.177d8fd5425a9f0a3f27f5d0f321a674550c9da1883b132a74110699cc845418.wasm", + "tx_init_proposal.wasm": "tx_init_proposal.428d1668170936337d4da7023687ff2daedd240d252abd4d585de32212f1b4a9.wasm", + "tx_init_validator.wasm": "tx_init_validator.c151eca7e71b7517e1d2f637eeffa47797bf9428f31078b6e97a500223fe3e54.wasm", + "tx_transfer.wasm": "tx_transfer.433f324c202256bd08c4123afaf0712bf94bce425130d6c19a5f4f1cf251dd2c.wasm", + "tx_unbond.wasm": "tx_unbond.094edd312a43c641bceb783a6aa5d1a08771bc339d4becfe01eb08ba2b757e37.wasm", + "tx_update_vp.wasm": "tx_update_vp.ba1a3f688cccbc0de12e9fd744a76a1c31a8cd72bd209beffcdcbba02ac7389c.wasm", + "tx_vote_proposal.wasm": "tx_vote_proposal.a02d79eeda26e7835a96e7db075282e64014db938e29adfa7c71e914e9bf0748.wasm", + "tx_withdraw.wasm": "tx_withdraw.6bf2956c8d90e6462829fadbb0791e3a0833dea63076e4906d9437351e16af54.wasm", + "vp_testnet_faucet.wasm": "vp_testnet_faucet.3defe36c096538311cbc67278215c6b278bc101bfaf79fbf7bd4372a62fc1e96.wasm", + "vp_token.wasm": "vp_token.29c65890157adffd072edb3926fbf56d8b7541565a85be41c59c612020d09816.wasm", + "vp_user.wasm": "vp_user.8f9bc0fbac8be1e2d0c67e50eded328dbb16df74df3e9694e83b7e0eabe33cd6.wasm" } \ No newline at end of file diff --git a/wasm_for_tests/wasm_source/Cargo.lock b/wasm_for_tests/wasm_source/Cargo.lock index 1cbb2ff069..14bb5eb11d 100644 --- a/wasm_for_tests/wasm_source/Cargo.lock +++ b/wasm_for_tests/wasm_source/Cargo.lock @@ -23,7 +23,7 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ - "getrandom", + "getrandom 0.2.7", "once_cell", "version_check", ] @@ -146,7 +146,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", ] [[package]] @@ -161,6 +161,27 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +[[package]] +name = "async-stream" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" +dependencies = [ + "async-stream-impl", + "futures-core", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "async-trait" version = "0.1.58" @@ -172,6 +193,22 @@ dependencies = [ "syn", ] +[[package]] +name = "async-tungstenite" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e00550829ef8e2c4115250d0ee43305649b0fa95f78a32ce5b07da0b73d95c5c" +dependencies = [ + "futures-io", + "futures-util", + "log", + "pin-project-lite", + "tokio", + "tokio-rustls", + "tungstenite", + "webpki-roots", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -193,12 +230,24 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + [[package]] name = "base64" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64ct" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b645a089122eccb6111b4f81cbc1a49f5900ac4666bb93ac027feaecf15607bf" + [[package]] name = "bech32" version = "0.8.1" @@ -220,6 +269,27 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bitcoin" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42b2a9a8e3c7544f5ce2b475f2f56580a3102b37e0ee001558ad4faedcf56cf4" +dependencies = [ + "bech32", + "bitcoin_hashes", + "secp256k1", + "serde", +] + +[[package]] +name = "bitcoin_hashes" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "006cc91e1a1d99819bc5b8214be3555c1f0611b169f527a1fdc54ed1f2b745b0" +dependencies = [ + "serde", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -333,6 +403,12 @@ dependencies = [ "syn", ] +[[package]] +name = "bytecount" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" + [[package]] name = "byteorder" version = "1.4.3" @@ -345,6 +421,37 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" +[[package]] +name = "camino" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.14", + "serde", + "serde_json", +] + [[package]] name = "cc" version = "1.0.73" @@ -400,12 +507,39 @@ dependencies = [ "syn", ] +[[package]] +name = "const-oid" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4c78c047431fee22c1a7bb92e00ad095a02a983affe4d8a72e2a2c62c1b94f3" + [[package]] name = "constant_time_eq" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +[[package]] +name = "contracts" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1d1429e3bd78171c65aa010eabcdf8f863ba3254728dbfb0ad4b1545beac15c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.3" @@ -490,6 +624,16 @@ dependencies = [ "cfg-if 1.0.0", ] +[[package]] +name = "crossbeam-channel" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" +dependencies = [ + "crossbeam-utils 0.7.2", + "maybe-uninit", +] + [[package]] name = "crossbeam-channel" version = "0.5.6" @@ -497,7 +641,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if 1.0.0", - "crossbeam-utils", + "crossbeam-utils 0.8.12", ] [[package]] @@ -507,8 +651,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch", - "crossbeam-utils", + "crossbeam-epoch 0.9.11", + "crossbeam-utils 0.8.12", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" +dependencies = [ + "autocfg", + "cfg-if 0.1.10", + "crossbeam-utils 0.7.2", + "lazy_static", + "maybe-uninit", + "memoffset 0.5.6", + "scopeguard", ] [[package]] @@ -519,11 +678,22 @@ checksum = "f916dfc5d356b0ed9dae65f1db9fc9770aa2851d2662b988ccf4fe3516e86348" dependencies = [ "autocfg", "cfg-if 1.0.0", - "crossbeam-utils", - "memoffset", + "crossbeam-utils 0.8.12", + "memoffset 0.6.5", "scopeguard", ] +[[package]] +name = "crossbeam-utils" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +dependencies = [ + "autocfg", + "cfg-if 0.1.10", + "lazy_static", +] + [[package]] name = "crossbeam-utils" version = "0.8.12" @@ -539,6 +709,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c6a1d5fa1de37e071642dfa44ec552ca5b299adb128fab16138e24b548fd21" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -549,6 +731,35 @@ dependencies = [ "typenum", ] +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "crypto-mac" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +dependencies = [ + "generic-array", + "subtle", +] + +[[package]] +name = "ct-logs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" +dependencies = [ + "sct", +] + [[package]] name = "curve25519-dalek" version = "3.2.0" @@ -659,6 +870,15 @@ version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" +[[package]] +name = "der" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6919815d73839e7ad218de758883aae3a257ba6759ce7a9992501efbb53d705c" +dependencies = [ + "const-oid", +] + [[package]] name = "derivative" version = "2.2.0" @@ -701,6 +921,27 @@ dependencies = [ "subtle", ] +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[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 = "dynasm" version = "1.2.3" @@ -727,6 +968,18 @@ dependencies = [ "memmap2", ] +[[package]] +name = "ecdsa" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0d69ae62e0ce582d56380743515fefaf1a8c70cec685d9677636d7e30ae9dc9" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature", +] + [[package]] name = "ed25519" version = "1.5.2" @@ -769,6 +1022,24 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +[[package]] +name = "elliptic-curve" +version = "0.11.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "ff", + "generic-array", + "group", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + [[package]] name = "enum-iterator" version = "0.7.0" @@ -810,6 +1081,15 @@ dependencies = [ "syn", ] +[[package]] +name = "error-chain" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" +dependencies = [ + "version_check", +] + [[package]] name = "eyre" version = "0.6.8" @@ -848,6 +1128,16 @@ dependencies = [ "serde_bytes", ] +[[package]] +name = "ff" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "131655483be284720a17d74ff97592b8e76576dc25563148601df2d7c9080924" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "fixedbitset" version = "0.4.2" @@ -870,6 +1160,15 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + [[package]] name = "futures" version = "0.3.24" @@ -878,6 +1177,7 @@ checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" dependencies = [ "futures-channel", "futures-core", + "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -900,12 +1200,34 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" +[[package]] +name = "futures-executor" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" +[[package]] +name = "futures-macro" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "futures-sink" version = "0.3.24" @@ -924,11 +1246,16 @@ version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" dependencies = [ + "futures-channel", "futures-core", + "futures-io", + "futures-macro", "futures-sink", "futures-task", + "memchr", "pin-project-lite", "pin-utils", + "slab", ] [[package]] @@ -941,6 +1268,19 @@ dependencies = [ "version_check", ] +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + [[package]] name = "getrandom" version = "0.2.7" @@ -949,7 +1289,7 @@ checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if 1.0.0", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -969,6 +1309,23 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + +[[package]] +name = "group" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5ac374b108929de78460075f3dc439fa66df9d8fc77e8f12caa5165fcf0c89" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "gumdrop" version = "0.8.1" @@ -990,23 +1347,82 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.11.2" +name = "h2" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util 0.7.4", + "tracing", +] + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ "ahash", ] +[[package]] +name = "hdpath" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dafb09e5d85df264339ad786a147d9de1da13687a3697c52244297e5e7c32d9c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "headers" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" +dependencies = [ + "base64", + "bitflags", + "bytes", + "headers-core", + "http", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http", +] + [[package]] name = "heck" version = "0.3.3" @@ -1031,6 +1447,149 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac 0.8.0", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac 0.11.1", + "digest 0.9.0", +] + +[[package]] +name = "http" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" + +[[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.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-proxy" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca815a891b24fdfb243fa3239c86154392b0953ee584aa1a2a1f66d20cbe75cc" +dependencies = [ + "bytes", + "futures", + "headers", + "http", + "hyper", + "hyper-rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "tower-service", + "webpki", +] + +[[package]] +name = "hyper-rustls" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" +dependencies = [ + "ct-logs", + "futures-util", + "hyper", + "log", + "rustls", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "webpki", + "webpki-roots", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + [[package]] name = "iana-time-zone" version = "0.1.51" @@ -1093,6 +1652,61 @@ dependencies = [ "prost-types", "serde", "tendermint-proto", + "tonic", +] + +[[package]] +name = "ibc-relayer" +version = "0.14.0" +source = "git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2#f4703dfe2c1f25cc431279ab74f10f3e0f6827e2" +dependencies = [ + "anyhow", + "async-stream", + "bech32", + "bitcoin", + "bytes", + "crossbeam-channel 0.5.6", + "dirs-next", + "flex-error", + "futures", + "hdpath", + "hex", + "http", + "humantime", + "humantime-serde", + "ibc", + "ibc-proto", + "itertools", + "k256", + "moka", + "nanoid", + "num-bigint", + "num-rational", + "prost", + "prost-types", + "regex", + "retry", + "ripemd160", + "semver 1.0.14", + "serde", + "serde_derive", + "serde_json", + "sha2 0.10.6", + "signature", + "subtle-encoding", + "tendermint", + "tendermint-light-client", + "tendermint-light-client-verifier", + "tendermint-proto", + "tendermint-rpc", + "thiserror", + "tiny-bip39", + "tiny-keccak", + "tokio", + "toml", + "tonic", + "tracing", + "uint", ] [[package]] @@ -1117,6 +1731,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "indenter" version = "0.3.3" @@ -1134,6 +1758,15 @@ dependencies = [ "serde", ] +[[package]] +name = "input_buffer" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" +dependencies = [ + "bytes", +] + [[package]] name = "instant" version = "0.1.12" @@ -1167,6 +1800,19 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "k256" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19c3a5e0a0b8450278feda242592512e09f61c72e018b8cd5c859482802daf2d" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa", + "elliptic-curve", + "sec1", + "sha2 0.9.9", +] + [[package]] name = "keccak" version = "0.1.2" @@ -1212,7 +1858,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand", + "rand 0.8.5", "serde", "sha2 0.9.9", ] @@ -1252,6 +1898,16 @@ dependencies = [ "cc", ] +[[package]] +name = "lock_api" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.17" @@ -1300,6 +1956,12 @@ dependencies = [ "regex-automata", ] +[[package]] +name = "maybe-uninit" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" + [[package]] name = "memchr" version = "2.5.0" @@ -1315,6 +1977,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memoffset" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" +dependencies = [ + "autocfg", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -1330,6 +2001,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" +[[package]] +name = "mime" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" + [[package]] name = "miniz_oxide" version = "0.5.4" @@ -1339,6 +2016,40 @@ dependencies = [ "adler", ] +[[package]] +name = "mio" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.36.1", +] + +[[package]] +name = "moka" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "975fa04238144061e7f8df9746b2e9cd93ef85881da5548d842a7c6a4b614415" +dependencies = [ + "crossbeam-channel 0.5.6", + "crossbeam-epoch 0.8.2", + "crossbeam-utils 0.8.12", + "num_cpus", + "once_cell", + "parking_lot", + "quanta", + "scheduled-thread-pool", + "skeptic", + "smallvec", + "tagptr", + "thiserror", + "triomphe", + "uuid 1.2.1", +] + [[package]] name = "more-asserts" version = "0.2.2" @@ -1379,7 +2090,7 @@ dependencies = [ "prost", "prost-types", "pwasm-utils", - "rand", + "rand 0.8.5", "rand_core 0.6.4", "rayon", "rust_decimal", @@ -1428,6 +2139,9 @@ dependencies = [ "chrono", "concat-idents", "derivative", + "ibc", + "ibc-proto", + "ibc-relayer", "namada", "namada_tx_prelude", "namada_vp_prelude", @@ -1435,7 +2149,12 @@ dependencies = [ "serde_json", "sha2 0.9.9", "tempfile", + "tendermint", + "tendermint-config", + "tendermint-proto", + "tendermint-rpc", "test-log", + "tokio", "tracing", "tracing-subscriber", ] @@ -1477,13 +2196,22 @@ name = "namada_wasm_for_tests" version = "0.9.0" dependencies = [ "borsh", - "getrandom", + "getrandom 0.2.7", "namada_tests", "namada_tx_prelude", "namada_vp_prelude", "wee_alloc", ] +[[package]] +name = "nanoid" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ffa00dec017b5b1a8b7cf5e2c008bfda1aa7e0697ac1508b491fdf2622fb4d8" +dependencies = [ + "rand 0.8.5", +] + [[package]] name = "num-bigint" version = "0.4.3" @@ -1493,6 +2221,7 @@ dependencies = [ "autocfg", "num-integer", "num-traits", + "serde", ] [[package]] @@ -1516,6 +2245,19 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + [[package]] name = "num-traits" version = "0.2.15" @@ -1577,6 +2319,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + [[package]] name = "parity-wasm" version = "0.42.2" @@ -1584,19 +2332,84 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be5e13c266502aadf83426d87d81a0f5d1ef45b8027f5a471c360abfe4bfae92" [[package]] -name = "paste" -version = "1.0.9" +name = "parking_lot" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core", +] [[package]] -name = "pest" -version = "2.4.0" +name = "parking_lot_core" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ - "thiserror", - "ucd-trie", + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-sys 0.42.0", +] + +[[package]] +name = "paste" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" + +[[package]] +name = "pbkdf2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" +dependencies = [ + "crypto-mac 0.8.0", +] + +[[package]] +name = "peg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07c0b841ea54f523f7aa556956fbd293bcbe06f2e67d2eb732b7278aaf1d166a" +dependencies = [ + "peg-macros", + "peg-runtime", +] + +[[package]] +name = "peg-macros" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5aa52829b8decbef693af90202711348ab001456803ba2a98eb4ec8fb70844c" +dependencies = [ + "peg-runtime", + "proc-macro2", + "quote", +] + +[[package]] +name = "peg-runtime" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c719dcf55f09a3a7e764c6649ab594c18a177e3599c467983cdf644bfc0a4088" + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pest" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc7bc69c062e492337d74d59b120c274fd3d261b6bf6d3207d499b4b379c41a" +dependencies = [ + "thiserror", + "ucd-trie", ] [[package]] @@ -1609,6 +2422,26 @@ dependencies = [ "indexmap", ] +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -1621,6 +2454,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cabda3fb821068a9a4fab19a683eac3af12edf0f34b94a8be53c4972b8149d0" +dependencies = [ + "der", + "spki", + "zeroize", +] + [[package]] name = "ppv-lite86" version = "0.2.16" @@ -1680,8 +2524,8 @@ dependencies = [ "lazy_static", "num-traits", "quick-error 2.0.1", - "rand", - "rand_chacha", + "rand 0.8.5", + "rand_chacha 0.3.1", "rand_xorshift", "regex-syntax", "rusty-fork", @@ -1761,6 +2605,17 @@ dependencies = [ "syn", ] +[[package]] +name = "pulldown-cmark" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d9cc634bc78768157b5cbfe988ffcd1dcba95cd2b2f03a88316c08c6d00ed63" +dependencies = [ + "bitflags", + "memchr", + "unicase", +] + [[package]] name = "pwasm-utils" version = "0.18.2" @@ -1772,6 +2627,22 @@ dependencies = [ "parity-wasm", ] +[[package]] +name = "quanta" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e31331286705f455e56cca62e0e717158474ff02b7936c1fa596d983f4ae27" +dependencies = [ + "crossbeam-utils 0.8.12", + "libc", + "mach", + "once_cell", + "raw-cpuid", + "wasi 0.10.2+wasi-snapshot-preview1", + "web-sys", + "winapi", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -1793,6 +2664,19 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + [[package]] name = "rand" version = "0.8.5" @@ -1800,10 +2684,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", + "rand_chacha 0.3.1", "rand_core 0.6.4", ] +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", +] + [[package]] name = "rand_chacha" version = "0.3.1" @@ -1819,6 +2713,9 @@ name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", +] [[package]] name = "rand_core" @@ -1826,7 +2723,16 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.7", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", ] [[package]] @@ -1838,6 +2744,15 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "raw-cpuid" +version = "10.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6823ea29436221176fe662da99998ad3b4db2c7f31e7b6f5fe43adccd6320bb" +dependencies = [ + "bitflags", +] + [[package]] name = "rayon" version = "1.5.3" @@ -1856,9 +2771,9 @@ version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" dependencies = [ - "crossbeam-channel", + "crossbeam-channel 0.5.6", "crossbeam-deque", - "crossbeam-utils", + "crossbeam-utils 0.8.12", "num_cpus", ] @@ -1871,6 +2786,17 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom 0.2.7", + "redox_syscall", + "thiserror", +] + [[package]] name = "regalloc" version = "0.0.31" @@ -1938,6 +2864,38 @@ dependencies = [ "bytecheck", ] +[[package]] +name = "retry" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac95c60a949a63fd2822f4964939662d8f2c16c4fa0624fd954bc6e703b9a3f6" + +[[package]] +name = "rfc6979" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" +dependencies = [ + "crypto-bigint", + "hmac 0.11.0", + "zeroize", +] + +[[package]] +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" +dependencies = [ + "cc", + "libc", + "once_cell", + "spin", + "untrusted", + "web-sys", + "winapi", +] + [[package]] name = "ripemd160" version = "0.9.1" @@ -2003,7 +2961,32 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" dependencies = [ - "semver", + "semver 0.11.0", +] + +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64", + "log", + "ring", + "sct", + "webpki", +] + +[[package]] +name = "rustls-native-certs" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +dependencies = [ + "openssl-probe", + "rustls", + "schannel", + "security-framework", ] [[package]] @@ -2077,6 +3060,34 @@ dependencies = [ "safe-regex-compiler", ] +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys 0.36.1", +] + +[[package]] +name = "scheduled-thread-pool" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "977a7519bff143a44f842fd07e80ad1329295bd71686457f18e496736f4bf9bf" +dependencies = [ + "parking_lot", +] + [[package]] name = "scopeguard" version = "1.1.0" @@ -2089,12 +3100,77 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "seahash" version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "sec1" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08da66b8b0965a5555b6bd6639e68ccba85e1e2506f5fbb089e93f8a04e1a2d1" +dependencies = [ + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "secp256k1" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26947345339603ae8395f68e2f3d85a6b0a8ddfe6315818e80b8504415099db0" +dependencies = [ + "secp256k1-sys", + "serde", +] + +[[package]] +name = "secp256k1-sys" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "152e20a0fd0519390fc43ab404663af8a0b794273d2a91d60ad4a39f13ffe110" +dependencies = [ + "cc", +] + +[[package]] +name = "security-framework" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "0.11.0" @@ -2104,6 +3180,15 @@ dependencies = [ "semver-parser", ] +[[package]] +name = "semver" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +dependencies = [ + "serde", +] + [[package]] name = "semver-parser" version = "0.10.2" @@ -2131,6 +3216,16 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + [[package]] name = "serde_derive" version = "1.0.145" @@ -2164,6 +3259,30 @@ dependencies = [ "syn", ] +[[package]] +name = "sha-1" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99cd6713db3cf16b6c84e06321e049a9b9f699826e16096d23bbcc44d15d51a6" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.5", +] + [[package]] name = "sha2" version = "0.9.9" @@ -2210,23 +3329,70 @@ dependencies = [ ] [[package]] -name = "signature" -version = "1.6.4" +name = "signal-hook-registry" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" +dependencies = [ + "libc", +] [[package]] -name = "simple-error" -version = "0.2.3" +name = "signature" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" +dependencies = [ + "digest 0.9.0", + "rand_core 0.6.4", +] + +[[package]] +name = "simple-error" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc47a29ce97772ca5c927f75bac34866b16d64e07f330c3248e2d7226623901b" +[[package]] +name = "skeptic" +version = "0.13.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d23b015676c90a0f01c197bfdc786c20342c73a0afdda9025adb0bc42940a8" +dependencies = [ + "bytecount", + "cargo_metadata", + "error-chain", + "glob", + "pulldown-cmark", + "tempfile", + "walkdir", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + [[package]] name = "smallvec" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +[[package]] +name = "socket2" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "sp-std" version = "3.0.0" @@ -2244,12 +3410,34 @@ dependencies = [ "sha2 0.9.9", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spki" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d01ac02a6ccf3e07db148d2be087da624fea0221a16152ed01f0496a6b0a27" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "subtle" version = "2.4.1" @@ -2294,6 +3482,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + [[package]] name = "target-lexicon" version = "0.12.4" @@ -2325,10 +3519,12 @@ dependencies = [ "ed25519-dalek", "flex-error", "futures", + "k256", "num-traits", "once_cell", "prost", "prost-types", + "ripemd160", "serde", "serde_bytes", "serde_json", @@ -2342,6 +3538,40 @@ dependencies = [ "zeroize", ] +[[package]] +name = "tendermint-config" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=e6c684731f21bffd89886d3e91074b96aee074ba#e6c684731f21bffd89886d3e91074b96aee074ba" +dependencies = [ + "flex-error", + "serde", + "serde_json", + "tendermint", + "toml", + "url", +] + +[[package]] +name = "tendermint-light-client" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=e6c684731f21bffd89886d3e91074b96aee074ba#e6c684731f21bffd89886d3e91074b96aee074ba" +dependencies = [ + "contracts", + "crossbeam-channel 0.4.4", + "derive_more", + "flex-error", + "futures", + "serde", + "serde_cbor", + "serde_derive", + "static_assertions", + "tendermint", + "tendermint-light-client-verifier", + "tendermint-rpc", + "time", + "tokio", +] + [[package]] name = "tendermint-light-client-verifier" version = "0.23.6" @@ -2371,6 +3601,39 @@ dependencies = [ "time", ] +[[package]] +name = "tendermint-rpc" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=e6c684731f21bffd89886d3e91074b96aee074ba#e6c684731f21bffd89886d3e91074b96aee074ba" +dependencies = [ + "async-trait", + "async-tungstenite", + "bytes", + "flex-error", + "futures", + "getrandom 0.2.7", + "http", + "hyper", + "hyper-proxy", + "hyper-rustls", + "peg", + "pin-project", + "serde", + "serde_bytes", + "serde_json", + "subtle-encoding", + "tendermint", + "tendermint-config", + "tendermint-proto", + "thiserror", + "time", + "tokio", + "tracing", + "url", + "uuid 0.8.2", + "walkdir", +] + [[package]] name = "tendermint-testgen" version = "0.23.6" @@ -2452,6 +3715,140 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" +[[package]] +name = "tiny-bip39" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" +dependencies = [ + "anyhow", + "hmac 0.8.1", + "once_cell", + "pbkdf2", + "rand 0.7.3", + "rustc-hash", + "sha2 0.9.9", + "thiserror", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +dependencies = [ + "autocfg", + "bytes", + "libc", + "memchr", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "winapi", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +dependencies = [ + "rustls", + "tokio", + "webpki", +] + +[[package]] +name = "tokio-stream" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + [[package]] name = "toml" version = "0.5.9" @@ -2461,6 +3858,39 @@ dependencies = [ "serde", ] +[[package]] +name = "tonic" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" +dependencies = [ + "async-stream", + "async-trait", + "base64", + "bytes", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "prost-derive", + "rustls-native-certs", + "tokio", + "tokio-rustls", + "tokio-stream", + "tokio-util 0.6.10", + "tower", + "tower-layer", + "tower-service", + "tracing", + "tracing-futures", +] + [[package]] name = "tonic-build" version = "0.6.2" @@ -2473,6 +3903,38 @@ dependencies = [ "syn", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap", + "pin-project", + "pin-project-lite", + "rand 0.8.5", + "slab", + "tokio", + "tokio-util 0.7.4", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + [[package]] name = "tracing" version = "0.1.37" @@ -2506,6 +3968,16 @@ dependencies = [ "once_cell", ] +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "tracing-subscriber" version = "0.3.16" @@ -2521,6 +3993,37 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "triomphe" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1ee9bd9239c339d714d657fac840c6d2a4f9c45f4f9ec7b0975113458be78db" + +[[package]] +name = "try-lock" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" + +[[package]] +name = "tungstenite" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ada8297e8d70872fa9a551d93250a9f407beb9f37ef86494eb20012a2ff7c24" +dependencies = [ + "base64", + "byteorder", + "bytes", + "http", + "httparse", + "input_buffer", + "log", + "rand 0.8.5", + "sha-1", + "url", + "utf-8", +] + [[package]] name = "typenum" version = "1.15.0" @@ -2533,12 +4036,48 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" +[[package]] +name = "uint" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a45526d29728d135c2900b0d30573fe3ee79fceb12ef534c7bb30e810a91b601" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicase" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" +dependencies = [ + "version_check", +] + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + [[package]] name = "unicode-ident" version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-segmentation" version = "1.10.0" @@ -2557,6 +4096,44 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + +[[package]] +name = "uuid" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "feb41e78f93363bb2df8b0e86a2ca30eed7806ea16ea0c790d757cf93f79be83" +dependencies = [ + "getrandom 0.2.7", +] + [[package]] name = "version_check" version = "0.9.4" @@ -2572,6 +4149,39 @@ dependencies = [ "libc", ] +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +dependencies = [ + "log", + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.9.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" + +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2855,7 +4465,7 @@ dependencies = [ "indexmap", "libc", "loupe", - "memoffset", + "memoffset 0.6.5", "more-asserts", "region", "rkyv", @@ -2898,6 +4508,35 @@ dependencies = [ "wast", ] +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring", + "untrusted", +] + +[[package]] +name = "webpki-roots" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +dependencies = [ + "webpki", +] + [[package]] name = "wee_alloc" version = "0.4.5" @@ -2952,6 +4591,106 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" + [[package]] name = "zeroize" version = "1.5.7" diff --git a/wasm_for_tests/wasm_source/Cargo.toml b/wasm_for_tests/wasm_source/Cargo.toml index 07d4f3a491..61031c23a3 100644 --- a/wasm_for_tests/wasm_source/Cargo.toml +++ b/wasm_for_tests/wasm_source/Cargo.toml @@ -37,15 +37,20 @@ borsh = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4 borsh-derive = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"} borsh-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"} borsh-schema-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"} -# patched to a commit on the `eth-bridge-integration` branch of our fork +# patched to a commit on the `eth-bridge-integration+consensus-timeout` branch of our fork tendermint = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} +tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} +tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} tendermint-testgen = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} +tendermint-light-client = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} tendermint-light-client-verifier = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "e6c684731f21bffd89886d3e91074b96aee074ba"} # patched to a commit on the `eth-bridge-integration` branch of our fork ibc = {git = "https://github.com/heliaxdev/ibc-rs.git", rev = "f4703dfe2c1f25cc431279ab74f10f3e0f6827e2"} ibc-proto = {git = "https://github.com/heliaxdev/ibc-rs.git", rev = "f4703dfe2c1f25cc431279ab74f10f3e0f6827e2"} +ibc-relayer = {git = "https://github.com/heliaxdev/ibc-rs.git", rev = "f4703dfe2c1f25cc431279ab74f10f3e0f6827e2"} + [dev-dependencies] namada_tests = {path = "../../tests"}