diff --git a/.changelog/unreleased/bug-fixes/261-ibc-ack-ftt-coding.md b/.changelog/unreleased/bug-fixes/261-ibc-ack-ftt-coding.md new file mode 100644 index 0000000000..06b7b0c279 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/261-ibc-ack-ftt-coding.md @@ -0,0 +1,2 @@ +- Fix compatiblity of IBC Acknowledgement message and FungibleTokenData with + ibc-go ([#261](https://github.com/anoma/namada/pull/261)) \ No newline at end of file diff --git a/.changelog/unreleased/bug-fixes/298-fix-header-hash.md b/.changelog/unreleased/bug-fixes/298-fix-header-hash.md new file mode 100644 index 0000000000..b761e0a385 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/298-fix-header-hash.md @@ -0,0 +1,2 @@ +- Fix the block header merkle root hash for response to finalizing block. + ([#298](https://github.com/anoma/namada/pull/298)) \ No newline at end of file diff --git a/.changelog/unreleased/bug-fixes/625-ibc-ics20-transfer.md b/.changelog/unreleased/bug-fixes/625-ibc-ics20-transfer.md new file mode 100644 index 0000000000..3f06e49e38 --- /dev/null +++ b/.changelog/unreleased/bug-fixes/625-ibc-ics20-transfer.md @@ -0,0 +1,2 @@ +- Fix IBC token transfer to comply with ICS20. + ([#625](https://github.com/anoma/namada/pull/625)) \ No newline at end of file diff --git a/.changelog/unreleased/features/626-ibc-transfer-cmd.md b/.changelog/unreleased/features/626-ibc-transfer-cmd.md new file mode 100644 index 0000000000..23fd574b3b --- /dev/null +++ b/.changelog/unreleased/features/626-ibc-transfer-cmd.md @@ -0,0 +1,2 @@ +- Add client command 'ibc-transfer'. + ([#626](https://github.com/anoma/namada/pull/626)) \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index 34ab8ab550..c404e32e92 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]] @@ -3098,6 +3464,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", @@ -3110,7 +3479,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", @@ -3148,6 +3522,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" @@ -3187,7 +3570,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -3200,7 +3583,7 @@ dependencies = [ "cc", "cfg-if 1.0.0", "libc", - "memoffset", + "memoffset 0.6.5", ] [[package]] @@ -3277,6 +3660,7 @@ dependencies = [ "autocfg 1.1.0", "num-integer", "num-traits 0.2.15", + "serde 1.0.145", ] [[package]] @@ -3330,6 +3714,7 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.15", + "serde 1.0.145", ] [[package]] @@ -3559,6 +3944,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" @@ -3655,6 +4049,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" @@ -3863,6 +4268,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" @@ -3874,6 +4290,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" @@ -4081,6 +4513,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.1" @@ -4099,7 +4540,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", @@ -4129,6 +4570,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" @@ -4233,6 +4685,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" @@ -4481,6 +4950,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" @@ -4509,6 +4987,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" @@ -4550,6 +5060,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" @@ -4601,6 +5120,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" @@ -4767,9 +5296,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" @@ -4777,6 +5310,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" @@ -4835,6 +5383,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" @@ -4924,6 +5482,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" @@ -4994,10 +5558,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", @@ -5037,6 +5603,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=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" +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" @@ -5125,7 +5712,7 @@ dependencies = [ "tokio", "tracing 0.1.37", "url 2.3.1", - "uuid", + "uuid 0.8.2", "walkdir", ] @@ -5158,7 +5745,7 @@ dependencies = [ "tokio", "tracing 0.1.37", "url 2.3.1", - "uuid", + "uuid 0.8.2", "walkdir", ] @@ -5296,6 +5883,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" @@ -5554,7 +6169,9 @@ dependencies = [ "pin-project", "prost", "prost-derive", + "rustls-native-certs", "tokio", + "tokio-rustls", "tokio-stream", "tokio-util 0.6.10", "tower", @@ -5806,6 +6423,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" @@ -5849,6 +6472,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" @@ -5955,6 +6590,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" @@ -6338,7 +6982,7 @@ dependencies = [ "indexmap", "libc", "loupe", - "memoffset", + "memoffset 0.6.5", "more-asserts", "region", "rkyv", diff --git a/Cargo.toml b/Cargo.toml index 4d63512550..424124b587 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 = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} tendermint-testgen = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} +tendermint-light-client = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} tendermint-light-client-verifier = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} # 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 b87cdb5c66..5b084c842e 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 ccde0c3618..cda1e8bc63 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::TxInitNft(_) | cli::cmds::Anoma::TxMintNft(_) diff --git a/apps/src/lib/cli.rs b/apps/src/lib/cli.rs index 8e4c7f78c9..9e3d783050 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), TxInitNft(TxInitNft), TxMintNft(TxMintNft), @@ -61,6 +62,7 @@ pub mod cmds { .subcommand(Ledger::def()) .subcommand(TxCustom::def()) .subcommand(TxTransfer::def()) + .subcommand(TxIbcTransfer::def()) .subcommand(TxUpdateVp::def()) .subcommand(TxInitNft::def()) .subcommand(TxMintNft::def()) @@ -75,6 +77,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_nft_create = SubCmd::parse(matches).map(Self::TxInitNft); let tx_nft_mint = SubCmd::parse(matches).map(Self::TxMintNft); @@ -87,6 +91,7 @@ pub mod cmds { .or(ledger) .or(tx_custom) .or(tx_transfer) + .or(tx_ibc_transfer) .or(tx_update_vp) .or(tx_nft_create) .or(tx_nft_mint) @@ -152,6 +157,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)) @@ -184,6 +190,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 = @@ -213,6 +220,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) @@ -271,6 +279,7 @@ pub mod cmds { // Ledger cmds TxCustom(TxCustom), TxTransfer(TxTransfer), + TxIbcTransfer(TxIbcTransfer), QueryResult(QueryResult), TxUpdateVp(TxUpdateVp), TxInitAccount(TxInitAccount), @@ -794,6 +803,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); @@ -1248,6 +1276,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; @@ -1281,6 +1310,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( @@ -1318,6 +1348,10 @@ pub mod args { const NET_ADDRESS: Arg = arg("net-address"); const NFT_ADDRESS: Arg
= arg("nft-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"); @@ -1328,6 +1362,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 = @@ -1340,6 +1375,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"); @@ -1515,6 +1552,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 6c1e3fb5f3..bc9f6e75ff 100644 --- a/apps/src/lib/client/rpc.rs +++ b/apps/src/lib/client/rpc.rs @@ -29,13 +29,15 @@ 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::abci::Code; +use crate::facade::tendermint::block::Height; +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; @@ -1293,20 +1295,39 @@ pub async fn query_storage_value( where T: BorshDeserialize, { + let (bytes, _proof) = + query_storage_value_bytes(client, key, None, false).await; + match bytes { + Some(b) => match T::try_from_slice(&b[..]) { + Ok(value) => Some(value), + Err(err) => { + eprintln!("Error decoding the value: {}", err); + cli::safe_exit(1) + } + }, + None => None, + } +} + +/// 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 path = Path::Value(key.to_owned()); let data = vec![]; + let height = height.map(|h| Height::try_from(h.0).unwrap()); let response = client - .abci_query(Some(path.into()), data, None, false) + .abci_query(Some(path.into()), data, height, prove) .await .unwrap(); match response.code { - Code::Ok => match T::try_from_slice(&response.value[..]) { - Ok(value) => return Some(value), - Err(err) => eprintln!("Error decoding the value: {}", err), - }, + Code::Ok => return (Some(response.value), response.proof), Code::Err(err) => { if err == 1 { - return None; + return (None, response.proof); } else { eprintln!( "Error in the query {} (error code {})", diff --git a/apps/src/lib/client/tx.rs b/apps/src/lib/client/tx.rs index e749a681c6..c5e0ae9a2b 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; @@ -17,7 +23,8 @@ use namada::types::governance::{ }; use namada::types::key::*; use namada::types::nft::{self, Nft, NftToken}; -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, }; @@ -49,6 +56,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 TX_INIT_NFT: &str = "tx_init_nft.wasm"; const TX_MINT_NFT: &str = "tx_mint_nft.wasm"; const VP_USER_WASM: &str = "vp_user.wasm"; @@ -465,6 +473,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_nft(ctx: Context, args: args::NftCreate) { let file = File::open(&args.nft_data).expect("File must exist."); let nft: Nft = serde_json::from_reader(file) 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/protocol/mod.rs b/apps/src/lib/node/ledger/protocol/mod.rs index ed776fe21a..66f7384303 100644 --- a/apps/src/lib/node/ledger/protocol/mod.rs +++ b/apps/src/lib/node/ledger/protocol/mod.rs @@ -336,7 +336,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/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 b5dec0293c..930d8df870 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/storage/mod.rs b/shared/src/ledger/storage/mod.rs index 16c3ecf180..2681b1e5e3 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 6f047730fe..a503b796f0 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), + &xan() + ); + 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 dc3bf7b8aa..2aa8070a83 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 705c822760..faf1697d1a 100644 --- a/tests/src/e2e/helpers.rs +++ b/tests/src/e2e/helpers.rs @@ -12,6 +12,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::{Test, ENV_VAR_DEBUG, ENV_VAR_USE_PREBUILT_BINARIES}; @@ -54,6 +55,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..2522220524 --- /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, + XAN, + &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, XAN)?; + // 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", + XAN, + "--sub-prefix", + &sub_prefix, + "--amount", + "50000", + "--fee-amount", + "0", + "--gas-limit", + "0", + "--fee-token", + XAN, + "--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, XAN)?.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, + XAN, + &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, + XAN, + &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, + XAN, + &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, + XAN, + &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", + XAN, + "--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, XAN)?; + + // Check the balances on Chain A + let rpc_a = get_actor_rpc(test_a, &Who::Validator(0)); + let query_args = + vec!["balance", "--token", XAN, "--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", + XAN, + "--sub-prefix", + &sub_prefix, + "--ledger-address", + &rpc_b, + ]; + let expected = format!("XAN 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, XAN)?; + 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", + XAN, + "--sub-prefix", + &sub_prefix, + "--ledger-address", + &rpc, + ]; + let expected = format!("XAN 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", + XAN, + "--sub-prefix", + &sub_prefix, + "--ledger-address", + &rpc, + ]; + let expected = format!("XAN 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, XAN)?; + + // Check the balances on Chain A + let rpc_a = get_actor_rpc(test_a, &Who::Validator(0)); + let query_args = + vec!["balance", "--token", XAN, "--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", + XAN, + "--sub-prefix", + &sub_prefix, + "--ledger-address", + &rpc_b, + ]; + let expected = format!("XAN 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/ledger_tests.rs b/tests/src/e2e/ledger_tests.rs index a998844764..645b34d228 100644 --- a/tests/src/e2e/ledger_tests.rs +++ b/tests/src/e2e/ledger_tests.rs @@ -27,7 +27,7 @@ use super::setup::get_all_wasms_hashes; use crate::e2e::helpers::{ find_address, find_voting_power, get_actor_rpc, get_epoch, }; -use crate::e2e::setup::{self, sleep, Bin, Who}; +use crate::e2e::setup::{self, default_port_offset, sleep, Bin, Who}; use crate::{run, run_as}; /// Test that when we "run-ledger" with all the possible command @@ -64,8 +64,10 @@ fn run_ledger() -> Result<()> { #[test] fn test_node_connectivity() -> Result<()> { // Setup 2 genesis validator nodes - let test = - setup::network(|genesis| setup::add_validators(1, genesis), None)?; + let test = setup::network( + |genesis| setup::set_validators(2, genesis, default_port_offset), + None, + )?; // 1. Run 2 genesis validator ledger nodes and 1 non-validator node let args = ["ledger"]; @@ -1669,7 +1671,7 @@ fn test_genesis_validators() -> Result<()> { config.validator_vp = Some("vp_user".into()); config.staking_reward_vp = Some("vp_user".into()); // Setup the validator ports same as what - // `setup::add_validators` would do + // `setup::set_validators` would do let mut net_address = net_address_0; // 6 ports for each validator let first_port = get_first_port(ix); @@ -1908,8 +1910,10 @@ fn double_signing_gets_slashed() -> Result<()> { use namada_apps::config::Config; // Setup 2 genesis validator nodes - let test = - setup::network(|genesis| setup::add_validators(1, genesis), None)?; + let test = setup::network( + |genesis| setup::set_validators(2, genesis, default_port_offset), + None, + )?; // 1. Run 2 genesis validator ledger nodes let args = ["ledger"]; diff --git a/tests/src/e2e/setup.rs b/tests/src/e2e/setup.rs index b20f14d54f..96c0398d90 100644 --- a/tests/src/e2e/setup.rs +++ b/tests/src/e2e/setup.rs @@ -48,7 +48,7 @@ pub const ENV_VAR_USE_PREBUILT_BINARIES: &str = /// The E2E tests genesis config source. /// This file must contain a single validator with alias "validator-0". -/// To add more validators, use the [`add_validators`] function in the call to +/// To add more validators, use the [`set_validators`] function in the call to /// setup the [`network`]. pub const SINGLE_NODE_NET_GENESIS: &str = "genesis/e2e-tests-single-node.toml"; /// An E2E test network. @@ -57,13 +57,28 @@ pub struct Network { pub chain_id: ChainId, } -/// 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 -/// network with 2 validators. +/// Offset the ports used in the network configuration to avoid shared resources +pub const ANOTHER_CHAIN_PORT_OFFSET: u16 = 1000; + +/// Default functions for offsetting ports when +/// adding multiple validators to a network +pub fn default_port_offset(ix: u8) -> u16 { + 6 * ix as u16 +} + +/// Set `num` validators to the genesis config. Note that called from inside +/// the [`network`]'s first argument's closure, e.g. `set_validators(2, _)` will +/// configure a network with 2 validators. /// /// INVARIANT: Do not call this function more than once on the same config. -pub fn add_validators(num: u8, mut genesis: GenesisConfig) -> GenesisConfig { +pub fn set_validators( + num: u8, + mut genesis: GenesisConfig, + port_offset: F, +) -> GenesisConfig +where + F: Fn(u8) -> u16, +{ let validator_0 = genesis.validator.get_mut("validator-0").unwrap(); // Clone the first validator before modifying it let other_validators = validator_0.clone(); @@ -75,10 +90,10 @@ pub fn add_validators(num: u8, mut genesis: GenesisConfig) -> GenesisConfig { let mut validator = other_validators.clone(); let mut net_address = net_address_0; // 6 ports for each validator - let first_port = net_address_port_0 + 6 * (ix as u16 + 1); + let first_port = net_address_port_0 + port_offset(ix); net_address.set_port(first_port); validator.net_address = Some(net_address.to_string()); - let name = format!("validator-{}", ix + 1); + let name = format!("validator-{}", ix); genesis.validator.insert(name, validator); } genesis @@ -89,8 +104,20 @@ 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( + |genesis| set_validators(1, genesis, |_| ANOTHER_CHAIN_PORT_OFFSET), + None, + )?, + )) +} + +/// 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 +810,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 f9030a471a..18cdaea41d 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" @@ -1377,7 +2088,7 @@ dependencies = [ "prost", "prost-types", "pwasm-utils", - "rand", + "rand 0.8.5", "rand_core 0.6.4", "rust_decimal", "serde", @@ -1425,6 +2136,9 @@ dependencies = [ "chrono", "concat-idents", "derivative", + "ibc", + "ibc-proto", + "ibc-relayer", "namada", "namada_tx_prelude", "namada_vp_prelude", @@ -1432,7 +2146,12 @@ dependencies = [ "serde_json", "sha2 0.9.9", "tempfile", + "tendermint", + "tendermint-config", + "tendermint-proto", + "tendermint-rpc", "test-log", + "tokio", "tracing", "tracing-subscriber", ] @@ -1474,7 +2193,7 @@ name = "namada_wasm" version = "0.8.1" dependencies = [ "borsh", - "getrandom", + "getrandom 0.2.7", "namada", "namada_tests", "namada_tx_prelude", @@ -1487,6 +2206,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" @@ -1496,6 +2224,7 @@ dependencies = [ "autocfg", "num-integer", "num-traits", + "serde", ] [[package]] @@ -1519,6 +2248,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" @@ -1580,6 +2322,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" @@ -1587,19 +2335,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]] @@ -1612,6 +2425,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" @@ -1624,6 +2457,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" @@ -1683,8 +2527,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", @@ -1764,6 +2608,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" @@ -1775,6 +2630,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" @@ -1796,6 +2667,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" @@ -1803,10 +2687,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" @@ -1822,6 +2716,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" @@ -1829,7 +2726,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]] @@ -1841,6 +2747,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" @@ -1859,9 +2774,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", ] @@ -1874,6 +2789,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" @@ -1941,6 +2867,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" @@ -2006,7 +2964,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]] @@ -2080,6 +3063,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" @@ -2092,12 +3103,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" @@ -2107,6 +3183,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" @@ -2134,6 +3219,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" @@ -2167,6 +3262,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" @@ -2213,23 +3332,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" @@ -2247,12 +3413,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" @@ -2297,6 +3485,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" @@ -2328,10 +3522,12 @@ dependencies = [ "ed25519-dalek", "flex-error", "futures", + "k256", "num-traits", "once_cell", "prost", "prost-types", + "ripemd160", "serde", "serde_bytes", "serde_json", @@ -2345,6 +3541,40 @@ dependencies = [ "zeroize", ] +[[package]] +name = "tendermint-config" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" +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=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" +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" @@ -2374,6 +3604,39 @@ dependencies = [ "time", ] +[[package]] +name = "tendermint-rpc" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" +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" @@ -2455,6 +3718,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" @@ -2464,6 +3861,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" @@ -2476,6 +3906,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" @@ -2509,6 +3971,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" @@ -2524,12 +3996,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.8.1" dependencies = [ "borsh", - "getrandom", + "getrandom 0.2.7", "namada_tests", "namada_tx_prelude", "wee_alloc", @@ -2547,12 +4050,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" @@ -2571,6 +4110,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" @@ -2582,7 +4159,7 @@ name = "vp_template" version = "0.8.1" dependencies = [ "borsh", - "getrandom", + "getrandom 0.2.7", "namada_tests", "namada_vp_prelude", "wee_alloc", @@ -2597,6 +4174,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" @@ -2880,7 +4490,7 @@ dependencies = [ "indexmap", "libc", "loupe", - "memoffset", + "memoffset 0.6.5", "more-asserts", "region", "rkyv", @@ -2923,6 +4533,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" @@ -2977,6 +4616,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 d6f164a445..9b3f4d54ef 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -15,13 +15,17 @@ borsh-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev 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 tendermint = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} +tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} +tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} tendermint-testgen = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} +tendermint-light-client = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} tendermint-light-client-verifier = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} # 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 01140354ba..1b7a96a5d3 100644 --- a/wasm/checksums.json +++ b/wasm/checksums.json @@ -1,18 +1,18 @@ { - "tx_bond.wasm": "tx_bond.38c037a51f9215c2be9c1b01f647251ffdc96a02a0c958c5d3db4ee36ccde43b.wasm", - "tx_ibc.wasm": "tx_ibc.5f86477029d987073ebfec66019dc991b0bb8b80717d4885b860f910916cbcdd.wasm", - "tx_init_account.wasm": "tx_init_account.8d901bce15d1ab63a591def00421183a651d4d5e09ace4291bf0a9044692741d.wasm", - "tx_init_nft.wasm": "tx_init_nft.1991808f44c1c24d4376a3d46b602bed27575f6c0359095c53f37b9225050ffc.wasm", - "tx_init_proposal.wasm": "tx_init_proposal.716cd08d59b26bd75815511f03e141e6ac27bc0b7d7be10a71b04559244722c2.wasm", - "tx_init_validator.wasm": "tx_init_validator.611edff2746f71cdaa7547a84a96676b555821f00af8375a28f8dab7ae9fc9fa.wasm", - "tx_mint_nft.wasm": "tx_mint_nft.3f20f1a86da43cc475ccc127428944bd177d40fbe2d2d1588c6fadd069cbe4b2.wasm", - "tx_transfer.wasm": "tx_transfer.5653340103a32e6685f9668ec24855f65ae17bcc43035c2559a13f5c47bb67af.wasm", - "tx_unbond.wasm": "tx_unbond.71e66ac6f792123a2aaafd60b3892d74a7d0e7a03c3ea34f15fea9089010b810.wasm", - "tx_update_vp.wasm": "tx_update_vp.6d291dadb43545a809ba33fe26582b7984c67c65f05e363a93dbc62e06a33484.wasm", - "tx_vote_proposal.wasm": "tx_vote_proposal.ff3def7b4bb0c46635bd6d544ac1745362757ce063feb8142d2ed9ab207f2a12.wasm", - "tx_withdraw.wasm": "tx_withdraw.ba1a743cf8914a353d7706777e0b1a37e20cd271b16e022fd3b50ad28971291f.wasm", - "vp_nft.wasm": "vp_nft.4471284b5c5f3e28c973f0a2ad2dde52ebe4a1dcd5dc15e93b380706fd0e35ea.wasm", - "vp_testnet_faucet.wasm": "vp_testnet_faucet.7d7eb09cddc7ae348417da623e21ec4a4f8c78f15ae12de5abe7087eeab1e0db.wasm", - "vp_token.wasm": "vp_token.4a5436f7519de15c80103557add57e8d06e766e1ec1f7a642ffca252be01c5d0.wasm", - "vp_user.wasm": "vp_user.729b18aab60e8ae09b75b5f067658f30459a5ccfcd34f909b88da96523681019.wasm" + "tx_bond.wasm": "tx_bond.ad65c08f6271c49032ce850a08ff4a8d5e70d3e6d975488a3f736e29b8058bbd.wasm", + "tx_ibc.wasm": "tx_ibc.816cdbe97b03a7c5e43dce435bb807a829a789fe30d9e697f82a06e1e8cbdc04.wasm", + "tx_init_account.wasm": "tx_init_account.927c09343efbaa03eda278a8022ca733dfb06882c57af0aded3f45d4adea2028.wasm", + "tx_init_nft.wasm": "tx_init_nft.529740634a1eb071221bf48a2fc26e785a170e9bdfd60ef92bf0427c51a1ee6b.wasm", + "tx_init_proposal.wasm": "tx_init_proposal.8116c64b5c60698d4414748f1231341c0656ce1cf36073ae2e81d6c53b46a39e.wasm", + "tx_init_validator.wasm": "tx_init_validator.83a1e32872254a2f082621f18a567e039afc896d98b7e1fb61c0ceb6c3e82eed.wasm", + "tx_mint_nft.wasm": "tx_mint_nft.bc71196d7cd472a0bd1c506de69b104726a27500e13b99869abd0938946a4cd6.wasm", + "tx_transfer.wasm": "tx_transfer.df032ea20af5b360e8bc061c4ea96db3ebbf271c4bf77967b11ef721fbdd9831.wasm", + "tx_unbond.wasm": "tx_unbond.de8584a9edb22352693a0ba676f59c5a5504b8150f159299982f79f764c1387b.wasm", + "tx_update_vp.wasm": "tx_update_vp.8520fee0dc4b7e1996c3c8eb9dc6ec633311eb6501ad3ae9767fe3277c97ed04.wasm", + "tx_vote_proposal.wasm": "tx_vote_proposal.473fbfcffbd136135a54780770dbb7ae9adeb606b68c0d5c61526dad586f2fa1.wasm", + "tx_withdraw.wasm": "tx_withdraw.21760498f5a2306df71a2e5118e69458bcaea2285126ab37c269d7f1353ea6a5.wasm", + "vp_nft.wasm": "vp_nft.194b5d910ff01eef45d1099c0d86ec094e3fb9c528d8567fc3cb28db9114402c.wasm", + "vp_testnet_faucet.wasm": "vp_testnet_faucet.212b294a5d14d5dbe5548a89ce94063b42219b5c8e00e95755762b0b2b52d31f.wasm", + "vp_token.wasm": "vp_token.9462c685d177e4b74b004a115b33d6abd77847d4de264e533cac74b2b2ea875c.wasm", + "vp_user.wasm": "vp_user.ef037d2d7252b44accaa7212cea703b343f49fbfcd3aa426c1a74fb3b34b7650.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 b82f3b3d59..f3b65ed82b 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" @@ -1377,7 +2088,7 @@ dependencies = [ "prost", "prost-types", "pwasm-utils", - "rand", + "rand 0.8.5", "rand_core 0.6.4", "rust_decimal", "serde", @@ -1425,6 +2136,9 @@ dependencies = [ "chrono", "concat-idents", "derivative", + "ibc", + "ibc-proto", + "ibc-relayer", "namada", "namada_tx_prelude", "namada_vp_prelude", @@ -1432,7 +2146,12 @@ dependencies = [ "serde_json", "sha2 0.9.9", "tempfile", + "tendermint", + "tendermint-config", + "tendermint-proto", + "tendermint-rpc", "test-log", + "tokio", "tracing", "tracing-subscriber", ] @@ -1474,13 +2193,22 @@ name = "namada_wasm_for_tests" version = "0.8.1" 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" @@ -1490,6 +2218,7 @@ dependencies = [ "autocfg", "num-integer", "num-traits", + "serde", ] [[package]] @@ -1513,6 +2242,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" @@ -1574,6 +2316,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" @@ -1581,19 +2329,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]] @@ -1606,6 +2419,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" @@ -1618,6 +2451,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" @@ -1677,8 +2521,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", @@ -1758,6 +2602,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" @@ -1769,6 +2624,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" @@ -1790,6 +2661,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" @@ -1797,10 +2681,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" @@ -1816,6 +2710,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" @@ -1823,7 +2720,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]] @@ -1835,6 +2741,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" @@ -1853,9 +2768,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", ] @@ -1868,6 +2783,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" @@ -1935,6 +2861,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" @@ -2000,7 +2958,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]] @@ -2074,6 +3057,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" @@ -2086,12 +3097,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" @@ -2101,6 +3177,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" @@ -2128,6 +3213,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" @@ -2161,6 +3256,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" @@ -2207,23 +3326,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" @@ -2241,12 +3407,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" @@ -2291,6 +3479,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" @@ -2322,10 +3516,12 @@ dependencies = [ "ed25519-dalek", "flex-error", "futures", + "k256", "num-traits", "once_cell", "prost", "prost-types", + "ripemd160", "serde", "serde_bytes", "serde_json", @@ -2339,6 +3535,40 @@ dependencies = [ "zeroize", ] +[[package]] +name = "tendermint-config" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" +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=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" +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" @@ -2368,6 +3598,39 @@ dependencies = [ "time", ] +[[package]] +name = "tendermint-rpc" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" +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" @@ -2449,6 +3712,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" @@ -2458,6 +3855,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" @@ -2470,6 +3900,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" @@ -2503,6 +3965,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" @@ -2518,6 +3990,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" @@ -2530,12 +4033,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" @@ -2554,6 +4093,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" @@ -2569,6 +4146,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" @@ -2852,7 +4462,7 @@ dependencies = [ "indexmap", "libc", "loupe", - "memoffset", + "memoffset 0.6.5", "more-asserts", "region", "rkyv", @@ -2895,6 +4505,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" @@ -2949,6 +4588,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 8d9f4f4dc9..98ff1dd5bb 100644 --- a/wasm_for_tests/wasm_source/Cargo.toml +++ b/wasm_for_tests/wasm_source/Cargo.toml @@ -39,13 +39,18 @@ borsh-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev 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 tendermint = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} +tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} +tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} tendermint-testgen = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} +tendermint-light-client = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} tendermint-light-client-verifier = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} # 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"}