diff --git a/.changelog/unreleased/improvements/510-shims-merge.md b/.changelog/unreleased/improvements/510-shims-merge.md new file mode 100644 index 0000000000..1268bf87e4 --- /dev/null +++ b/.changelog/unreleased/improvements/510-shims-merge.md @@ -0,0 +1,2 @@ +- Shim ABCI++ methods for tendermint + ([#510](https://github.com/anoma/namada/pull/510)) \ No newline at end of file diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 0d0112924e..1c4cbd3412 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -117,7 +117,7 @@ jobs: cache_key: anoma cache_version: v1 wait_for: anoma-release (ubuntu-latest, ABCI Release build, anoma-e2e-release, v1) - tendermint_artifact: tendermint-unreleased-559fb33ff9b27503ce7ac1c7d8589fe1d8b3e900 + tendermint_artifact: tendermint-unreleased-ad825dcadbd4b98c3f91ce5a711e4fb36a69c377 env: CARGO_INCREMENTAL: 0 diff --git a/.github/workflows/build-tendermint.yml b/.github/workflows/build-tendermint.yml index 91a5259dac..7914a39a49 100644 --- a/.github/workflows/build-tendermint.yml +++ b/.github/workflows/build-tendermint.yml @@ -21,9 +21,6 @@ jobs: matrix: os: [ubuntu-latest] make: - - name: tendermint-unreleased - repository: heliaxdev/tendermint - tendermint_version: 559fb33ff9b27503ce7ac1c7d8589fe1d8b3e900 - name: tendermint-unreleased repository: heliaxdev/tendermint tendermint_version: ad825dcadbd4b98c3f91ce5a711e4fb36a69c377 diff --git a/Cargo.lock b/Cargo.lock index 74fe790a69..fb31e45611 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,9 +316,9 @@ dependencies = [ [[package]] name = "async-std" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f06685bad74e0570f5213741bea82158279a4103d988e57bfada11ad230341" +checksum = "52580991739c5cdb36cde8b2a516371c0a3b70dda36d916cc08b82372916808c" dependencies = [ "async-channel", "async-global-executor", @@ -371,9 +371,9 @@ checksum = "7a40729d2133846d9ed0ea60a8b9541bccddab49cd30f0715a1da672fe9a2524" [[package]] name = "async-trait" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" +checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" dependencies = [ "proc-macro2", "quote", @@ -443,12 +443,6 @@ 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" @@ -696,9 +690,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "byte-tools" @@ -966,12 +960,6 @@ 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" @@ -1132,18 +1120,6 @@ 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" @@ -1164,16 +1140,6 @@ 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" @@ -1191,9 +1157,9 @@ dependencies = [ [[package]] name = "ctor" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdffe87e1d521a10f9696f833fe502293ea446d7f256c06128293a4119bdf4cb" +checksum = "6d2301688392eb071b0bf1a37be05c469d3cc4dbbd95df672fe28ab021e6a096" dependencies = [ "quote", "syn", @@ -1205,36 +1171,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" -[[package]] -name = "curl" -version = "0.4.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "509bd11746c7ac09ebd19f0b17782eae80aadee26237658a6b4808afb5c11a22" -dependencies = [ - "curl-sys", - "libc", - "openssl-probe", - "openssl-sys", - "schannel", - "socket2", - "winapi 0.3.9", -] - -[[package]] -name = "curl-sys" -version = "0.4.56+curl-7.83.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6093e169dd4de29e468fa649fbae11cdcd5551c81fe5bf1b0677adad7ef3d26f" -dependencies = [ - "cc", - "libc", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", - "winapi 0.3.9", -] - [[package]] name = "curve25519-dalek" version = "3.2.0" @@ -1263,9 +1199,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f39818dcfc97d45b03953c1292efc4e80954e1583c4aa770bac1383e2310a4" +checksum = "3f83d0ebf42c6eafb8d7c52f7e5f2d3003b89c7aa4fd2b79229209459a849af8" dependencies = [ "cc", "cxxbridge-flags", @@ -1275,9 +1211,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e580d70777c116df50c390d1211993f62d40302881e54d4b79727acb83d0199" +checksum = "07d050484b55975889284352b0ffc2ecbda25c0c55978017c132b29ba0818a86" dependencies = [ "cc", "codespan-reporting", @@ -1290,15 +1226,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56a46460b88d1cec95112c8c363f0e2c39afdb237f60583b0b36343bf627ea9c" +checksum = "99d2199b00553eda8012dfec8d3b1c75fce747cf27c169a270b3b99e3448ab78" [[package]] name = "cxxbridge-macro" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747b608fecf06b0d72d440f27acc99288207324b793be2c17991839f3d4995ea" +checksum = "dcb67a6de1f602736dd7eaead0080cf3435df806c61b24b13328db128c58868f" dependencies = [ "proc-macro2", "quote", @@ -1345,15 +1281,6 @@ 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" @@ -1455,18 +1382,6 @@ 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" @@ -1514,24 +1429,6 @@ 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" @@ -1693,16 +1590,6 @@ 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" @@ -1735,7 +1622,7 @@ dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall 0.2.16", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1830,9 +1717,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" dependencies = [ "futures-channel", "futures-core", @@ -1845,9 +1732,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", "futures-sink", @@ -1855,15 +1742,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-executor" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ "futures-core", "futures-task", @@ -1872,9 +1759,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-lite" @@ -1893,9 +1780,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", @@ -1904,21 +1791,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-util" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-channel", "futures-core", @@ -2023,17 +1910,6 @@ 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" @@ -2180,17 +2056,7 @@ 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", + "crypto-mac", "digest 0.9.0", ] @@ -2202,7 +2068,7 @@ checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", "generic-array 0.14.6", - "hmac 0.8.1", + "hmac", ] [[package]] @@ -2289,7 +2155,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca815a891b24fdfb243fa3239c86154392b0953ee584aa1a2a1f66d20cbe75cc" dependencies = [ "bytes 1.2.1", - "futures 0.3.24", + "futures 0.3.25", "headers", "http", "hyper 0.14.20", @@ -2360,9 +2226,9 @@ dependencies = [ [[package]] name = "iana-time-zone-haiku" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde6edd6cef363e9359ed3c98ba64590ba9eecba2293eb5a723ab32aee8926aa" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" dependencies = [ "cxx", "cxx-build", @@ -2376,7 +2242,7 @@ dependencies = [ "bytes 1.2.1", "derive_more", "flex-error", - "ibc-proto", + "ibc-proto 0.17.1 (git+https://github.com/heliaxdev/ibc-rs?rev=9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d)", "ics23", "num-traits 0.2.15", "prost", @@ -2387,10 +2253,37 @@ dependencies = [ "serde_json", "sha2 0.10.6", "subtle-encoding", - "tendermint", - "tendermint-light-client-verifier", - "tendermint-proto", - "tendermint-testgen", + "tendermint 0.23.5", + "tendermint-light-client-verifier 0.23.5", + "tendermint-proto 0.23.5", + "tendermint-testgen 0.23.5", + "time 0.3.15", + "tracing 0.1.37", +] + +[[package]] +name = "ibc" +version = "0.14.0" +source = "git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2#f4703dfe2c1f25cc431279ab74f10f3e0f6827e2" +dependencies = [ + "bytes 1.2.1", + "derive_more", + "flex-error", + "ibc-proto 0.17.1 (git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2)", + "ics23", + "num-traits 0.2.15", + "prost", + "prost-types", + "safe-regex", + "serde 1.0.145", + "serde_derive", + "serde_json", + "sha2 0.10.6", + "subtle-encoding", + "tendermint 0.23.6", + "tendermint-light-client-verifier 0.23.6", + "tendermint-proto 0.23.6", + "tendermint-testgen 0.23.6", "time 0.3.15", "tracing 0.1.37", ] @@ -2405,7 +2298,20 @@ dependencies = [ "prost", "prost-types", "serde 1.0.145", - "tendermint-proto", + "tendermint-proto 0.23.5", +] + +[[package]] +name = "ibc-proto" +version = "0.17.1" +source = "git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2#f4703dfe2c1f25cc431279ab74f10f3e0f6827e2" +dependencies = [ + "base64 0.13.0", + "bytes 1.2.1", + "prost", + "prost-types", + "serde 1.0.145", + "tendermint-proto 0.23.6", ] [[package]] @@ -2548,19 +2454,6 @@ 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" @@ -2974,7 +2867,7 @@ dependencies = [ "libc", "log 0.4.17", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -3035,8 +2928,10 @@ dependencies = [ "ferveo", "ferveo-common", "group-threshold-cryptography", - "ibc", - "ibc-proto", + "ibc 0.14.0 (git+https://github.com/heliaxdev/ibc-rs?rev=9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d)", + "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?rev=9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d)", + "ibc-proto 0.17.1 (git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2)", "ics23", "itertools", "libsecp256k1", @@ -3056,8 +2951,10 @@ dependencies = [ "sha2 0.9.9", "sparse-merkle-tree", "tempfile", - "tendermint", - "tendermint-proto", + "tendermint 0.23.5", + "tendermint 0.23.6", + "tendermint-proto 0.23.5", + "tendermint-proto 0.23.6", "test-log", "thiserror", "tonic-build", @@ -3092,7 +2989,6 @@ dependencies = [ "clap", "color-eyre", "config", - "curl", "data-encoding", "derivative", "ed25519-consensus", @@ -3101,7 +2997,7 @@ dependencies = [ "ferveo-common", "file-lock", "flate2", - "futures 0.3.24", + "futures 0.3.25", "git2", "itertools", "jsonpath_lib", @@ -3133,10 +3029,14 @@ dependencies = [ "sysinfo", "tar", "tempfile", - "tendermint", - "tendermint-config", - "tendermint-proto", - "tendermint-rpc", + "tendermint 0.23.5", + "tendermint 0.23.6", + "tendermint-config 0.23.5", + "tendermint-config 0.23.6", + "tendermint-proto 0.23.5", + "tendermint-proto 0.23.6", + "tendermint-rpc 0.23.5", + "tendermint-rpc 0.23.6", "test-log", "thiserror", "tokio", @@ -3144,7 +3044,8 @@ dependencies = [ "toml", "tonic", "tower", - "tower-abci", + "tower-abci 0.1.0 (git+https://github.com/heliaxdev/tower-abci?rev=f6463388fc319b6e210503b43b3aecf6faf6b200)", + "tower-abci 0.1.0 (git+https://github.com/heliaxdev/tower-abci.git?rev=fcc0014d0bda707109901abfa1b2f782d242f082)", "tracing 0.1.37", "tracing-log", "tracing-subscriber 0.3.16", @@ -3267,9 +3168,9 @@ dependencies = [ [[package]] name = "net2" -version = "0.2.37" +version = "0.2.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" +checksum = "74d0df99cfcd2530b2e694f6e17e7f37b8e26bb23983ac530c0c97408837c631" dependencies = [ "cfg-if 0.1.10", "libc", @@ -3621,7 +3522,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api 0.4.9", - "parking_lot_core 0.9.3", + "parking_lot_core 0.9.4", ] [[package]] @@ -3641,15 +3542,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ "cfg-if 1.0.0", "libc", "redox_syscall 0.2.16", "smallvec 1.10.0", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -3854,9 +3755,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.46" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] @@ -4332,17 +4233,6 @@ dependencies = [ "winreg", ] -[[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" @@ -4588,7 +4478,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -4619,18 +4509,6 @@ 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", - "subtle", - "zeroize", -] - [[package]] name = "security-framework" version = "2.3.1" @@ -4736,9 +4614,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" +checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" dependencies = [ "indexmap", "itoa", @@ -4889,13 +4767,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.4.0" +version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" -dependencies = [ - "digest 0.9.0", - "rand_core 0.6.4", -] +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" [[package]] name = "simple-error" @@ -5091,13 +4965,39 @@ dependencies = [ "ed25519", "ed25519-dalek", "flex-error", - "futures 0.3.24", - "k256", + "futures 0.3.25", + "num-traits 0.2.15", + "once_cell", + "prost", + "prost-types", + "serde 1.0.145", + "serde_bytes", + "serde_json", + "serde_repr", + "sha2 0.9.9", + "signature", + "subtle", + "subtle-encoding", + "tendermint-proto 0.23.5", + "time 0.3.15", + "zeroize", +] + +[[package]] +name = "tendermint" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" +dependencies = [ + "async-trait", + "bytes 1.2.1", + "ed25519", + "ed25519-dalek", + "flex-error", + "futures 0.3.25", "num-traits 0.2.15", "once_cell", "prost", "prost-types", - "ripemd160", "serde 1.0.145", "serde_bytes", "serde_json", @@ -5106,7 +5006,7 @@ dependencies = [ "signature", "subtle", "subtle-encoding", - "tendermint-proto", + "tendermint-proto 0.23.6", "time 0.3.15", "zeroize", ] @@ -5119,7 +5019,20 @@ dependencies = [ "flex-error", "serde 1.0.145", "serde_json", - "tendermint", + "tendermint 0.23.5", + "toml", + "url 2.3.1", +] + +[[package]] +name = "tendermint-config" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" +dependencies = [ + "flex-error", + "serde 1.0.145", + "serde_json", + "tendermint 0.23.6", "toml", "url 2.3.1", ] @@ -5132,8 +5045,20 @@ dependencies = [ "derive_more", "flex-error", "serde 1.0.145", - "tendermint", - "tendermint-rpc", + "tendermint 0.23.5", + "tendermint-rpc 0.23.5", + "time 0.3.15", +] + +[[package]] +name = "tendermint-light-client-verifier" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" +dependencies = [ + "derive_more", + "flex-error", + "serde 1.0.145", + "tendermint 0.23.6", "time 0.3.15", ] @@ -5154,6 +5079,23 @@ dependencies = [ "time 0.3.15", ] +[[package]] +name = "tendermint-proto" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" +dependencies = [ + "bytes 1.2.1", + "flex-error", + "num-derive", + "num-traits 0.2.15", + "prost", + "prost-types", + "serde 1.0.145", + "serde_bytes", + "subtle-encoding", + "time 0.3.15", +] + [[package]] name = "tendermint-rpc" version = "0.23.5" @@ -5163,7 +5105,7 @@ dependencies = [ "async-tungstenite", "bytes 1.2.1", "flex-error", - "futures 0.3.24", + "futures 0.3.25", "getrandom 0.2.7", "http", "hyper 0.14.20", @@ -5175,9 +5117,42 @@ dependencies = [ "serde_bytes", "serde_json", "subtle-encoding", - "tendermint", - "tendermint-config", - "tendermint-proto", + "tendermint 0.23.5", + "tendermint-config 0.23.5", + "tendermint-proto 0.23.5", + "thiserror", + "time 0.3.15", + "tokio", + "tracing 0.1.37", + "url 2.3.1", + "uuid", + "walkdir", +] + +[[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 1.2.1", + "flex-error", + "futures 0.3.25", + "getrandom 0.2.7", + "http", + "hyper 0.14.20", + "hyper-proxy", + "hyper-rustls", + "peg", + "pin-project", + "serde 1.0.145", + "serde_bytes", + "serde_json", + "subtle-encoding", + "tendermint 0.23.6", + "tendermint-config 0.23.6", + "tendermint-proto 0.23.6", "thiserror", "time 0.3.15", "tokio", @@ -5198,7 +5173,22 @@ dependencies = [ "serde_json", "simple-error", "tempfile", - "tendermint", + "tendermint 0.23.5", + "time 0.3.15", +] + +[[package]] +name = "tendermint-testgen" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" +dependencies = [ + "ed25519-dalek", + "gumdrop", + "serde 1.0.145", + "serde_json", + "simple-error", + "tempfile", + "tendermint 0.23.6", "time 0.3.15", ] @@ -5613,10 +5603,28 @@ version = "0.1.0" source = "git+https://github.com/heliaxdev/tower-abci?rev=f6463388fc319b6e210503b43b3aecf6faf6b200#f6463388fc319b6e210503b43b3aecf6faf6b200" dependencies = [ "bytes 1.2.1", - "futures 0.3.24", + "futures 0.3.25", "pin-project", "prost", - "tendermint-proto", + "tendermint-proto 0.23.5", + "tokio", + "tokio-stream", + "tokio-util 0.6.10", + "tower", + "tracing 0.1.30", + "tracing-tower", +] + +[[package]] +name = "tower-abci" +version = "0.1.0" +source = "git+https://github.com/heliaxdev/tower-abci.git?rev=fcc0014d0bda707109901abfa1b2f782d242f082#fcc0014d0bda707109901abfa1b2f782d242f082" +dependencies = [ + "bytes 1.2.1", + "futures 0.3.25", + "pin-project", + "prost", + "tendermint-proto 0.23.6", "tokio", "tokio-stream", "tokio-util 0.6.10", @@ -5783,7 +5791,7 @@ name = "tracing-tower" version = "0.1.0" source = "git+https://github.com/tokio-rs/tracing/?tag=tracing-0.1.30#df4ba17d857db8ba1b553f7b293ac8ba967a42f8" dependencies = [ - "futures 0.3.24", + "futures 0.3.25", "pin-project-lite", "tower-layer", "tower-make", @@ -6532,6 +6540,27 @@ dependencies = [ "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.29.0" @@ -6544,6 +6573,12 @@ 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.29.0" @@ -6556,6 +6591,12 @@ 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.29.0" @@ -6568,6 +6609,12 @@ 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.29.0" @@ -6580,6 +6627,18 @@ 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.29.0" @@ -6592,6 +6651,12 @@ 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 = "winreg" version = "0.10.1" diff --git a/Cargo.toml b/Cargo.toml index 08fed3a846..4d63512550 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,6 +34,21 @@ async-process = {git = "https://github.com/heliaxdev/async-process.git", rev = " # borsh-derive-internal = {path = "../borsh-rs/borsh-derive-internal"} # borsh-schema-derive-internal = {path = "../borsh-rs/borsh-schema-derive-internal"} +# 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-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"} + +# 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"} + [profile.release] lto = true opt-level = 3 diff --git a/Makefile b/Makefile index 292344f865..b2d0393df9 100644 --- a/Makefile +++ b/Makefile @@ -49,6 +49,26 @@ clippy: make -C $(wasms_for_tests) clippy && \ $(foreach wasm,$(wasm_templates),$(clippy-wasm) && ) true +clippy-abcipp: + ANOMA_DEV=false $(cargo) +$(nightly) clippy --all-targets \ + --manifest-path ./apps/Cargo.toml \ + --no-default-features \ + --features "std testing abcipp" && \ + $(cargo) +$(nightly) clippy --all-targets \ + --manifest-path ./proof_of_stake/Cargo.toml \ + --features "testing" && \ + $(cargo) +$(nightly) clippy --all-targets \ + --manifest-path ./shared/Cargo.toml \ + --no-default-features \ + --features "testing wasm-runtime abcipp ibc-mocks-abcipp" && \ + $(cargo) +$(nightly) clippy \ + --all-targets \ + --manifest-path ./vm_env/Cargo.toml \ + --no-default-features \ + --features "abcipp" && \ + make -C $(wasms) clippy && \ + $(foreach wasm,$(wasm_templates),$(clippy-wasm) && ) true + clippy-fix: $(cargo) +$(nightly) clippy --fix -Z unstable-options --all-targets --allow-dirty --allow-staged @@ -81,9 +101,35 @@ test-e2e: --test-threads=1 \ -Z unstable-options --report-time +test-unit-abcipp: + $(cargo) test \ + --manifest-path ./apps/Cargo.toml \ + --no-default-features \ + --features "testing std abcipp" \ + $(TEST_FILTER) -- \ + -Z unstable-options --report-time && \ + $(cargo) test \ + --manifest-path \ + ./proof_of_stake/Cargo.toml \ + --features "testing" \ + $(TEST_FILTER) -- \ + -Z unstable-options --report-time && \ + $(cargo) test \ + --manifest-path ./shared/Cargo.toml \ + --no-default-features \ + --features "testing wasm-runtime abcipp ibc-mocks-abcipp" \ + $(TEST_FILTER) -- \ + -Z unstable-options --report-time && \ + $(cargo) test \ + --manifest-path ./vm_env/Cargo.toml \ + --no-default-features \ + --features "abcipp" \ + $(TEST_FILTER) -- \ + -Z unstable-options --report-time + test-unit: $(cargo) test \ - -- \ + $(TEST_FILTER) -- \ --skip e2e \ -Z unstable-options --report-time @@ -172,4 +218,4 @@ test-miri: MIRIFLAGS="-Zmiri-disable-isolation" $(cargo) +$(nightly) miri test -.PHONY : build check build-release clippy install run-ledger run-gossip reset-ledger test test-debug fmt watch clean build-doc doc build-wasm-scripts-docker debug-wasm-scripts-docker build-wasm-scripts debug-wasm-scripts clean-wasm-scripts dev-deps test-miri +.PHONY : build check build-release clippy install run-ledger run-gossip reset-ledger test test-debug fmt watch clean build-doc doc build-wasm-scripts-docker debug-wasm-scripts-docker build-wasm-scripts debug-wasm-scripts clean-wasm-scripts dev-deps test-miri test-unit test-unit-abcipp clippy-abcipp diff --git a/apps/Cargo.toml b/apps/Cargo.toml index 47fe704408..0192b991f3 100644 --- a/apps/Cargo.toml +++ b/apps/Cargo.toml @@ -39,19 +39,37 @@ name = "namadaw" path = "src/bin/anoma-wallet/main.rs" [features] -default = ["std"] +default = ["std", "abciplus"] dev = ["namada/dev"] std = ["ed25519-consensus/std", "rand/std", "rand_core/std"] # for integration tests and test utilies testing = ["dev"] +abcipp = [ + "tendermint-abcipp", + "tendermint-config-abcipp", + "tendermint-proto-abcipp", + "tendermint-rpc-abcipp", + "tower-abci-abcipp", + "namada/abcipp" +] + +abciplus = [ + "tendermint", + "tendermint-config", + "tendermint-rpc", + "tendermint-proto", + "tower-abci", + "namada/abciplus" +] + [dependencies] namada = {path = "../shared", features = ["wasm-runtime", "ferveo-tpke", "rand", "secp256k1-sign-verify"]} ark-serialize = "0.3.0" ark-std = "0.3.0" # branch = "bat/arse-merkle-tree" arse-merkle-tree = {package = "sparse-merkle-tree", git = "https://github.com/heliaxdev/sparse-merkle-tree", rev = "04ad1eeb28901b57a7599bbe433b3822965dabe8", features = ["std", "borsh"]} -async-std = {version = "=1.9.0", features = ["unstable"]} +async-std = {version = "=1.11.0", features = ["unstable"]} async-trait = "0.1.51" base64 = "0.13.0" bech32 = "0.8.0" @@ -63,7 +81,6 @@ byteorder = "1.4.2" clap = {git = "https://github.com/clap-rs/clap/", tag = "v3.0.0-beta.2", default-features = false, features = ["std", "suggestions", "color", "cargo"]} color-eyre = "0.5.10" config = "0.11.0" -curl = "0.4.43" data-encoding = "2.3.2" derivative = "2.2.0" ed25519-consensus = "1.2.0" @@ -101,10 +118,14 @@ signal-hook = "0.3.9" sysinfo = {version = "=0.21.1", default-features = false} tar = "0.4.37" # temporarily using fork work-around -tendermint = {git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", features = ["secp256k1"]} -tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9"} -tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9"} -tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", features = ["http-client", "websocket-client"]} +tendermint-abcipp = {package = "tendermint", git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", optional = true} +tendermint-config-abcipp = {package = "tendermint-config", git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", optional = true} +tendermint-proto-abcipp = {package = "tendermint-proto", git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", optional = true} +tendermint-rpc-abcipp = {package = "tendermint-rpc", git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", features = ["http-client", "websocket-client"], optional = true} +tendermint = {version = "0.23.6", optional = true} +tendermint-config = {version = "0.23.6", optional = true} +tendermint-proto = {version = "0.23.6", optional = true} +tendermint-rpc = {version = "0.23.6", features = ["http-client", "websocket-client"], optional = true} thiserror = "1.0.30" tokio = {version = "1.8.2", features = ["full"]} toml = "0.5.8" @@ -112,7 +133,8 @@ tonic = "0.6.1" tower = "0.4" # Also, using the same version of tendermint-rs as we do here. # with a patch for https://github.com/penumbra-zone/tower-abci/issues/7. -tower-abci = {git = "https://github.com/heliaxdev/tower-abci", rev = "f6463388fc319b6e210503b43b3aecf6faf6b200"} +tower-abci-abcipp = {package = "tower-abci", git = "https://github.com/heliaxdev/tower-abci", rev = "f6463388fc319b6e210503b43b3aecf6faf6b200", optional = true} +tower-abci = {version = "0.1.0", optional = true} tracing = "0.1.30" tracing-log = "0.1.2" tracing-subscriber = {version = "0.3.7", features = ["env-filter"]} diff --git a/apps/src/lib/cli.rs b/apps/src/lib/cli.rs index 4534d5bc0d..ca944bf3d0 100644 --- a/apps/src/lib/cli.rs +++ b/apps/src/lib/cli.rs @@ -1255,14 +1255,14 @@ pub mod args { use namada::types::storage::{self, Epoch}; use namada::types::token; use namada::types::transaction::GasLimit; - use tendermint::Timeout; - use tendermint_config::net::Address as TendermintAddress; use super::context::{WalletAddress, WalletKeypair, WalletPublicKey}; use super::utils::*; use super::{ArgGroup, ArgMatches}; use crate::config; use crate::config::TendermintMode; + use crate::facade::tendermint::Timeout; + use crate::facade::tendermint_config::net::Address as TendermintAddress; const ADDRESS: Arg = arg("address"); const ALIAS_OPT: ArgOpt = ALIAS.opt(); diff --git a/apps/src/lib/client/mod.rs b/apps/src/lib/client/mod.rs index e27e575ce0..a909cf9120 100644 --- a/apps/src/lib/client/mod.rs +++ b/apps/src/lib/client/mod.rs @@ -2,6 +2,5 @@ pub mod rpc; pub mod signing; pub mod tendermint_rpc_types; mod tendermint_websocket_client; -mod tm_jsonrpc_client; pub mod tx; pub mod utils; diff --git a/apps/src/lib/client/rpc.rs b/apps/src/lib/client/rpc.rs index df0e89cf2d..6c1e3fb5f3 100644 --- a/apps/src/lib/client/rpc.rs +++ b/apps/src/lib/client/rpc.rs @@ -32,16 +32,16 @@ use namada::types::key::*; use namada::types::storage::{Epoch, Key, KeySeg, PrefixValue}; use namada::types::token::{balance_key, Amount}; use namada::types::{address, storage, token}; -use tendermint::abci::Code; -use tendermint_config::net::Address as TendermintAddress; -use tendermint_rpc::error::Error as TError; -use tendermint_rpc::query::Query; -use tendermint_rpc::{ - Client, HttpClient, Order, SubscriptionClient, WebSocketClient, -}; use crate::cli::{self, args, Context}; use crate::client::tendermint_rpc_types::TxResponse; +use crate::facade::tendermint::abci::Code; +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; +use crate::facade::tendermint_rpc::{ + Client, HttpClient, Order, SubscriptionClient, WebSocketClient, +}; use crate::node::ledger::rpc::Path; /// Query the epoch of the last committed block diff --git a/apps/src/lib/client/signing.rs b/apps/src/lib/client/signing.rs index dd86470403..fb87151c82 100644 --- a/apps/src/lib/client/signing.rs +++ b/apps/src/lib/client/signing.rs @@ -9,12 +9,12 @@ use namada::types::address::{Address, ImplicitAddress}; use namada::types::key::*; use namada::types::storage::Epoch; use namada::types::transaction::{hash_tx, Fee, WrapperTx}; -use tendermint_config::net::Address as TendermintAddress; use super::rpc; use crate::cli::context::WalletAddress; use crate::cli::{self, args, Context}; use crate::client::tendermint_rpc_types::TxBroadcastData; +use crate::facade::tendermint_config::net::Address as TendermintAddress; use crate::wallet::Wallet; /// Find the public key for the given address and try to load the keypair diff --git a/apps/src/lib/client/tendermint_rpc_types.rs b/apps/src/lib/client/tendermint_rpc_types.rs index 6575c74082..32454c0440 100644 --- a/apps/src/lib/client/tendermint_rpc_types.rs +++ b/apps/src/lib/client/tendermint_rpc_types.rs @@ -2,29 +2,9 @@ use jsonpath_lib as jsonpath; use namada::proto::Tx; use namada::types::address::Address; use serde::Serialize; -use thiserror::Error; use crate::cli::safe_exit; -use crate::node::ledger::events::Attributes; - -/// Errors from interacting with Tendermint's jsonrpc endpoint -#[derive(Error, Debug)] -pub enum Error { - #[error("Invalid address given to JSON RPC client: {0}")] - Address(String), - #[error("Error in sending JSON RPC request to Tendermint")] - Send, - #[error("Received an error response from Tendermint: {0:?}")] - Rpc(tendermint_rpc::response_error::ResponseError), - #[error("Received malformed JSON response from Tendermint")] - MalformedJson, - #[error("Received an empty response from Tendermint")] - EmptyResponse, - #[error("Could not deserialize JSON response: {0}")] - Deserialize(serde_json::Error), - #[error("Could not find event for the given hash: {0}")] - NotFound(String), -} +use crate::node::ledger::events::EventType as NamadaEventType; /// Data needed for broadcasting a tx and /// monitoring its progress on chain @@ -55,13 +35,19 @@ pub struct TxResponse { } impl TxResponse { - /// Find a tx with a given hash from the the websocket subscription - /// to Tendermint events. - pub fn find_tx(json: serde_json::Value, tx_hash: &str) -> Self { + /// Parse the JSON payload received from a subscription + /// + /// Searches for custom events emitted from the ledger and converts + /// them back to thin wrapper around a hashmap for further parsing. + pub fn parse( + json: serde_json::Value, + event_type: NamadaEventType, + tx_hash: &str, + ) -> Self { let tx_hash_json = serde_json::Value::String(tx_hash.to_string()); let mut selector = jsonpath::selector(&json); let mut index = 0; - let evt_key = "accepted"; + let evt_key = event_type.to_string(); // Find the tx with a matching hash let hash = loop { if let Ok(hash) = @@ -128,208 +114,3 @@ impl TxResponse { } } } - -mod params { - use std::convert::TryFrom; - use std::time::Duration; - - use serde::ser::SerializeTuple; - use serde::{Deserialize, Serializer}; - use tendermint_rpc::query::Query; - - use super::*; - - /// Opaque type for ordering events. Set by Tendermint - #[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] - #[serde(transparent)] - pub struct Cursor(String); - - impl From for Cursor { - fn from(cursor: String) -> Self { - Cursor(cursor) - } - } - - /// Struct used for querying Tendermint's event logs - #[derive(Debug)] - pub struct EventParams { - /// The filter an event must satisfy in order to - /// be returned - pub filter: Query, - /// The maximum number of eligible results to return. - /// If zero or negative, the server will report a default number. - pub max_results: u64, - /// Return only items after this cursor. If empty, the limit is just - /// before the the beginning of the event log - pub after: Cursor, - /// Return only items before this cursor. If empty, the limit is just - /// after the head of the event log. - before: Cursor, - /// Wait for up to this long for events to be available. - pub wait_time: Duration, - } - - /// Struct to help serialize [`EventParams`] - #[derive(Serialize)] - struct Filter { - query: String, - } - - impl Serialize for EventParams { - fn serialize(&self, serializer: S) -> Result - where - S: Serializer, - { - let mut ser = serializer.serialize_tuple(5)?; - ser.serialize_element(&Filter { - query: self.filter.to_string(), - })?; - ser.serialize_element(&self.max_results)?; - ser.serialize_element(self.after.0.as_str())?; - ser.serialize_element(self.before.0.as_str())?; - ser.serialize_element(&self.wait_time.as_nanos())?; - ser.end() - } - } - - impl EventParams { - /// Initialize a new set of [`EventParams`] - pub fn new( - filter: Query, - max_results: u64, - wait_time: Duration, - ) -> Self { - Self { - filter, - max_results, - after: Default::default(), - before: Default::default(), - wait_time, - } - } - } - - /// A reply from Tendermint for events matching the given [`EventParams`] - #[derive(Serialize, Deserialize)] - pub struct EventReply { - /// The items matching the request parameters, from newest - /// to oldest, if any were available within the timeout. - pub items: Vec, - /// This is true if there is at least one older matching item - /// available in the log that was not returned. - #[allow(dead_code)] - more: bool, - /// The cursor of the oldest item in the log at the time of this reply, - /// or "" if the log is empty. - #[allow(dead_code)] - oldest: Cursor, - /// The cursor of the newest item in the log at the time of this reply, - /// or "" if the log is empty. - pub newest: Cursor, - } - - /// An event returned from Tendermint - #[derive(Debug, PartialEq, Serialize, Deserialize)] - pub struct EventItem { - /// this specifies where in the event log this event is - #[allow(dead_code)] - pub cursor: Cursor, - /// The event type - pub event: String, - /// The raw event value - pub data: EventData, - } - - /// Raw data of an event returned from Tendermint - #[derive(Debug, PartialEq, Serialize, Deserialize)] - pub struct EventData { - pub r#type: String, - pub value: serde_json::Value, - } - - /// Parse the JSON payload received from the `events` JSON-RPC - /// endpoint of Tendermint. - /// - /// Searches for custom events emitted from the ledger and converts - /// them back to thin wrapper around a hashmap for further parsing. - /// Returns none if the event is not found. - pub fn parse(reply: EventReply, tx_hash: &str) -> Option { - let mut event = reply - .items - .iter() - .filter_map(|event| { - if event.event == *"NewBlockHeader" { - let events: Option> = - event.data.value.get("result_finalize_block").map( - |res| match res.get("events") { - Some(v) => serde_json::from_value(v.clone()) - .unwrap_or_default(), - None => vec![], - }, - ); - events - } else { - None - } - }) - .flatten() - .find_map(|attr| { - if let Ok(attrs) = Attributes::try_from(&attr) { - match attrs.get("hash") { - Some(hash) if hash == tx_hash => Some(attrs), - _ => None, - } - } else { - None - } - })?; - - let info = event.take("info").unwrap(); - let log = event.take("log").unwrap(); - let height = event.take("height").unwrap(); - let hash = event.take("hash").unwrap(); - let code = event.take("code").unwrap(); - let gas_used = - event.take("gas_used").unwrap_or_else(|| String::from("0")); - let initialized_accounts = event.take("initialized_accounts"); - let initialized_accounts = match initialized_accounts { - Some(values) => serde_json::from_str(&values).unwrap(), - _ => vec![], - }; - - Some(TxResponse { - info, - log, - height, - hash, - code, - gas_used, - initialized_accounts, - }) - } - - #[cfg(test)] - mod test_rpc_types { - use tendermint_rpc::query::EventType; - - use super::*; - - /// Test that [`EventParams`] is serialized correctly - #[test] - fn test_serialize_event_params() { - let params = EventParams { - filter: Query::from(EventType::NewBlockHeader), - max_results: 5, - after: Cursor("16CCC798FB5F4670-0123".into()), - before: Default::default(), - wait_time: Duration::from_secs(59), - }; - assert_eq!( - serde_json::to_string(¶ms).expect("Test failed"), - r#"[{"query":"tm.event = 'NewBlockHeader'"},5,"16CCC798FB5F4670-0123","",59000000000]"# - ) - } - } -} - -pub use params::*; diff --git a/apps/src/lib/client/tendermint_websocket_client.rs b/apps/src/lib/client/tendermint_websocket_client.rs index d5af3bcee1..61bea1d990 100644 --- a/apps/src/lib/client/tendermint_websocket_client.rs +++ b/apps/src/lib/client/tendermint_websocket_client.rs @@ -6,15 +6,17 @@ use std::sync::{Arc, Mutex}; use std::time::Duration; use async_trait::async_trait; -use tendermint_config::net::Address; -use tendermint_rpc::{ - Client, Error as RpcError, Request, Response, SimpleRequest, -}; use thiserror::Error; use tokio::time::Instant; use websocket::result::WebSocketError; use websocket::{ClientBuilder, Message, OwnedMessage}; +use crate::facade::tendermint_config::net::Address; +use crate::facade::tendermint_rpc::query::Query; +use crate::facade::tendermint_rpc::{ + Client, Error as RpcError, Request, Response, SimpleRequest, +}; + #[derive(Error, Debug)] pub enum Error { #[error("Could not convert into websocket address: {0:?}")] @@ -37,6 +39,10 @@ pub enum Error { MissingId, #[error("Connection timed out")] ConnectionTimeout, + #[error("Received malformed JSON from websocket: {0:?}")] + MalformedJson(crate::node::ledger::events::Error), + #[error("Event for transaction {0} was not received")] + MissingEvent(String), } type Json = serde_json::Value; @@ -49,11 +55,11 @@ mod rpc_types { use std::str::FromStr; use serde::{de, Deserialize, Serialize, Serializer}; - use tendermint_rpc::method::Method; - use tendermint_rpc::query::{EventType, Query}; - use tendermint_rpc::{request, response}; use super::Json; + use crate::facade::tendermint_rpc::method::Method; + use crate::facade::tendermint_rpc::query::{EventType, Query}; + use crate::facade::tendermint_rpc::{request, response}; #[derive(Debug, Deserialize, Serialize)] pub struct RpcRequest { @@ -169,6 +175,8 @@ impl Display for WebSocketAddress { } } +use rpc_types::{RpcResponse, RpcSubscription, SubscribeType}; + /// We need interior mutability since the `perform` method of the `Client` /// trait from `tendermint_rpc` only takes `&self` as an argument /// Furthermore, TendermintWebsocketClient must be `Send` since it will be @@ -176,8 +184,14 @@ impl Display for WebSocketAddress { type Websocket = Arc>>; type ResponseQueue = Arc>>; +struct Subscription { + id: String, + query: Query, +} + pub struct TendermintWebsocketClient { websocket: Websocket, + subscribed: Option, received_responses: ResponseQueue, connection_timeout: Duration, } @@ -195,6 +209,7 @@ impl TendermintWebsocketClient { { Ok(websocket) => Ok(Self { websocket: Arc::new(Mutex::new(websocket)), + subscribed: None, received_responses: Arc::new(Mutex::new(HashMap::new())), connection_timeout: connection_timeout .unwrap_or_else(|| Duration::new(300, 0)), @@ -207,8 +222,142 @@ impl TendermintWebsocketClient { pub fn close(&mut self) { // Even in the case of errors, this will be shutdown let _ = self.websocket.lock().unwrap().shutdown(); + self.subscribed = None; self.received_responses.lock().unwrap().clear(); } + + /// Subscribes to an event specified by the query argument. + pub fn subscribe(&mut self, query: Query) -> Result<(), Error> { + // We do not support more than one subscription currently + // This can be fixed by correlating on ids later + if self.subscribed.is_some() { + return Err(Error::AlreadySubscribed); + } + // send the subscription request + let message = RpcSubscription(SubscribeType::Subscribe, query.clone()) + .into_json(); + let msg_id = get_id(&message).unwrap(); + + self.websocket + .lock() + .unwrap() + .send_message(&Message::text(&message)) + .map_err(Error::Websocket)?; + + // check that the request was received and a success message returned + match self.process_response(|_| Error::Subscribe(message), None) { + Ok(_) => { + self.subscribed = Some(Subscription { id: msg_id, query }); + Ok(()) + } + Err(err) => Err(err), + } + } + + /// Receive a response from the subscribed event or + /// process the response if it has already been received + pub fn receive_response(&self) -> Result { + if let Some(Subscription { id, .. }) = &self.subscribed { + let response = self.process_response( + Error::Response, + self.received_responses.lock().unwrap().remove(id), + )?; + Ok(response) + } else { + Err(Error::NotSubscribed) + } + } + + /// Unsubscribe from the currently subscribed event + /// Note that even if an error is returned, the client + /// will return to an unsubscribed state + pub fn unsubscribe(&mut self) -> Result<(), Error> { + match self.subscribed.take() { + Some(Subscription { query, .. }) => { + // send the subscription request + let message = + RpcSubscription(SubscribeType::Unsubscribe, query) + .into_json(); + + self.websocket + .lock() + .unwrap() + .send_message(&Message::text(&message)) + .map_err(Error::Websocket)?; + // empty out the message queue. Should be empty already + self.received_responses.lock().unwrap().clear(); + // check that the request was received and a success message + // returned + match self + .process_response(|_| Error::Unsubscribe(message), None) + { + Ok(_) => Ok(()), + Err(err) => Err(err), + } + } + _ => Err(Error::NotSubscribed), + } + } + + /// Process the next response received and handle any exceptions that + /// may have occurred. Takes a function to map response to an error + /// as a parameter. + /// + /// Optionally, the response may have been received earlier while + /// handling a different request. In that case, we process it + /// now. + fn process_response( + &self, + f: F, + received: Option, + ) -> Result + where + F: FnOnce(String) -> Error, + { + let resp = match received { + Some(resp) => OwnedMessage::Text(resp), + None => { + let mut websocket = self.websocket.lock().unwrap(); + let start = Instant::now(); + loop { + if Instant::now().duration_since(start) + > self.connection_timeout + { + tracing::error!( + "Websocket connection timed out while waiting for \ + response" + ); + return Err(Error::ConnectionTimeout); + } + match websocket.recv_message().map_err(Error::Websocket)? { + text @ OwnedMessage::Text(_) => break text, + OwnedMessage::Ping(data) => { + tracing::debug!( + "Received websocket Ping, sending Pong" + ); + websocket + .send_message(&OwnedMessage::Pong(data)) + .unwrap(); + continue; + } + OwnedMessage::Pong(_) => { + tracing::debug!( + "Received websocket Pong, ignoring" + ); + continue; + } + other => return Err(Error::UnexpectedResponse(other)), + } + } + } + }; + match resp { + OwnedMessage::Text(raw) => RpcResponse::from_string(raw) + .map(|v| v.0) + .map_err(|e| f(e.to_string())), + other => Err(Error::UnexpectedResponse(other)), + } + } } #[async_trait] @@ -297,3 +446,267 @@ fn get_id(req_json: &str) -> Result { Err(Error::MissingId) } } + +/// The TendermintWebsocketClient has a basic state machine for ensuring +/// at most one subscription at a time. These tests cover that it +/// works as intended. +/// +/// Furthermore, since a client can handle a subscription and a +/// simple request simultaneously, we must test that the correct +/// responses are give for each of the corresponding requests +#[cfg(test)] +mod test_tendermint_websocket_client { + use std::time::Duration; + + use namada::types::transaction::hash_tx as hash_tx_bytes; + use serde::{Deserialize, Serialize}; + use websocket::sync::Server; + use websocket::{Message, OwnedMessage}; + + use crate::client::tendermint_websocket_client::{ + TendermintWebsocketClient, WebSocketAddress, + }; + use crate::facade::tendermint::abci::transaction; + use crate::facade::tendermint_rpc::endpoint::abci_info::AbciInfo; + use crate::facade::tendermint_rpc::query::{EventType, Query}; + use crate::facade::tendermint_rpc::Client; + + #[derive(Debug, Deserialize, Serialize)] + #[serde(rename_all = "snake_case")] + pub enum ReqType { + Subscribe, + Unsubscribe, + AbciInfo, + } + + #[derive(Debug, Deserialize, Serialize)] + pub struct RpcRequest { + pub jsonrpc: String, + pub id: String, + pub method: ReqType, + pub params: Option>, + } + + fn address() -> WebSocketAddress { + WebSocketAddress { + host: "localhost".into(), + port: 26657, + } + } + + #[derive(Default)] + struct Handle { + subscription_id: Option, + } + + impl Handle { + /// Mocks responses to queries. Fairly arbitrary with just enough + /// variety to test the TendermintWebsocketClient state machine and + /// message synchronization + fn handle(&mut self, msg: String) -> Vec { + let id = super::get_id(&msg).unwrap(); + let request: RpcRequest = serde_json::from_str(&msg).unwrap(); + match request.method { + ReqType::Unsubscribe => { + self.subscription_id = None; + vec![format!( + r#"{{"jsonrpc": "2.0", "id": {}, "error": "error"}}"#, + id + )] + } + ReqType::Subscribe => { + self.subscription_id = Some(id); + let id = self.subscription_id.as_ref().unwrap(); + if request.params.unwrap()[0] + == Query::from(EventType::NewBlock).to_string() + { + vec![format!( + r#"{{"jsonrpc": "2.0", "id": {}, "error": "error"}}"#, + id + )] + } else { + vec![format!( + r#"{{"jsonrpc": "2.0", "id": {}, "result": {{}}}}"#, + id + )] + } + } + ReqType::AbciInfo => { + // Mock a subscription result returning on the wire before + // the simple request result + let info = AbciInfo { + last_block_app_hash: transaction::Hash::new( + hash_tx_bytes("Testing".as_bytes()).0, + ) + .as_ref() + .into(), + ..AbciInfo::default() + }; + let resp = serde_json::to_string(&info).unwrap(); + if let Some(prev_id) = self.subscription_id.take() { + vec![ + format!( + r#"{{"jsonrpc": "2.0", "id": {}, "result": {{"subscription": "result!"}}}}"#, + prev_id + ), + format!( + r#"{{"jsonrpc": "2.0", "id": {}, "result": {{"response": {}}}}}"#, + id, resp + ), + ] + } else { + vec![format!( + r#"{{"jsonrpc": "2.0", "id": {}, "result": {{"response": {}}}}}"#, + id, resp + )] + } + } + } + } + } + + /// A mock tendermint node. This is just a basic websocket server + /// TODO: When the thread drops from scope, we may get an ignorable + /// panic as we did not shut the loop down. But we should. + fn start() { + let node = Server::bind("localhost:26657").unwrap(); + for connection in node.filter_map(Result::ok) { + std::thread::spawn(move || { + let mut handler = Handle::default(); + let mut client = connection.accept().unwrap(); + loop { + for resp in match client.recv_message().unwrap() { + OwnedMessage::Text(msg) => handler.handle(msg), + _ => panic!("Unexpected request"), + } { + let msg = Message::text(resp); + let _ = client.send_message(&msg); + } + } + }); + } + } + + /// Test that we cannot subscribe to a new event + /// if we have an active subscription + #[test] + fn test_subscribe_twice() { + std::thread::spawn(start); + // need to make sure that the mock tendermint node has time to boot up + std::thread::sleep(std::time::Duration::from_secs(1)); + let mut rpc_client = TendermintWebsocketClient::open( + address(), + Some(Duration::new(10, 0)), + ) + .expect("Client could not start"); + // Check that subscription was successful + rpc_client.subscribe(Query::from(EventType::Tx)).unwrap(); + assert_eq!( + rpc_client.subscribed.as_ref().expect("Test failed").query, + Query::from(EventType::Tx) + ); + // Check that we cannot subscribe while we still have an active + // subscription + assert!(rpc_client.subscribe(Query::from(EventType::Tx)).is_err()); + } + + /// Test that even if there is an error on the protocol layer, + /// the client still unsubscribes and returns control + #[test] + fn test_unsubscribe_even_on_protocol_error() { + std::thread::spawn(start); + // need to make sure that the mock tendermint node has time to boot up + std::thread::sleep(std::time::Duration::from_secs(1)); + let mut rpc_client = TendermintWebsocketClient::open( + address(), + Some(Duration::new(10, 0)), + ) + .expect("Client could not start"); + // Check that subscription was successful + rpc_client.subscribe(Query::from(EventType::Tx)).unwrap(); + assert_eq!( + rpc_client.subscribed.as_ref().expect("Test failed").query, + Query::from(EventType::Tx) + ); + // Check that unsubscribe was successful even though it returned an + // error + assert!(rpc_client.unsubscribe().is_err()); + assert!(rpc_client.subscribed.is_none()); + } + + /// Test that if we unsubscribe from an event, we can + /// reuse the client to subscribe to a new event + #[test] + fn test_subscribe_after_unsubscribe() { + std::thread::spawn(start); + // need to make sure that the mock tendermint node has time to boot up + std::thread::sleep(std::time::Duration::from_secs(1)); + let mut rpc_client = TendermintWebsocketClient::open( + address(), + Some(Duration::new(10, 0)), + ) + .expect("Client could not start"); + // Check that subscription was successful + rpc_client.subscribe(Query::from(EventType::Tx)).unwrap(); + assert_eq!( + rpc_client.subscribed.as_ref().expect("Test failed").query, + Query::from(EventType::Tx) + ); + // Check that unsubscribe was successful + let _ = rpc_client.unsubscribe(); + assert!(rpc_client.subscribed.as_ref().is_none()); + // Check that we can now subscribe to new event + rpc_client.subscribe(Query::from(EventType::Tx)).unwrap(); + assert_eq!( + rpc_client.subscribed.expect("Test failed").query, + Query::from(EventType::Tx) + ); + } + + /// In this test we first subscribe to an event and then + /// make a simple request. + /// + /// The mock node is set up so that while the request is waiting + /// for its response, it receives the response for the subscription. + /// + /// This test checks that methods correctly return the correct + /// responses. + #[test] + fn test_subscription_returns_before_request_handled() { + std::thread::spawn(start); + // need to make sure that the mock tendermint node has time to boot up + std::thread::sleep(std::time::Duration::from_secs(1)); + let mut rpc_client = TendermintWebsocketClient::open( + address(), + Some(Duration::new(10, 0)), + ) + .expect("Client could not start"); + // Check that subscription was successful + rpc_client.subscribe(Query::from(EventType::Tx)).unwrap(); + assert_eq!( + rpc_client.subscribed.as_ref().expect("Test failed").query, + Query::from(EventType::Tx) + ); + // Check that there are no pending subscription responses + assert!(rpc_client.received_responses.lock().unwrap().is_empty()); + // If the wrong response is returned, json deserialization will fail the + // test + let _ = + tokio_test::block_on(rpc_client.abci_info()).expect("Test failed"); + // Check that we received the subscription response and it has been + // stored + assert!( + rpc_client + .received_responses + .lock() + .unwrap() + .contains_key(&rpc_client.subscribed.as_ref().unwrap().id) + ); + + // check that we receive the expected response to the subscription + let response = rpc_client.receive_response().expect("Test failed"); + assert_eq!(response.to_string(), r#"{"subscription":"result!"}"#); + // Check that there are no pending subscription responses + assert!(rpc_client.received_responses.lock().unwrap().is_empty()); + } +} diff --git a/apps/src/lib/client/tm_jsonrpc_client.rs b/apps/src/lib/client/tm_jsonrpc_client.rs deleted file mode 100644 index 7372012ff5..0000000000 --- a/apps/src/lib/client/tm_jsonrpc_client.rs +++ /dev/null @@ -1,261 +0,0 @@ -use std::convert::TryFrom; -use std::fmt::{Display, Formatter}; -use std::ops::{Deref, DerefMut}; - -use curl::easy::{Easy2, Handler, WriteError}; -use serde::{Deserialize, Serialize}; -use tendermint_config::net::Address as TendermintAddress; -use tendermint_rpc::query::Query; - -use crate::client::tendermint_rpc_types::{ - parse, Error, EventParams, EventReply, TxResponse, -}; - -/// Maximum number of times we try to send a curl request -const MAX_SEND_ATTEMPTS: u8 = 10; -/// Number of events we request from the events log -const NUM_EVENTS: u64 = 10; - -pub struct JsonRpcAddress<'a> { - host: &'a str, - port: u16, -} - -impl<'a> TryFrom<&'a TendermintAddress> for JsonRpcAddress<'a> { - type Error = Error; - - fn try_from(value: &'a TendermintAddress) -> Result { - match value { - TendermintAddress::Tcp { host, port, .. } => Ok(Self { - host: host.as_str(), - port: *port, - }), - _ => Err(Error::Address(value.to_string())), - } - } -} - -impl<'a> Display for JsonRpcAddress<'a> { - fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result { - write!(f, "{}:{}", self.host, self.port) - } -} - -/// The body of a json rpc request -#[derive(Serialize)] -pub struct Request { - /// Method name - pub method: String, - /// parameters to give the method - params: EventParams, - /// ID of the request - id: u8, -} - -impl From for Request { - fn from(params: EventParams) -> Self { - Request { - method: "events".into(), - params, - id: 1, - } - } -} - -/// The response we get back from Tendermint -#[derive(Serialize, Deserialize)] -pub struct Response { - /// JSON-RPC version - jsonrpc: String, - /// Identifier included in request - id: u8, - /// Results of request (if successful) - result: Option, - /// Error message if unsuccessful - error: Option, -} - -impl Response { - /// Convert the response into a result type - pub fn into_result(self) -> Result { - if let Some(e) = self.error { - Err(Error::Rpc(e)) - } else if let Some(result) = self.result { - Ok(result) - } else { - Err(Error::MalformedJson) - } - } -} - -/// Holds bytes returned in response to curl request -#[derive(Default)] -pub struct Collector(Vec); - -impl Handler for Collector { - fn write(&mut self, data: &[u8]) -> Result { - self.0.extend_from_slice(data); - Ok(data.len()) - } -} - -/// The RPC client -pub struct Client<'a> { - /// The actual curl client - inner: Easy2, - /// Url to send requests to - url: &'a str, - /// The request body - request: Request, - /// The hash of the tx whose corresponding event is being searched for. - hash: &'a str, -} - -impl<'a> Deref for Client<'a> { - type Target = Easy2; - - fn deref(&self) -> &Self::Target { - &self.inner - } -} - -impl<'a> DerefMut for Client<'a> { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.inner - } -} - -impl<'a> Client<'a> { - /// Create a new client - pub fn new(url: &'a str, request: Request, hash: &'a str) -> Self { - let mut client = Self { - inner: Easy2::new(Collector::default()), - url, - request, - hash, - }; - client.initialize(); - client - } - - /// Send a request to Tendermint - /// - /// Takes the 10 newest block header events and searches for - /// the relevant event among them. - pub fn send(&mut self) -> Result { - // send off the request - // this loop is here because if commit timeouts - // become too long, sometimes we get back empty responses. - for attempt in 0..MAX_SEND_ATTEMPTS { - match self.perform() { - Ok(()) => break, - Err(err) => { - tracing::debug!(?attempt, response = ?err, "attempting request") - } - } - } - if self.get_ref().0.is_empty() { - return Err(Error::Send); - } - - // deserialize response - let response: Response = - serde_json::from_slice(self.get_ref().0.as_slice()) - .map_err(Error::Deserialize)?; - let response = response.into_result()?; - // search for the event in the response and return - // it if found. Else request the next chunk of results - parse(response, self.hash) - .ok_or_else(|| Error::NotFound(self.hash.to_string())) - } - - /// Initialize the curl client from the fields of `Client` - fn initialize(&mut self) { - self.inner.reset(); - let url = self.url; - self.url(url).unwrap(); - self.post(true).unwrap(); - - // craft the body of the request - let request_body = serde_json::to_string(&self.request).unwrap(); - self.post_field_size(request_body.as_bytes().len() as u64) - .unwrap(); - // update the request and serialize to bytes - let data = serde_json::to_string(&self.request).unwrap(); - let data = data.as_bytes(); - self.post_fields_copy(data).unwrap(); - } -} - -/// Given a query looking for a particular Anoma event, -/// query the Tendermint's jsonrpc endpoint for the events -/// log. Returns the appropriate event if found in the log. -pub async fn fetch_event( - address: &str, - filter: Query, - tx_hash: &str, -) -> Result { - // craft the body of the request - let request = Request::from(EventParams::new( - filter, - NUM_EVENTS, - std::time::Duration::from_secs(60), - )); - // construct a curl client - let mut client = Client::new(address, request, tx_hash); - // perform the request - client.send() -} - -#[cfg(test)] -mod test_rpc_types { - use serde_json::json; - - use super::*; - use crate::client::tendermint_rpc_types::{EventData, EventItem}; - - /// Test that we correctly parse the response from Tendermint - #[test] - fn test_parse_response() { - let resp = r#" - { - "jsonrpc":"2.0", - "id":1, - "result":{ - "items": [{ - "cursor":"16f1b066717b4261-0060", - "event":"NewRoundStep", - "data":{ - "type":"tendermint/event/RoundState", - "value":{ - "height":"17416", - "round":0, - "step":"RoundStepCommit" - } - } - }], - "more":true, - "oldest":"16f1b065029b23d0-0001", - "newest":"16f1b066717b4261-0060" - } - }"#; - let response: Response = - serde_json::from_str(resp).expect("Test failed"); - let items = response.into_result().expect("Test failed").items; - assert_eq!( - items, - vec![EventItem { - cursor: String::from("16f1b066717b4261-0060").into(), - event: "NewRoundStep".to_string(), - data: EventData { - r#type: "tendermint/event/RoundState".to_string(), - value: json!({ - "height":"17416", - "round":0, - "step":"RoundStepCommit" - }), - } - }] - ) - } -} diff --git a/apps/src/lib/client/tx.rs b/apps/src/lib/client/tx.rs index 7a4d542536..e749a681c6 100644 --- a/apps/src/lib/client/tx.rs +++ b/apps/src/lib/client/tx.rs @@ -25,20 +25,20 @@ use namada::types::transaction::nft::{CreateNft, MintNft}; use namada::types::transaction::{pos, InitAccount, InitValidator, UpdateVp}; use namada::types::{address, storage, token}; use namada::{ledger, vm}; -use tendermint_config::net::Address as TendermintAddress; -use tendermint_rpc::endpoint::broadcast::tx_sync::Response; -use tendermint_rpc::query::{EventType, Query}; -use tendermint_rpc::{Client, HttpClient}; use super::rpc; use crate::cli::context::WalletAddress; use crate::cli::{args, safe_exit, Context}; use crate::client::signing::{find_keypair, sign_tx}; -use crate::client::tendermint_rpc_types::{Error, TxBroadcastData, TxResponse}; +use crate::client::tendermint_rpc_types::{TxBroadcastData, TxResponse}; use crate::client::tendermint_websocket_client::{ Error as WsError, TendermintWebsocketClient, WebSocketAddress, }; -use crate::client::tm_jsonrpc_client::{fetch_event, JsonRpcAddress}; +use crate::facade::tendermint_config::net::Address as TendermintAddress; +use crate::facade::tendermint_rpc::endpoint::broadcast::tx_sync::Response; +use crate::facade::tendermint_rpc::query::{EventType, Query}; +use crate::facade::tendermint_rpc::{Client, HttpClient}; +use crate::node::ledger::events::EventType as NamadaEventType; use crate::node::ledger::tendermint_node; const ACCEPTED_QUERY_KEY: &str = "accepted.hash"; @@ -1209,7 +1209,7 @@ pub async fn broadcast_tx( address: TendermintAddress, to_broadcast: &TxBroadcastData, ) -> Result { - let (tx, wrapper_tx_hash, _decrypted_tx_hash) = match to_broadcast { + let (tx, wrapper_tx_hash, decrypted_tx_hash) = match to_broadcast { TxBroadcastData::Wrapper { tx, wrapper_hash, @@ -1247,7 +1247,7 @@ pub async fn broadcast_tx( // acceptance/application results later { println!("Wrapper transaction hash: {:?}", wrapper_tx_hash); - println!("Inner transaction hash: {:?}", _decrypted_tx_hash); + println!("Inner transaction hash: {:?}", decrypted_tx_hash); } Ok(response) } else { @@ -1266,56 +1266,88 @@ pub async fn broadcast_tx( pub async fn submit_tx( address: TendermintAddress, to_broadcast: TxBroadcastData, -) -> Result { - // the data for finding the relevant events +) -> Result { let (_, wrapper_hash, decrypted_hash) = match &to_broadcast { TxBroadcastData::Wrapper { tx, wrapper_hash, decrypted_hash, } => (tx, wrapper_hash, decrypted_hash), - TxBroadcastData::DryRun(_) => { - panic!("Cannot broadcast a dry-run transaction") - } + _ => panic!("Cannot broadcast a dry-run transaction"), }; - let url = JsonRpcAddress::try_from(&address)?.to_string(); - // the filters for finding the relevant events - let wrapper_query = Query::from(EventType::NewBlockHeader) + let websocket_timeout = + if let Ok(val) = env::var(ENV_VAR_ANOMA_TENDERMINT_WEBSOCKET_TIMEOUT) { + if let Ok(timeout) = val.parse::() { + Duration::new(timeout, 0) + } else { + Duration::new(300, 0) + } + } else { + Duration::new(300, 0) + }; + tracing::debug!("Tenderming address: {:?}", address); + let mut wrapper_tx_subscription = TendermintWebsocketClient::open( + WebSocketAddress::try_from(address.clone())?, + Some(websocket_timeout), + )?; + + // It is better to subscribe to the transaction before it is broadcast + // + // Note that the `APPLIED_QUERY_KEY` key comes from a custom event + // created by the shell + let query = Query::from(EventType::NewBlock) .and_eq(ACCEPTED_QUERY_KEY, wrapper_hash.as_str()); - let tx_query = Query::from(EventType::NewBlockHeader) - .and_eq(APPLIED_QUERY_KEY, decrypted_hash.as_str()); + wrapper_tx_subscription.subscribe(query)?; + + // We also subscribe to the event emitted when the encrypted + // payload makes its way onto the blockchain + let mut decrypted_tx_subscription = { + let mut decrypted_tx_subscription = TendermintWebsocketClient::open( + WebSocketAddress::try_from(address.clone())?, + Some(websocket_timeout), + )?; + let query = Query::from(EventType::NewBlock) + .and_eq(APPLIED_QUERY_KEY, decrypted_hash.as_str()); + decrypted_tx_subscription.subscribe(query)?; + decrypted_tx_subscription + }; - // broadcast the tx - if let Err(err) = broadcast_tx(address, &to_broadcast).await { - eprintln!("Encountered error while broadcasting transaction: {}", err); - safe_exit(1) - } + // Broadcast the supplied transaction + broadcast_tx(address, &to_broadcast).await?; - // get the event for the wrapper tx - let response = - fetch_event(&url, wrapper_query, wrapper_hash.as_str()).await?; - println!( - "Transaction accepted with result: {}", - serde_json::to_string_pretty(&response).unwrap() - ); + let parsed = { + let parsed = TxResponse::parse( + wrapper_tx_subscription.receive_response()?, + NamadaEventType::Accepted, + wrapper_hash, + ); - // The transaction is now on chain. We wait for it to be decrypted - // and applied - if response.code == 0.to_string() { - // get the event for the inner tx - let response = - fetch_event(&url, tx_query, decrypted_hash.as_str()).await?; println!( - "Transaction applied with result: {}", - serde_json::to_string_pretty(&response).unwrap() + "Transaction accepted with result: {}", + serde_json::to_string_pretty(&parsed).unwrap() ); - Ok(response) - } else { - tracing::warn!( - "Received an error from the associated wrapper tx: {}", - response.code - ); - Ok(response) - } + // The transaction is now on chain. We wait for it to be decrypted + // and applied + if parsed.code == 0.to_string() { + let parsed = TxResponse::parse( + decrypted_tx_subscription.receive_response()?, + NamadaEventType::Applied, + decrypted_hash.as_str(), + ); + println!( + "Transaction applied with result: {}", + serde_json::to_string_pretty(&parsed).unwrap() + ); + Ok(parsed) + } else { + Ok(parsed) + } + }; + + wrapper_tx_subscription.unsubscribe()?; + wrapper_tx_subscription.close(); + decrypted_tx_subscription.unsubscribe()?; + decrypted_tx_subscription.close(); + parsed } diff --git a/apps/src/lib/client/utils.rs b/apps/src/lib/client/utils.rs index 8ebe2f73aa..8848726792 100644 --- a/apps/src/lib/client/utils.rs +++ b/apps/src/lib/client/utils.rs @@ -18,8 +18,6 @@ use rand::prelude::ThreadRng; use rand::thread_rng; use serde_json::json; use sha2::{Digest, Sha256}; -use tendermint::node::Id as TendermintNodeId; -use tendermint_config::net::Address as TendermintAddress; use crate::cli::context::ENV_VAR_WASM_DIR; use crate::cli::{self, args}; @@ -28,6 +26,8 @@ use crate::config::genesis::genesis_config::{ }; use crate::config::global::GlobalConfig; use crate::config::{self, Config, TendermintMode}; +use crate::facade::tendermint::node::Id as TendermintNodeId; +use crate::facade::tendermint_config::net::Address as TendermintAddress; use crate::node::ledger::tendermint_node; use crate::wallet::{pre_genesis, Wallet}; use crate::wasm_loader; diff --git a/apps/src/lib/config/mod.rs b/apps/src/lib/config/mod.rs index 09b5e0e7bd..07ba934b10 100644 --- a/apps/src/lib/config/mod.rs +++ b/apps/src/lib/config/mod.rs @@ -13,11 +13,11 @@ use std::str::FromStr; use namada::types::chain::ChainId; use namada::types::time::Rfc3339String; use serde::{Deserialize, Serialize}; -use tendermint::Timeout; -use tendermint_config::net::Address as TendermintAddress; use thiserror::Error; use crate::cli; +use crate::facade::tendermint::Timeout; +use crate::facade::tendermint_config::net::Address as TendermintAddress; /// Base directory contains global config and chain directories. pub const DEFAULT_BASE_DIR: &str = ".anoma"; diff --git a/apps/src/lib/mod.rs b/apps/src/lib/mod.rs index b0455934bd..d8ab71236c 100644 --- a/apps/src/lib/mod.rs +++ b/apps/src/lib/mod.rs @@ -17,3 +17,21 @@ pub mod wasm_loader; // Taken from . #[doc(inline)] pub use std; + +pub mod facade { + //! Facade module to reason about `abcipp` feature flag logic. + + #[cfg(not(feature = "abcipp"))] + pub use { + tendermint, tendermint_config, tendermint_proto, tendermint_rpc, + tower_abci, + }; + #[cfg(feature = "abcipp")] + pub use { + tendermint_abcipp as tendermint, + tendermint_config_abcipp as tendermint_config, + tendermint_proto_abcipp as tendermint_proto, + tendermint_rpc_abcipp as tendermint_rpc, + tower_abci_abcipp as tower_abci, + }; +} diff --git a/apps/src/lib/node/ledger/broadcaster.rs b/apps/src/lib/node/ledger/broadcaster.rs index 94aec1a00c..199ab953c1 100644 --- a/apps/src/lib/node/ledger/broadcaster.rs +++ b/apps/src/lib/node/ledger/broadcaster.rs @@ -1,6 +1,7 @@ -use tendermint_rpc::{Client, HttpClient}; use tokio::sync::mpsc::UnboundedReceiver; +use crate::facade::tendermint_rpc::{Client, HttpClient}; + /// A service for broadcasting txs via an HTTP client. /// The receiver is for receiving message payloads for other services /// to be broadcast. diff --git a/apps/src/lib/node/ledger/events.rs b/apps/src/lib/node/ledger/events.rs index 493c4855da..3adefc59d7 100644 --- a/apps/src/lib/node/ledger/events.rs +++ b/apps/src/lib/node/ledger/events.rs @@ -7,9 +7,10 @@ use borsh::BorshSerialize; use namada::ledger::governance::utils::ProposalEvent; use namada::types::ibc::IbcEvent; use namada::types::transaction::{hash_tx, TxType}; -use tendermint_proto::abci::EventAttribute; use thiserror::Error; +use crate::facade::tendermint_proto::abci::EventAttribute; + /// Indicates if an event is emitted do to /// an individual Tx or the nature of a finalized block #[derive(Clone, Debug)] @@ -150,7 +151,7 @@ impl From for Event { } /// Convert our custom event into the necessary tendermint proto type -impl From for tendermint_proto::abci::Event { +impl From for crate::facade::tendermint_proto::abci::Event { fn from(event: Event) -> Self { Self { r#type: event.event_type.to_string(), diff --git a/apps/src/lib/node/ledger/mod.rs b/apps/src/lib/node/ledger/mod.rs index 59f0ce25ec..dc0dfc184c 100644 --- a/apps/src/lib/node/ledger/mod.rs +++ b/apps/src/lib/node/ledger/mod.rs @@ -20,15 +20,15 @@ use namada::ledger::governance::storage as gov_storage; use namada::types::storage::Key; use once_cell::unsync::Lazy; use sysinfo::{RefreshKind, System, SystemExt}; -use tendermint_proto::abci::CheckTxType; use tokio::task; use tower::ServiceBuilder; -use tower_abci::{response, split, Server}; use self::abortable::AbortableSpawner; use self::shims::abcipp_shim::AbciService; use crate::config::utils::num_of_threads; use crate::config::TendermintMode; +use crate::facade::tendermint_proto::abci::CheckTxType; +use crate::facade::tower_abci::{response, split, Server}; use crate::node::ledger::broadcaster::Broadcaster; use crate::node::ledger::shell::{Error, MempoolTxType, Shell}; use crate::node::ledger::shims::abcipp_shim::AbcippShim; @@ -109,9 +109,11 @@ impl Shell { Request::RevertProposal(_req) => { Ok(Response::RevertProposal(self.revert_proposal(_req))) } + #[cfg(feature = "abcipp")] Request::ExtendVote(_req) => { Ok(Response::ExtendVote(self.extend_vote(_req))) } + #[cfg(feature = "abcipp")] Request::VerifyVoteExtension(_req) => { tracing::debug!("Request VerifyVoteExtension"); Ok(Response::VerifyVoteExtension( diff --git a/apps/src/lib/node/ledger/rpc.rs b/apps/src/lib/node/ledger/rpc.rs index ce3cbd592d..ad3d2f5fcb 100644 --- a/apps/src/lib/node/ledger/rpc.rs +++ b/apps/src/lib/node/ledger/rpc.rs @@ -5,9 +5,10 @@ use std::str::FromStr; use namada::types::address::Address; use namada::types::storage; -use tendermint::abci::Path as AbciPath; use thiserror::Error; +use crate::facade::tendermint::abci::Path as AbciPath; + /// RPC query path #[derive(Debug, Clone)] pub enum Path { diff --git a/apps/src/lib/node/ledger/shell/finalize_block.rs b/apps/src/lib/node/ledger/shell/finalize_block.rs index ae6d2256de..2080b8d23d 100644 --- a/apps/src/lib/node/ledger/shell/finalize_block.rs +++ b/apps/src/lib/node/ledger/shell/finalize_block.rs @@ -1,11 +1,11 @@ //! Implementation of the `FinalizeBlock` ABCI++ method for the Shell use namada::types::storage::{BlockHash, Header}; -use tendermint_proto::abci::Misbehavior as Evidence; -use tendermint_proto::crypto::PublicKey as TendermintPublicKey; use super::governance::execute_governance_proposals; use super::*; +use crate::facade::tendermint_proto::abci::Misbehavior as Evidence; +use crate::facade::tendermint_proto::crypto::PublicKey as TendermintPublicKey; impl Shell where diff --git a/apps/src/lib/node/ledger/shell/init_chain.rs b/apps/src/lib/node/ledger/shell/init_chain.rs index a1f1507b8d..8cb6842c50 100644 --- a/apps/src/lib/node/ledger/shell/init_chain.rs +++ b/apps/src/lib/node/ledger/shell/init_chain.rs @@ -5,11 +5,11 @@ use std::hash::Hash; use namada::types::key::*; #[cfg(not(feature = "dev"))] use sha2::{Digest, Sha256}; -use tendermint_proto::abci; -use tendermint_proto::crypto::PublicKey as TendermintPublicKey; -use tendermint_proto::google::protobuf; use super::*; +use crate::facade::tendermint_proto::abci; +use crate::facade::tendermint_proto::crypto::PublicKey as TendermintPublicKey; +use crate::facade::tendermint_proto::google::protobuf; use crate::wasm_loader; impl Shell diff --git a/apps/src/lib/node/ledger/shell/mod.rs b/apps/src/lib/node/ledger/shell/mod.rs index 3eb04f0872..28167d4eba 100644 --- a/apps/src/lib/node/ledger/shell/mod.rs +++ b/apps/src/lib/node/ledger/shell/mod.rs @@ -45,18 +45,18 @@ use namada::vm::wasm::{TxCache, VpCache}; use namada::vm::WasmCacheRwAccess; use num_derive::{FromPrimitive, ToPrimitive}; use num_traits::{FromPrimitive, ToPrimitive}; -use tendermint_proto::abci::response_verify_vote_extension::VerifyStatus; -use tendermint_proto::abci::{ - Misbehavior as Evidence, MisbehaviorType as EvidenceType, - RequestPrepareProposal, ValidatorUpdate, -}; -use tendermint_proto::crypto::public_key; use thiserror::Error; use tokio::sync::mpsc::UnboundedSender; -use tower_abci::{request, response}; use super::rpc; use crate::config::{genesis, TendermintMode}; +#[cfg(feature = "abcipp")] +use crate::facade::tendermint_proto::abci::response_verify_vote_extension::VerifyStatus; +use crate::facade::tendermint_proto::abci::{ + Misbehavior as Evidence, MisbehaviorType as EvidenceType, ValidatorUpdate, +}; +use crate::facade::tendermint_proto::crypto::public_key; +use crate::facade::tower_abci::{request, response}; use crate::node::ledger::events::Event; use crate::node::ledger::shims::abcipp_shim_types::shim; use crate::node::ledger::shims::abcipp_shim_types::shim::response::TxResult; @@ -68,15 +68,10 @@ use crate::{config, wallet}; fn key_to_tendermint( pk: &common::PublicKey, ) -> std::result::Result { - println!("\nKEY TO TENDERMINT\n"); match pk { - common::PublicKey::Ed25519(_) => { - println!("\nEd25519\n"); - ed25519::PublicKey::try_from_pk(pk) - .map(|pk| public_key::Sum::Ed25519(pk.try_to_vec().unwrap())) - } + common::PublicKey::Ed25519(_) => ed25519::PublicKey::try_from_pk(pk) + .map(|pk| public_key::Sum::Ed25519(pk.try_to_vec().unwrap())), common::PublicKey::Secp256k1(_) => { - println!("\nSecp256k1\n"); secp256k1::PublicKey::try_from_pk(pk) .map(|pk| public_key::Sum::Secp256k1(pk.try_to_vec().unwrap())) } @@ -500,6 +495,7 @@ where } /// INVARIANT: This method must be stateless. + #[cfg(feature = "abcipp")] pub fn extend_vote( &self, _req: request::ExtendVote, @@ -508,6 +504,7 @@ where } /// INVARIANT: This method must be stateless. + #[cfg(feature = "abcipp")] pub fn verify_vote_extension( &self, _req: request::VerifyVoteExtension, @@ -651,11 +648,13 @@ mod test_utils { use namada::types::storage::{BlockHash, Epoch, Header}; use namada::types::transaction::Fee; use tempfile::tempdir; - use tendermint_proto::abci::{RequestInitChain, RequestProcessProposal}; - use tendermint_proto::google::protobuf::Timestamp; use tokio::sync::mpsc::UnboundedReceiver; use super::*; + use crate::facade::tendermint_proto::abci::{ + RequestInitChain, RequestProcessProposal, + }; + use crate::facade::tendermint_proto::google::protobuf::Timestamp; use crate::node::ledger::shims::abcipp_shim_types::shim::request::{ FinalizeBlock, ProcessedTx, }; @@ -765,10 +764,10 @@ mod test_utils { }); let results = resp .tx_results - .iter() + .into_iter() .zip(req.txs.into_iter()) .map(|(res, tx_bytes)| ProcessedTx { - result: res.into(), + result: res, tx: tx_bytes, }) .collect(); diff --git a/apps/src/lib/node/ledger/shell/prepare_proposal.rs b/apps/src/lib/node/ledger/shell/prepare_proposal.rs index 57df2f2647..c41f2c2083 100644 --- a/apps/src/lib/node/ledger/shell/prepare_proposal.rs +++ b/apps/src/lib/node/ledger/shell/prepare_proposal.rs @@ -1,8 +1,16 @@ //! Implementation of the [`RequestPrepareProposal`] ABCI++ method for the Shell -use tendermint_proto::abci::TxRecord; +use namada::ledger::storage::{DBIter, StorageHasher, DB}; +use namada::proto::Tx; +use namada::types::transaction::tx_types::TxType; +use namada::types::transaction::wrapper::wrapper_tx::PairingEngine; +use namada::types::transaction::{AffineCurve, DecryptedTx, EllipticCurve}; -use super::*; +use super::super::*; +use crate::facade::tendermint_proto::abci::RequestPrepareProposal; +#[cfg(feature = "abcipp")] +use crate::facade::tendermint_proto::abci::{tx_record::TxAction, TxRecord}; +use crate::node::ledger::shell::{process_tx, ShellMode}; use crate::node::ledger::shims::abcipp_shim_types::shim::TxBytes; impl Shell @@ -31,6 +39,7 @@ where // filter in half of the new txs from Tendermint, only keeping // wrappers let number_of_new_txs = 1 + req.txs.len() / 2; + #[cfg(feature = "abcipp")] let mut txs: Vec = req .txs .into_iter() @@ -45,21 +54,35 @@ where } }) .collect(); + #[cfg(not(feature = "abcipp"))] + let mut txs: Vec = req + .txs + .into_iter() + .take(number_of_new_txs) + .filter_map(|tx_bytes| { + if let Ok(Ok(TxType::Wrapper(_))) = + Tx::try_from(tx_bytes.as_slice()).map(process_tx) + { + Some(tx_bytes) + } else { + None + } + }) + .collect(); // decrypt the wrapper txs included in the previous block - let mut decrypted_txs = self - .storage - .tx_queue - .iter() - .map(|tx| { - Tx::from(match tx.decrypt(privkey) { - Ok(tx) => DecryptedTx::Decrypted(tx), - _ => DecryptedTx::Undecryptable(tx.clone()), - }) - .to_bytes() + let decrypted_txs = self.storage.tx_queue.iter().map(|tx| { + Tx::from(match tx.decrypt(privkey) { + Ok(tx) => DecryptedTx::Decrypted(tx), + _ => DecryptedTx::Undecryptable(tx.clone()), }) - .map(record::add) - .collect(); + .to_bytes() + }); + #[cfg(feature = "abcipp")] + let mut decrypted_txs: Vec<_> = + decrypted_txs.map(record::add).collect(); + #[cfg(not(feature = "abcipp"))] + let mut decrypted_txs: Vec<_> = decrypted_txs.collect(); txs.append(&mut decrypted_txs); txs @@ -67,18 +90,24 @@ where vec![] }; - response::PrepareProposal { - tx_records: txs, - ..Default::default() + #[cfg(feature = "abcipp")] + { + response::PrepareProposal { + tx_records: txs, + ..Default::default() + } + } + #[cfg(not(feature = "abcipp"))] + { + response::PrepareProposal { txs } } } } /// Functions for creating the appropriate TxRecord given the /// numeric code +#[cfg(feature = "abcipp")] pub(super) mod record { - use tendermint_proto::abci::tx_record::TxAction; - use super::*; /// Keep this transaction in the proposal @@ -110,10 +139,10 @@ pub(super) mod record { #[cfg(test)] mod test_prepare_proposal { + use borsh::BorshSerialize; use namada::types::address::xan; use namada::types::storage::Epoch; - use namada::types::transaction::Fee; - use tendermint_proto::abci::tx_record::TxAction; + use namada::types::transaction::{Fee, WrapperTx}; use super::*; use crate::node::ledger::shell::test_utils::{gen_keypair, TestShell}; @@ -133,10 +162,13 @@ mod test_prepare_proposal { max_tx_bytes: 0, ..Default::default() }; + #[cfg(feature = "abcipp")] assert_eq!( shell.prepare_proposal(req).tx_records, vec![record::remove(tx.to_bytes())] ); + #[cfg(not(feature = "abcipp"))] + assert!(shell.prepare_proposal(req).txs.is_empty()); } /// Test that if an error is encountered while @@ -170,15 +202,19 @@ mod test_prepare_proposal { ), ) .to_bytes(); + #[allow(clippy::redundant_clone)] let req = RequestPrepareProposal { txs: vec![wrapper.clone()], max_tx_bytes: 0, ..Default::default() }; + #[cfg(feature = "abcipp")] assert_eq!( shell.prepare_proposal(req).tx_records, vec![record::remove(wrapper)] ); + #[cfg(not(feature = "abcipp"))] + assert!(shell.prepare_proposal(req).txs.is_empty()); } /// Test that the decrypted txs are included @@ -229,32 +265,50 @@ mod test_prepare_proposal { .iter() .map(|tx| tx.data.clone().expect("Test failed")) .collect(); - - let received: Vec> = shell - .prepare_proposal(req) - .tx_records - .iter() - .filter_map( - |TxRecord { - tx: tx_bytes, - action, - }| { - if *action == (TxAction::Unmodified as i32) - || *action == (TxAction::Added as i32) - { - Some( - Tx::try_from(tx_bytes.as_slice()) - .expect("Test failed") - .data - .expect("Test failed"), - ) - } else { - None - } - }, - ) - .collect(); - // check that the order of the txs is correct - assert_eq!(received, expected_txs); + #[cfg(feature = "abcipp")] + { + let received: Vec> = shell + .prepare_proposal(req) + .tx_records + .iter() + .filter_map( + |TxRecord { + tx: tx_bytes, + action, + }| { + if *action == (TxAction::Unmodified as i32) + || *action == (TxAction::Added as i32) + { + Some( + Tx::try_from(tx_bytes.as_slice()) + .expect("Test failed") + .data + .expect("Test failed"), + ) + } else { + None + } + }, + ) + .collect(); + // check that the order of the txs is correct + assert_eq!(received, expected_txs); + } + #[cfg(not(feature = "abcipp"))] + { + let received: Vec> = shell + .prepare_proposal(req) + .txs + .into_iter() + .map(|tx_bytes| { + Tx::try_from(tx_bytes.as_slice()) + .expect("Test failed") + .data + .expect("Test failed") + }) + .collect(); + // check that the order of the txs is correct + assert_eq!(received, expected_txs); + } } } diff --git a/apps/src/lib/node/ledger/shell/process_proposal.rs b/apps/src/lib/node/ledger/shell/process_proposal.rs index 25375244ba..5572e00495 100644 --- a/apps/src/lib/node/ledger/shell/process_proposal.rs +++ b/apps/src/lib/node/ledger/shell/process_proposal.rs @@ -1,11 +1,10 @@ //! Implementation of the ['VerifyHeader`], [`ProcessProposal`], //! and [`RevertProposal`] ABCI++ methods for the Shell -use tendermint_proto::abci::response_process_proposal::ProposalStatus; -use tendermint_proto::abci::{ - ExecTxResult, RequestProcessProposal, ResponseProcessProposal, -}; use super::*; +use crate::facade::tendermint_proto::abci::response_process_proposal::ProposalStatus; +use crate::facade::tendermint_proto::abci::RequestProcessProposal; +use crate::node::ledger::shims::abcipp_shim_types::shim::response::ProcessProposal; impl Shell where @@ -27,28 +26,25 @@ where pub fn process_proposal( &self, req: RequestProcessProposal, - ) -> ResponseProcessProposal { + ) -> ProcessProposal { let tx_results = self.process_txs(&req.txs); - ResponseProcessProposal { + ProcessProposal { status: if tx_results.iter().any(|res| res.code > 3) { ProposalStatus::Reject as i32 } else { ProposalStatus::Accept as i32 }, tx_results, - ..Default::default() } } /// Check all the given txs. - pub fn process_txs(&self, txs: &[Vec]) -> Vec { + pub fn process_txs(&self, txs: &[Vec]) -> Vec { let mut tx_queue_iter = self.storage.tx_queue.iter(); txs.iter() .map(|tx_bytes| { - ExecTxResult::from( - self.process_single_tx(tx_bytes, &mut tx_queue_iter), - ) + self.process_single_tx(tx_bytes, &mut tx_queue_iter) }) .collect() } @@ -200,10 +196,10 @@ mod test_process_proposal { use namada::types::token::Amount; use namada::types::transaction::encrypted::EncryptedTx; use namada::types::transaction::{EncryptionKey, Fee}; - use tendermint_proto::abci::RequestInitChain; - use tendermint_proto::google::protobuf::Timestamp; use super::*; + use crate::facade::tendermint_proto::abci::RequestInitChain; + use crate::facade::tendermint_proto::google::protobuf::Timestamp; use crate::node::ledger::shell::test_utils::{ gen_keypair, ProcessProposal, TestError, TestShell, }; diff --git a/apps/src/lib/node/ledger/shell/queries.rs b/apps/src/lib/node/ledger/shell/queries.rs index 5b23078222..53587d5ebf 100644 --- a/apps/src/lib/node/ledger/shell/queries.rs +++ b/apps/src/lib/node/ledger/shell/queries.rs @@ -7,9 +7,9 @@ use namada::types::key; use namada::types::key::dkg_session_keys::DkgPublicKey; use namada::types::storage::{Key, PrefixValue}; use namada::types::token::{self, Amount}; -use tendermint_proto::crypto::{ProofOp, ProofOps}; use super::*; +use crate::facade::tendermint_proto::crypto::{ProofOp, ProofOps}; use crate::node::ledger::response; impl Shell @@ -206,7 +206,20 @@ where let mut cur_ops: Vec = p .ops .into_iter() - .map(|op| op.into()) + .map(|op| { + #[cfg(feature = "abcipp")] + { + ProofOp { + r#type: op.field_type, + key: op.key, + data: op.data, + } + } + #[cfg(not(feature = "abcipp"))] + { + op.into() + } + }) .collect(); ops.append(&mut cur_ops); } diff --git a/apps/src/lib/node/ledger/shims/abcipp_shim.rs b/apps/src/lib/node/ledger/shims/abcipp_shim.rs index ffe90c1d61..e919610f8e 100644 --- a/apps/src/lib/node/ledger/shims/abcipp_shim.rs +++ b/apps/src/lib/node/ledger/shims/abcipp_shim.rs @@ -5,16 +5,24 @@ use std::pin::Pin; use std::task::{Context, Poll}; use futures::future::FutureExt; -use tendermint_proto::abci::ResponseFinalizeBlock; +#[cfg(not(feature = "abcipp"))] +use namada::types::hash::Hash; +#[cfg(not(feature = "abcipp"))] +use namada::types::storage::BlockHash; +#[cfg(not(feature = "abcipp"))] +use namada::types::transaction::hash_tx; use tokio::sync::mpsc::UnboundedSender; use tower::Service; -use tower_abci::{BoxError, Request as Req, Response as Resp}; use super::super::Shell; use super::abcipp_shim_types::shim::request::{FinalizeBlock, ProcessedTx}; -use super::abcipp_shim_types::shim::response::TxResult; +#[cfg(not(feature = "abcipp"))] +use super::abcipp_shim_types::shim::TxBytes; use super::abcipp_shim_types::shim::{Error, Request, Response}; use crate::config; +#[cfg(not(feature = "abcipp"))] +use crate::facade::tendermint_proto::abci::RequestBeginBlock; +use crate::facade::tower_abci::{BoxError, Request as Req, Response as Resp}; /// The shim wraps the shell, which implements ABCI++. /// The shim makes a crude translation between the ABCI interface currently used @@ -22,6 +30,10 @@ use crate::config; #[derive(Debug)] pub struct AbcippShim { service: Shell, + #[cfg(not(feature = "abcipp"))] + begin_block_request: Option, + #[cfg(not(feature = "abcipp"))] + delivered_txs: Vec, shell_recv: std::sync::mpsc::Receiver<( Req, tokio::sync::oneshot::Sender>, @@ -52,12 +64,24 @@ impl AbcippShim { vp_wasm_compilation_cache, tx_wasm_compilation_cache, ), + #[cfg(not(feature = "abcipp"))] + begin_block_request: None, + #[cfg(not(feature = "abcipp"))] + delivered_txs: vec![], shell_recv, }, AbciService { shell_send }, ) } + #[cfg(not(feature = "abcipp"))] + /// Get the hash of the txs in the block + pub fn get_hash(&self) -> Hash { + let bytes: Vec = + self.delivered_txs.iter().flat_map(Clone::clone).collect(); + hash_tx(bytes.as_slice()) + } + /// Run the shell's blocking loop that receives messages from the /// [`AbciService`]. pub fn run(mut self) { @@ -69,48 +93,70 @@ impl AbcippShim { .map_err(Error::from) .and_then(|res| match res { Response::ProcessProposal(resp) => { - Ok(Resp::ProcessProposal(resp)) + Ok(Resp::ProcessProposal((&resp).into())) } _ => unreachable!(), }), + #[cfg(feature = "abcipp")] Req::FinalizeBlock(block) => { - // Process transactions first in the same way as - // `ProcessProposal`. let unprocessed_txs = block.txs.clone(); let processing_results = self.service.process_txs(&block.txs); let mut txs = Vec::with_capacity(unprocessed_txs.len()); for (result, tx) in processing_results - .iter() - .map(TxResult::from) + .into_iter() .zip(unprocessed_txs.into_iter()) { txs.push(ProcessedTx { tx, result }); } - let mut finalize_req: FinalizeBlock = block.into(); finalize_req.txs = txs; - self.service .call(Request::FinalizeBlock(finalize_req)) .map_err(Error::from) .and_then(|res| match res { Response::FinalizeBlock(resp) => { - let mut resp: ResponseFinalizeBlock = - resp.into(); - - // Add processing results - for (tx_result, processing_result) in resp - .tx_results - .iter_mut() - .zip(processing_results) - { - tx_result - .events - .extend(processing_result.events); - } - - Ok(Resp::FinalizeBlock(resp)) + Ok(Resp::FinalizeBlock(resp.into())) + } + _ => Err(Error::ConvertResp(res)), + }) + } + #[cfg(not(feature = "abcipp"))] + Req::BeginBlock(block) => { + // we save this data to be forwarded to finalize later + self.begin_block_request = Some(block); + Ok(Resp::BeginBlock(Default::default())) + } + #[cfg(not(feature = "abcipp"))] + Req::DeliverTx(tx) => { + self.delivered_txs.push(tx.tx); + Ok(Resp::DeliverTx(Default::default())) + } + #[cfg(not(feature = "abcipp"))] + Req::EndBlock(_) => { + let processing_results = + self.service.process_txs(&self.delivered_txs); + let mut txs = Vec::with_capacity(self.delivered_txs.len()); + let mut delivered = vec![]; + std::mem::swap(&mut self.delivered_txs, &mut delivered); + for (result, tx) in processing_results + .into_iter() + .zip(delivered.into_iter()) + { + txs.push(ProcessedTx { tx, result }); + } + let mut end_block_request: FinalizeBlock = + 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)) + .map_err(Error::from) + .and_then(|res| match res { + Response::FinalizeBlock(resp) => { + Ok(Resp::EndBlock(resp.into())) } _ => Err(Error::ConvertResp(res)), }) 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 bea7ba56af..5d9f2c420c 100644 --- a/apps/src/lib/node/ledger/shims/abcipp_shim_types.rs +++ b/apps/src/lib/node/ledger/shims/abcipp_shim_types.rs @@ -1,9 +1,24 @@ +#[cfg(not(feature = "abcipp"))] use tower_abci::{Request, Response}; +#[cfg(feature = "abcipp")] +use tower_abci_abcipp::{Request, Response}; pub mod shim { use std::convert::TryFrom; + #[cfg(not(feature = "abcipp"))] use tendermint_proto::abci::{ + RequestApplySnapshotChunk, RequestCheckTx, RequestCommit, RequestEcho, + RequestFlush, RequestInfo, RequestInitChain, RequestListSnapshots, + RequestLoadSnapshotChunk, RequestOfferSnapshot, RequestPrepareProposal, + RequestProcessProposal, RequestQuery, ResponseApplySnapshotChunk, + ResponseCheckTx, ResponseCommit, ResponseEcho, ResponseEndBlock, + ResponseFlush, ResponseInfo, ResponseInitChain, ResponseListSnapshots, + ResponseLoadSnapshotChunk, ResponseOfferSnapshot, + ResponsePrepareProposal, ResponseQuery, + }; + #[cfg(feature = "abcipp")] + use tendermint_proto_abcipp::abci::{ RequestApplySnapshotChunk, RequestCheckTx, RequestCommit, RequestEcho, RequestExtendVote, RequestFlush, RequestInfo, RequestInitChain, RequestListSnapshots, RequestLoadSnapshotChunk, RequestOfferSnapshot, @@ -12,8 +27,7 @@ pub mod shim { ResponseCheckTx, ResponseCommit, ResponseEcho, ResponseExtendVote, ResponseFlush, ResponseInfo, ResponseInitChain, ResponseListSnapshots, ResponseLoadSnapshotChunk, ResponseOfferSnapshot, - ResponsePrepareProposal, ResponseProcessProposal, ResponseQuery, - ResponseVerifyVoteExtension, + ResponsePrepareProposal, ResponseQuery, ResponseVerifyVoteExtension, }; use thiserror::Error; @@ -57,7 +71,9 @@ pub mod shim { ProcessProposal(RequestProcessProposal), #[allow(dead_code)] RevertProposal(request::RevertProposal), + #[cfg(feature = "abcipp")] ExtendVote(RequestExtendVote), + #[cfg(feature = "abcipp")] VerifyVoteExtension(RequestVerifyVoteExtension), FinalizeBlock(request::FinalizeBlock), Commit(RequestCommit), @@ -82,7 +98,9 @@ pub mod shim { Req::Commit(inner) => Ok(Request::Commit(inner)), Req::Flush(inner) => Ok(Request::Flush(inner)), Req::Echo(inner) => Ok(Request::Echo(inner)), + #[cfg(feature = "abcipp")] Req::ExtendVote(inner) => Ok(Request::ExtendVote(inner)), + #[cfg(feature = "abcipp")] Req::VerifyVoteExtension(inner) => { Ok(Request::VerifyVoteExtension(inner)) } @@ -113,11 +131,15 @@ pub mod shim { Query(ResponseQuery), PrepareProposal(ResponsePrepareProposal), VerifyHeader(response::VerifyHeader), - ProcessProposal(ResponseProcessProposal), + ProcessProposal(response::ProcessProposal), RevertProposal(response::RevertProposal), + #[cfg(feature = "abcipp")] ExtendVote(ResponseExtendVote), + #[cfg(feature = "abcipp")] VerifyVoteExtension(ResponseVerifyVoteExtension), FinalizeBlock(response::FinalizeBlock), + #[cfg(not(feature = "abcipp"))] + EndBlock(ResponseEndBlock), Commit(ResponseCommit), Flush(ResponseFlush), Echo(ResponseEcho), @@ -156,7 +178,9 @@ pub mod shim { Response::PrepareProposal(inner) => { Ok(Resp::PrepareProposal(inner)) } + #[cfg(feature = "abcipp")] Response::ExtendVote(inner) => Ok(Resp::ExtendVote(inner)), + #[cfg(feature = "abcipp")] Response::VerifyVoteExtension(inner) => { Ok(Resp::VerifyVoteExtension(inner)) } @@ -169,10 +193,15 @@ pub mod shim { pub mod request { use std::convert::TryFrom; + #[cfg(not(feature = "abcipp"))] + use namada::tendermint_proto::abci::RequestBeginBlock; use namada::types::hash::Hash; use namada::types::storage::{BlockHash, Header}; use namada::types::time::DateTimeUtc; - use tendermint_proto::abci::{ + #[cfg(not(feature = "abcipp"))] + use tendermint_proto::abci::Misbehavior as Evidence; + #[cfg(feature = "abcipp")] + use tendermint_proto_abcipp::abci::{ Misbehavior as Evidence, RequestFinalizeBlock, }; @@ -194,6 +223,7 @@ pub mod shim { pub txs: Vec, } + #[cfg(feature = "abcipp")] impl From for FinalizeBlock { fn from(req: RequestFinalizeBlock) -> FinalizeBlock { FinalizeBlock { @@ -211,17 +241,44 @@ pub mod shim { } } } + + #[cfg(not(feature = "abcipp"))] + impl From for FinalizeBlock { + fn from(req: RequestBeginBlock) -> FinalizeBlock { + let header = req.header.unwrap(); + FinalizeBlock { + hash: BlockHash::default(), + header: Header { + hash: Hash::default(), + time: DateTimeUtc::try_from(header.time.unwrap()) + .unwrap(), + next_validators_hash: Hash::try_from( + header.next_validators_hash.as_slice(), + ) + .unwrap(), + }, + byzantine_validators: req.byzantine_validators, + txs: vec![], + } + } + } } /// Custom types for response payloads pub mod response { - use tendermint_proto::abci::{ - Event as TmEvent, ExecTxResult, ResponseFinalizeBlock, - ValidatorUpdate, + use crate::facade::tendermint_proto::abci::{ + Event as TmEvent, ResponseProcessProposal, ValidatorUpdate, }; - use tendermint_proto::types::ConsensusParams; - - use crate::node::ledger::events::{Event, EventLevel}; + #[cfg(not(feature = "abcipp"))] + use crate::facade::tendermint_proto::types::ConsensusParams; + #[cfg(feature = "abcipp")] + use crate::facade::tendermint_proto::{ + abci::{ExecTxResult, ResponseFinalizeBlock}, + types::ConsensusParams, + }; + use crate::node::ledger::events::Event; + #[cfg(feature = "abcipp")] + use crate::node::ledger::events::EventLevel; #[derive(Debug, Default)] pub struct VerifyHeader; @@ -232,6 +289,7 @@ pub mod shim { pub info: String, } + #[cfg(feature = "abcipp")] impl From for ExecTxResult { fn from(TxResult { code, info }: TxResult) -> Self { ExecTxResult { @@ -242,6 +300,7 @@ pub mod shim { } } + #[cfg(feature = "abcipp")] impl From<&ExecTxResult> for TxResult { fn from(ExecTxResult { code, info, .. }: &ExecTxResult) -> Self { TxResult { @@ -251,6 +310,36 @@ pub mod shim { } } + #[derive(Debug, Default)] + pub struct ProcessProposal { + pub status: i32, + pub tx_results: Vec, + } + + #[cfg(feature = "abcipp")] + impl From<&ProcessProposal> for ResponseProcessProposal { + fn from(resp: &ProcessProposal) -> Self { + Self { + status: resp.status, + tx_results: resp + .tx_results + .iter() + .map(|res| ExecTxResult::from(res.clone())) + .collect(), + ..Default::default() + } + } + } + + #[cfg(not(feature = "abcipp"))] + impl From<&ProcessProposal> for ResponseProcessProposal { + fn from(resp: &ProcessProposal) -> Self { + Self { + status: resp.status, + } + } + } + #[derive(Debug, Default)] pub struct RevertProposal; @@ -261,6 +350,7 @@ pub mod shim { pub consensus_param_updates: Option, } + #[cfg(feature = "abcipp")] impl From for ResponseFinalizeBlock { fn from(resp: FinalizeBlock) -> Self { ResponseFinalizeBlock { @@ -299,5 +389,20 @@ pub mod shim { } } } + + #[cfg(not(feature = "abcipp"))] + impl From for tendermint_proto::abci::ResponseEndBlock { + fn from(resp: FinalizeBlock) -> Self { + Self { + events: resp + .events + .into_iter() + .map(TmEvent::from) + .collect(), + validator_updates: resp.validator_updates, + consensus_param_updates: resp.consensus_param_updates, + } + } + } } } diff --git a/apps/src/lib/node/ledger/tendermint_node.rs b/apps/src/lib/node/ledger/tendermint_node.rs index 181f72cb4b..a19a5d7f13 100644 --- a/apps/src/lib/node/ledger/tendermint_node.rs +++ b/apps/src/lib/node/ledger/tendermint_node.rs @@ -8,15 +8,17 @@ use namada::types::chain::ChainId; use namada::types::key::*; use namada::types::time::DateTimeUtc; use serde_json::json; -use tendermint::Genesis; -use tendermint_config::net::Address as TendermintAddress; -use tendermint_config::{Error as TendermintError, TendermintConfig}; use thiserror::Error; use tokio::fs::{self, File, OpenOptions}; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::process::Command; use crate::config; +use crate::facade::tendermint::Genesis; +use crate::facade::tendermint_config::net::Address as TendermintAddress; +use crate::facade::tendermint_config::{ + Error as TendermintError, TendermintConfig, +}; /// Env. var to output Tendermint log to stdout pub const ENV_VAR_TM_STDOUT: &str = "ANOMA_TM_STDOUT"; @@ -100,16 +102,17 @@ pub async fn run( write_validator_key_async(&home_dir, &consensus_key).await; } } + #[cfg(feature = "abcipp")] write_tm_genesis(&home_dir, chain_id, genesis_time, &config).await; + #[cfg(not(feature = "abcipp"))] + write_tm_genesis(&home_dir, chain_id, genesis_time).await; update_tendermint_config(&home_dir, config).await?; let mut tendermint_node = Command::new(&tendermint_path); tendermint_node.args(&[ "start", - "--mode", - &mode, - "--proxy-app", + "--proxy_app", &ledger_address, "--home", &home_dir_string, @@ -168,7 +171,7 @@ pub fn reset(tendermint_dir: impl AsRef) -> Result<()> { // reset all the Tendermint state, if any std::process::Command::new(tendermint_path) .args(&[ - "reset", + "reset-state", "unsafe-all", // NOTE: log config: https://docs.tendermint.com/master/nodes/logging.html#configuring-log-levels // "--log-level=\"*debug\"", @@ -333,15 +336,6 @@ async fn update_tendermint_config( config.instrumentation.namespace = tendermint_config.instrumentation_namespace; - // setup the events log - { - // keep events for one minute - config.rpc.event_log_window_size = - std::time::Duration::from_secs(59).into(); - // we do not limit the size of the events log - config.rpc.event_log_max_items = 0; - } - let mut file = OpenOptions::new() .write(true) .truncate(true) @@ -359,7 +353,7 @@ async fn write_tm_genesis( home_dir: impl AsRef, chain_id: ChainId, genesis_time: DateTimeUtc, - config: &config::Tendermint, + #[cfg(feature = "abcipp")] config: &config::Tendermint, ) { let home_dir = home_dir.as_ref(); let path = home_dir.join("config").join("genesis.json"); @@ -380,8 +374,11 @@ async fn write_tm_genesis( genesis.genesis_time = genesis_time .try_into() .expect("Couldn't convert DateTimeUtc to Tendermint Time"); - genesis.consensus_params.timeout.commit = - config.consensus_timeout_commit.into(); + #[cfg(feature = "abcipp")] + { + genesis.consensus_params.timeout.commit = + config.consensus_timeout_commit.into(); + } let mut file = OpenOptions::new() .write(true) diff --git a/shared/Cargo.toml b/shared/Cargo.toml index 946dd6268e..ca9df13cf9 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -9,7 +9,7 @@ version = "0.8.0" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -default = [] +default = ["abciplus"] # NOTE "dev" features that shouldn't be used in live networks are enabled by default for now dev = [] ferveo-tpke = [ @@ -22,6 +22,9 @@ ferveo-tpke = [ ibc-mocks = [ "ibc/mocks", ] +ibc-mocks-abcipp = [ + "ibc-abcipp/mocks", +] # for integration tests and test utilies testing = [ "proptest", @@ -47,6 +50,20 @@ secp256k1-sign-verify = [ "libsecp256k1/hmac", ] +abcipp = [ + "ibc-proto-abcipp", + "ibc-abcipp", + "tendermint-abcipp", + "tendermint-proto-abcipp" +] + +abciplus = [ + "ibc", + "ibc-proto", + "tendermint", + "tendermint-proto", +] + [dependencies] namada_proof_of_stake = {path = "../proof_of_stake"} ark-bls12-381 = {version = "0.3"} @@ -67,8 +84,10 @@ ferveo = {optional = true, git = "https://github.com/anoma/ferveo"} ferveo-common = {git = "https://github.com/anoma/ferveo"} tpke = {package = "group-threshold-cryptography", optional = true, git = "https://github.com/anoma/ferveo"} # TODO using the same version of tendermint-rs as we do here. -ibc = {package = "ibc", git = "https://github.com/heliaxdev/ibc-rs", rev = "9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d", default-features = false} -ibc-proto = {package = "ibc-proto", git = "https://github.com/heliaxdev/ibc-rs", rev = "9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d", default-features = false} +ibc-abcipp = {package = "ibc", git = "https://github.com/heliaxdev/ibc-rs", rev = "9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d", default-features = false, optional = true} +ibc-proto-abcipp = {package = "ibc-proto", git = "https://github.com/heliaxdev/ibc-rs", rev = "9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d", default-features = false, optional = true} +ibc = {version = "0.14.0", default-features = false, optional = true} +ibc-proto = {version = "0.17.1", default-features = false, optional = true} ics23 = "0.7.0" itertools = "0.10.0" loupe = {version = "0.1.3", optional = true} @@ -89,8 +108,10 @@ sha2 = "0.9.3" # We switch off "blake2b" because it cannot be compiled to wasm tempfile = {version = "3.2.0", optional = true} # temporarily using fork work-around for https://github.com/informalsystems/tendermint-rs/issues/971 -tendermint = {git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", features = ["secp256k1"]} -tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9"} +tendermint-abcipp = {package = "tendermint", git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", optional = true} +tendermint-proto-abcipp = {package = "tendermint-proto", git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9", optional = true} +tendermint = {version = "0.23.6", optional = true} +tendermint-proto = {version = "0.23.6", optional = true} thiserror = "1.0.30" tracing = "0.1.30" wasmer = {version = "=2.2.0", optional = true} diff --git a/shared/src/ledger/ibc/handler.rs b/shared/src/ledger/ibc/handler.rs index ac510d8b91..0759077e22 100644 --- a/shared/src/ledger/ibc/handler.rs +++ b/shared/src/ledger/ibc/handler.rs @@ -65,7 +65,7 @@ use crate::ibc::core::ics24_host::identifier::{ }; use crate::ibc::core::ics26_routing::msgs::Ics26Envelope; use crate::ibc::events::IbcEvent; -#[cfg(any(feature = "ibc-mocks-abci", feature = "ibc-mocks"))] +#[cfg(any(feature = "ibc-mocks-abcipp", feature = "ibc-mocks"))] use crate::ibc::mock::client_state::{MockClientState, MockConsensusState}; use crate::ibc::timestamp::Timestamp; use crate::ledger::ibc::storage; @@ -1089,12 +1089,12 @@ pub fn update_client( let new_consensus_state = TmConsensusState::from(h).wrap_any(); Ok((new_client_state, new_consensus_state)) } - #[cfg(any(feature = "ibc-mocks-abci", feature = "ibc-mocks"))] + #[cfg(any(feature = "ibc-mocks-abcipp", feature = "ibc-mocks"))] _ => Err(Error::ClientUpdate( "The header type is mismatched".to_owned(), )), }, - #[cfg(any(feature = "ibc-mocks-abci", feature = "ibc-mocks"))] + #[cfg(any(feature = "ibc-mocks-abcipp", feature = "ibc-mocks"))] AnyClientState::Mock(_) => match header { AnyHeader::Mock(h) => Ok(( MockClientState::new(h).wrap_any(), diff --git a/shared/src/ledger/storage/merkle_tree.rs b/shared/src/ledger/storage/merkle_tree.rs index 9e64f0efe6..4ac2201bbe 100644 --- a/shared/src/ledger/storage/merkle_tree.rs +++ b/shared/src/ledger/storage/merkle_tree.rs @@ -11,7 +11,6 @@ use borsh::{BorshDeserialize, BorshSerialize}; use ics23::commitment_proof::Proof as Ics23Proof; use ics23::{CommitmentProof, ExistenceProof, NonExistenceProof}; use prost::Message; -use tendermint::merkle::proof::{Proof, ProofOp}; use thiserror::Error; use super::traits::{StorageHasher, SubTreeRead, SubTreeWrite}; @@ -19,6 +18,7 @@ use super::IBC_KEY_LIMIT; use crate::bytes::ByteBuf; use crate::ledger::storage::ics23_specs::{self, ibc_leaf_spec}; use crate::ledger::storage::types; +use crate::tendermint::merkle::proof::{Proof, ProofOp}; use crate::types::address::{Address, InternalAddress}; use crate::types::hash::Hash; use crate::types::storage::{ diff --git a/shared/src/ledger/storage/mod.rs b/shared/src/ledger/storage/mod.rs index 2467e10cca..16c3ecf180 100644 --- a/shared/src/ledger/storage/mod.rs +++ b/shared/src/ledger/storage/mod.rs @@ -11,7 +11,6 @@ pub mod write_log; use core::fmt::Debug; use std::array; -use tendermint::merkle::proof::Proof; use thiserror::Error; use super::parameters::Parameters; @@ -26,6 +25,7 @@ pub use crate::ledger::storage::merkle_tree::{ MerkleTree, MerkleTreeStoresRead, MerkleTreeStoresWrite, StoreType, }; pub use crate::ledger::storage::traits::{Sha256Hasher, StorageHasher}; +use crate::tendermint::merkle::proof::Proof; use crate::types::address::{Address, EstablishedAddressGen, InternalAddress}; use crate::types::chain::{ChainId, CHAIN_ID_LENGTH}; #[cfg(feature = "ferveo-tpke")] diff --git a/shared/src/lib.rs b/shared/src/lib.rs index 5c2d2fe4d7..6faaf2ff36 100644 --- a/shared/src/lib.rs +++ b/shared/src/lib.rs @@ -6,7 +6,14 @@ #![deny(rustdoc::broken_intra_doc_links)] #![deny(rustdoc::private_intra_doc_links)] +#[cfg(not(feature = "abcipp"))] pub use {ibc, ibc_proto, tendermint, tendermint_proto}; +#[cfg(feature = "abcipp")] +pub use { + ibc_abcipp as ibc, ibc_proto_abcipp as ibc_proto, + tendermint_abcipp as tendermint, + tendermint_proto_abcipp as tendermint_proto, +}; pub mod bytes; pub mod ledger; diff --git a/shared/src/types/hash.rs b/shared/src/types/hash.rs index d2c27f96d4..229cd56063 100644 --- a/shared/src/types/hash.rs +++ b/shared/src/types/hash.rs @@ -8,10 +8,11 @@ use arse_merkle_tree::Hash as TreeHash; use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; -use tendermint::abci::transaction; -use tendermint::Hash as TmHash; use thiserror::Error; +use crate::tendermint::abci::transaction; +use crate::tendermint::Hash as TmHash; + /// The length of the transaction hash string pub const HASH_LENGTH: usize = 32; diff --git a/shared/src/types/time.rs b/shared/src/types/time.rs index ec91ff5b14..dfca614c82 100644 --- a/shared/src/types/time.rs +++ b/shared/src/types/time.rs @@ -6,10 +6,10 @@ use std::ops::{Add, Sub}; use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; pub use chrono::{DateTime, Duration, TimeZone, Utc}; -use tendermint_proto::google::protobuf; use crate::tendermint::time::Time; use crate::tendermint::Error as TendermintError; +use crate::tendermint_proto::google::protobuf; /// Check if the given `duration` has passed since the given `start. pub fn duration_passed( diff --git a/tests/src/e2e/ledger_tests.rs b/tests/src/e2e/ledger_tests.rs index d3eff1314f..a998844764 100644 --- a/tests/src/e2e/ledger_tests.rs +++ b/tests/src/e2e/ledger_tests.rs @@ -51,7 +51,7 @@ fn run_ledger() -> Result<()> { let mut ledger = run_as!(test, Who::NonValidator, Bin::Node, args, Some(40))?; ledger.exp_string("Anoma ledger node started")?; - ledger.exp_string("This node is a fullnode")?; + ledger.exp_string("This node is not a validator")?; } Ok(()) @@ -80,11 +80,11 @@ fn test_node_connectivity() -> Result<()> { let mut non_validator = run_as!(test, Who::NonValidator, Bin::Node, args, Some(40))?; non_validator.exp_string("Anoma ledger node started")?; - non_validator.exp_string("This node is a fullnode")?; + non_validator.exp_string("This node is not a validator")?; let bg_validator_0 = validator_0.background(); let bg_validator_1 = validator_1.background(); - let bg_non_validator = non_validator.background(); + let _bg_non_validator = non_validator.background(); // 2. Submit a valid token transfer tx let validator_one_rpc = get_actor_rpc(&test, &Who::Validator(0)); @@ -111,15 +111,39 @@ fn test_node_connectivity() -> Result<()> { client.exp_string("Transaction is valid.")?; client.assert_success(); - // 3. Check that all the nodes processed the tx with the same result + // 3. Check that all the nodes processed the tx and report the same balance + let mut validator_0 = bg_validator_0.foreground(); let mut validator_1 = bg_validator_1.foreground(); - let mut non_validator = bg_non_validator.foreground(); - let expected_result = "all VPs accepted transaction"; + // We cannot check this on non-validator node as it might sync without + // applying the tx itself, but its state should be the same, checked below. validator_0.exp_string(expected_result)?; validator_1.exp_string(expected_result)?; - non_validator.exp_string(expected_result)?; + let _bg_validator_0 = validator_0.background(); + let _bg_validator_1 = validator_1.background(); + + let query_balance_args = |ledger_rpc| { + vec![ + "balance", + "--owner", + ALBERT, + "--token", + XAN, + "--ledger-address", + ledger_rpc, + ] + }; + + let validator_0_rpc = get_actor_rpc(&test, &Who::Validator(0)); + let validator_1_rpc = get_actor_rpc(&test, &Who::Validator(1)); + let non_validator_rpc = get_actor_rpc(&test, &Who::NonValidator); + for ledger_rpc in &[validator_0_rpc, validator_1_rpc, non_validator_rpc] { + let mut client = + run!(test, Bin::Client, query_balance_args(ledger_rpc), Some(40))?; + client.exp_string("XAN: 1000010.1")?; + client.assert_success(); + } Ok(()) } @@ -1820,7 +1844,7 @@ fn test_genesis_validators() -> Result<()> { let mut non_validator = run_as!(test, Who::NonValidator, Bin::Node, args, Some(40))?; non_validator.exp_string("Anoma ledger node started")?; - non_validator.exp_string("This node is a fullnode")?; + non_validator.exp_string("This node is not a validator")?; let bg_validator_0 = validator_0.background(); let bg_validator_1 = validator_1.background(); diff --git a/vm_env/Cargo.toml b/vm_env/Cargo.toml index 7e7b55a058..e8d04e3da3 100644 --- a/vm_env/Cargo.toml +++ b/vm_env/Cargo.toml @@ -7,8 +7,16 @@ resolver = "2" version = "0.8.0" [features] -default = [] +default = ["abciplus"] + +abciplus = [ + "namada/abciplus", +] + +abcipp = [ + "namada/abcipp", +] [dependencies] -namada = {path = "../shared"} +namada = {path = "../shared", default-features = false} borsh = "0.9.0" diff --git a/wasm/Cargo.lock b/wasm/Cargo.lock index 9287c81fc4..be92cfe2ed 100644 --- a/wasm/Cargo.lock +++ b/wasm/Cargo.lock @@ -163,9 +163,9 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "async-trait" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" +checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" dependencies = [ "proc-macro2", "quote", @@ -193,12 +193,6 @@ 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" @@ -314,9 +308,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "bytecheck" @@ -406,12 +400,6 @@ 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" @@ -551,18 +539,6 @@ 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" @@ -573,16 +549,6 @@ dependencies = [ "typenum", ] -[[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 = "curve25519-dalek" version = "3.2.0" @@ -611,9 +577,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f39818dcfc97d45b03953c1292efc4e80954e1583c4aa770bac1383e2310a4" +checksum = "3f83d0ebf42c6eafb8d7c52f7e5f2d3003b89c7aa4fd2b79229209459a849af8" dependencies = [ "cc", "cxxbridge-flags", @@ -623,9 +589,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e580d70777c116df50c390d1211993f62d40302881e54d4b79727acb83d0199" +checksum = "07d050484b55975889284352b0ffc2ecbda25c0c55978017c132b29ba0818a86" dependencies = [ "cc", "codespan-reporting", @@ -638,15 +604,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56a46460b88d1cec95112c8c363f0e2c39afdb237f60583b0b36343bf627ea9c" +checksum = "99d2199b00553eda8012dfec8d3b1c75fce747cf27c169a270b3b99e3448ab78" [[package]] name = "cxxbridge-macro" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747b608fecf06b0d72d440f27acc99288207324b793be2c17991839f3d4995ea" +checksum = "dcb67a6de1f602736dd7eaead0080cf3435df806c61b24b13328db128c58868f" dependencies = [ "proc-macro2", "quote", @@ -693,15 +659,6 @@ 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" @@ -770,18 +727,6 @@ 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" @@ -824,24 +769,6 @@ 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" @@ -921,16 +848,6 @@ 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" @@ -953,15 +870,6 @@ 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" @@ -1061,17 +969,6 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" -[[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" @@ -1134,16 +1031,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac", - "digest 0.9.0", -] - [[package]] name = "iana-time-zone" version = "0.1.51" @@ -1160,9 +1047,9 @@ dependencies = [ [[package]] name = "iana-time-zone-haiku" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde6edd6cef363e9359ed3c98ba64590ba9eecba2293eb5a723ab32aee8926aa" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" dependencies = [ "cxx", "cxx-build", @@ -1171,7 +1058,7 @@ dependencies = [ [[package]] name = "ibc" version = "0.14.0" -source = "git+https://github.com/heliaxdev/ibc-rs?rev=9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d#9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d" +source = "git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2#f4703dfe2c1f25cc431279ab74f10f3e0f6827e2" dependencies = [ "bytes", "derive_more", @@ -1198,7 +1085,7 @@ dependencies = [ [[package]] name = "ibc-proto" version = "0.17.1" -source = "git+https://github.com/heliaxdev/ibc-rs?rev=9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d#9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d" +source = "git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2#f4703dfe2c1f25cc431279ab74f10f3e0f6827e2" dependencies = [ "base64", "bytes", @@ -1230,16 +1117,6 @@ 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" @@ -1290,19 +1167,6 @@ 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" @@ -1728,39 +1592,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" -[[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" @@ -1781,26 +1612,6 @@ 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" @@ -1854,9 +1665,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.46" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] @@ -2130,17 +1941,6 @@ dependencies = [ "bytecheck", ] -[[package]] -name = "rfc6979" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" -dependencies = [ - "crypto-bigint", - "hmac", - "zeroize", -] - [[package]] name = "ripemd160" version = "0.9.1" @@ -2280,15 +2080,6 @@ 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 = "scopeguard" version = "1.1.0" @@ -2307,18 +2098,6 @@ 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", - "subtle", - "zeroize", -] - [[package]] name = "semver" version = "0.11.0" @@ -2435,13 +2214,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.4.0" +version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" -dependencies = [ - "digest 0.9.0", - "rand_core 0.6.4", -] +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" [[package]] name = "simple-error" @@ -2544,8 +2319,8 @@ dependencies = [ [[package]] name = "tendermint" -version = "0.23.5" -source = "git+https://github.com/heliaxdev/tendermint-rs?rev=95c52476bc37927218374f94ac8e2a19bd35bec9#95c52476bc37927218374f94ac8e2a19bd35bec9" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" dependencies = [ "async-trait", "bytes", @@ -2553,12 +2328,10 @@ dependencies = [ "ed25519-dalek", "flex-error", "futures", - "k256", "num-traits", "once_cell", "prost", "prost-types", - "ripemd160", "serde", "serde_bytes", "serde_json", @@ -2572,36 +2345,22 @@ dependencies = [ "zeroize", ] -[[package]] -name = "tendermint-config" -version = "0.23.5" -source = "git+https://github.com/heliaxdev/tendermint-rs?rev=95c52476bc37927218374f94ac8e2a19bd35bec9#95c52476bc37927218374f94ac8e2a19bd35bec9" -dependencies = [ - "flex-error", - "serde", - "serde_json", - "tendermint", - "toml", - "url", -] - [[package]] name = "tendermint-light-client-verifier" -version = "0.23.5" -source = "git+https://github.com/heliaxdev/tendermint-rs?rev=95c52476bc37927218374f94ac8e2a19bd35bec9#95c52476bc37927218374f94ac8e2a19bd35bec9" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" dependencies = [ "derive_more", "flex-error", "serde", "tendermint", - "tendermint-rpc", "time", ] [[package]] name = "tendermint-proto" -version = "0.23.5" -source = "git+https://github.com/heliaxdev/tendermint-rs?rev=95c52476bc37927218374f94ac8e2a19bd35bec9#95c52476bc37927218374f94ac8e2a19bd35bec9" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" dependencies = [ "bytes", "flex-error", @@ -2615,34 +2374,10 @@ dependencies = [ "time", ] -[[package]] -name = "tendermint-rpc" -version = "0.23.5" -source = "git+https://github.com/heliaxdev/tendermint-rs?rev=95c52476bc37927218374f94ac8e2a19bd35bec9#95c52476bc37927218374f94ac8e2a19bd35bec9" -dependencies = [ - "bytes", - "flex-error", - "getrandom", - "peg", - "pin-project", - "serde", - "serde_bytes", - "serde_json", - "subtle-encoding", - "tendermint", - "tendermint-config", - "tendermint-proto", - "thiserror", - "time", - "url", - "uuid", - "walkdir", -] - [[package]] name = "tendermint-testgen" -version = "0.23.5" -source = "git+https://github.com/heliaxdev/tendermint-rs?rev=95c52476bc37927218374f94ac8e2a19bd35bec9#95c52476bc37927218374f94ac8e2a19bd35bec9" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" dependencies = [ "ed25519-dalek", "gumdrop", @@ -2720,21 +2455,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" -[[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 = "toml" version = "0.5.9" @@ -2827,27 +2547,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" -[[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" @@ -2866,23 +2571,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[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 = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" - [[package]] name = "version_check" version = "0.9.4" @@ -2909,17 +2597,6 @@ 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 = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/wasm/Cargo.toml b/wasm/Cargo.toml index 1231ef03a8..d6f164a445 100644 --- a/wasm/Cargo.toml +++ b/wasm/Cargo.toml @@ -13,6 +13,15 @@ borsh = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4 borsh-derive = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"} borsh-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"} borsh-schema-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"} +# patched to a commit on the `eth-bridge-integration` branch of our fork +tendermint = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} +tendermint-proto = {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-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"} [profile.release] # smaller and faster wasm (https://rustwasm.github.io/book/reference/code-size.html#compiling-with-link-time-optimizations-lto) diff --git a/wasm/checksums.json b/wasm/checksums.json index 8ddbe1dc85..bafc05c130 100644 --- a/wasm/checksums.json +++ b/wasm/checksums.json @@ -1,18 +1,18 @@ { - "tx_bond.wasm": "tx_bond.865260ca3ca9ed4c611cc5cbc8b4d864232f447f06c59afa0b7c1c63c3fa897c.wasm", - "tx_ibc.wasm": "tx_ibc.1360fdf276c4591d937aaac3bb40ddb573abeba382651474ae23138aac65c3e5.wasm", - "tx_init_account.wasm": "tx_init_account.72d9e1daa43998ce617eafba1547b34f26b128f0fb6e02cfdbc85ecf1f345fd4.wasm", - "tx_init_nft.wasm": "tx_init_nft.22a886305fda24438dbf3fc0f864ee32db4a398bf748edd2fddba1fc4679bc35.wasm", - "tx_init_proposal.wasm": "tx_init_proposal.649bde547179ebee5449f5954425cd266c5063fae97f98f06de327387e8898ba.wasm", - "tx_init_validator.wasm": "tx_init_validator.d40077c1bf1263e1e8e42f54cd893473c5d9c1f395e5d30f44a34d98d9b8dde4.wasm", - "tx_mint_nft.wasm": "tx_mint_nft.78b3a43c5c5b4362cb3023c8e7e25755447e9022952306a62f2d8aab6e99dbee.wasm", - "tx_transfer.wasm": "tx_transfer.4c06f6af1f008fccdd42fefdc8015adea9fa60f802603a8be149ec2c6421656e.wasm", - "tx_unbond.wasm": "tx_unbond.c3d54895e1a271c86838d54d821d52b5bf5764928811cff30767a4445ebbf653.wasm", - "tx_update_vp.wasm": "tx_update_vp.3b709f301e55cb970ec1df98c85c2486561c3243ab1c191d3e078ee345b8b93a.wasm", - "tx_vote_proposal.wasm": "tx_vote_proposal.671b46a77d03d10ca4e406f2bbc48adba0e541272a2963fd88d3a8c60e888fcd.wasm", - "tx_withdraw.wasm": "tx_withdraw.39e0012e110b19c7000400d11adc355bd8e89605b3c9ca10017c4766eed0ad69.wasm", - "vp_nft.wasm": "vp_nft.b23df820ae3faa13c9ed73121886b712fa0c613b7f43567f528cda05ef75fab6.wasm", - "vp_testnet_faucet.wasm": "vp_testnet_faucet.45c740dcfa6e803d55a56cb51b02f2086147dfef3e955c0e8c3f18bf93ae0227.wasm", - "vp_token.wasm": "vp_token.74bca3c9999640c39bbd1c1364b65ffe8086e2d3ed124413251295d527326b57.wasm", - "vp_user.wasm": "vp_user.1c75ea1e55eb1244f023a525f9e20f0d34e52aebf0bd008dcf122fdc13bdf16a.wasm" + "tx_bond.wasm": "tx_bond.a072c36568bcdedabee4d48b8739c3d49ecd38b0a48dbd2bb5cac7921b134548.wasm", + "tx_ibc.wasm": "tx_ibc.c86d31490666c222e6d0be41ea533f3e07b04f313641988f5bb793c66944455d.wasm", + "tx_init_account.wasm": "tx_init_account.f5043c92f0f7b1dd75ba66e9f8cde3f463d1777d358993e7f9ec2c17d8652dd4.wasm", + "tx_init_nft.wasm": "tx_init_nft.18b751c8ca1851669450779769346922b42f2e968c8503752a027cb454e55655.wasm", + "tx_init_proposal.wasm": "tx_init_proposal.088bf0e95880dcd8732637a03af7c066ec8a4823bef18bbd55996af5795eada4.wasm", + "tx_init_validator.wasm": "tx_init_validator.4cb99abadd6bf823cfc1703c9f5430b2b2ae27fd210cb442b36fe25d0d8dddb2.wasm", + "tx_mint_nft.wasm": "tx_mint_nft.a57ed7a2e1d7b7bd32dba3892dfcadde4f59a9f2be607ed93b00371578bafb6e.wasm", + "tx_transfer.wasm": "tx_transfer.992b3388311f57f880a74f5746b85fef88f4ffc467403c7428fb4e586310198d.wasm", + "tx_unbond.wasm": "tx_unbond.4accf5399c1c12507495706a3278414f15cc5037b82646b87fb7714cacde37f2.wasm", + "tx_update_vp.wasm": "tx_update_vp.001f8ad42fea81fcf55fc955081200708c17914cd336034d97b399edd6d2df1f.wasm", + "tx_vote_proposal.wasm": "tx_vote_proposal.59c5e6ee1164608698774ac331c20375f947a2fcb67af969abbf2590aa9b2ac1.wasm", + "tx_withdraw.wasm": "tx_withdraw.f1c1090800212e67403a05facd7c70850ebd25affbfe92b9802eb87f82feda62.wasm", + "vp_nft.wasm": "vp_nft.80e6f79df620524fd505ba31f1eadd1a331bed0bbabd950f49f4c1b6334a34dc.wasm", + "vp_testnet_faucet.wasm": "vp_testnet_faucet.4568de4187bc9c02d5488787e5796c93fc8b57d57be96fceffea533eccf4f8f6.wasm", + "vp_token.wasm": "vp_token.fc98bbb2095fae1628b75e5fe6b09ac58b3d406c31da6db4d72c8774a2ae54e7.wasm", + "vp_user.wasm": "vp_user.e411c42520b39bf905562ca38c85ca1831029ee4070ae715f9690ea17d33efec.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 a9fc8f0fca..58f87a9694 100644 --- a/wasm_for_tests/wasm_source/Cargo.lock +++ b/wasm_for_tests/wasm_source/Cargo.lock @@ -163,9 +163,9 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "async-trait" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" +checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" dependencies = [ "proc-macro2", "quote", @@ -193,12 +193,6 @@ 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" @@ -314,9 +308,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "bytecheck" @@ -406,12 +400,6 @@ 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" @@ -551,18 +539,6 @@ 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" @@ -573,16 +549,6 @@ dependencies = [ "typenum", ] -[[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 = "curve25519-dalek" version = "3.2.0" @@ -611,9 +577,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f39818dcfc97d45b03953c1292efc4e80954e1583c4aa770bac1383e2310a4" +checksum = "3f83d0ebf42c6eafb8d7c52f7e5f2d3003b89c7aa4fd2b79229209459a849af8" dependencies = [ "cc", "cxxbridge-flags", @@ -623,9 +589,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e580d70777c116df50c390d1211993f62d40302881e54d4b79727acb83d0199" +checksum = "07d050484b55975889284352b0ffc2ecbda25c0c55978017c132b29ba0818a86" dependencies = [ "cc", "codespan-reporting", @@ -638,15 +604,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56a46460b88d1cec95112c8c363f0e2c39afdb237f60583b0b36343bf627ea9c" +checksum = "99d2199b00553eda8012dfec8d3b1c75fce747cf27c169a270b3b99e3448ab78" [[package]] name = "cxxbridge-macro" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747b608fecf06b0d72d440f27acc99288207324b793be2c17991839f3d4995ea" +checksum = "dcb67a6de1f602736dd7eaead0080cf3435df806c61b24b13328db128c58868f" dependencies = [ "proc-macro2", "quote", @@ -693,15 +659,6 @@ 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" @@ -770,18 +727,6 @@ 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" @@ -824,24 +769,6 @@ 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" @@ -921,16 +848,6 @@ 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" @@ -953,15 +870,6 @@ 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" @@ -1061,17 +969,6 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" -[[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" @@ -1134,16 +1031,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac", - "digest 0.9.0", -] - [[package]] name = "iana-time-zone" version = "0.1.51" @@ -1160,9 +1047,9 @@ dependencies = [ [[package]] name = "iana-time-zone-haiku" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde6edd6cef363e9359ed3c98ba64590ba9eecba2293eb5a723ab32aee8926aa" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" dependencies = [ "cxx", "cxx-build", @@ -1171,7 +1058,7 @@ dependencies = [ [[package]] name = "ibc" version = "0.14.0" -source = "git+https://github.com/heliaxdev/ibc-rs?rev=9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d#9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d" +source = "git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2#f4703dfe2c1f25cc431279ab74f10f3e0f6827e2" dependencies = [ "bytes", "derive_more", @@ -1198,7 +1085,7 @@ dependencies = [ [[package]] name = "ibc-proto" version = "0.17.1" -source = "git+https://github.com/heliaxdev/ibc-rs?rev=9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d#9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d" +source = "git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2#f4703dfe2c1f25cc431279ab74f10f3e0f6827e2" dependencies = [ "base64", "bytes", @@ -1230,16 +1117,6 @@ 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" @@ -1290,19 +1167,6 @@ 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" @@ -1722,39 +1586,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1de2e551fb905ac83f73f7aedf2f0cb4a0da7e35efa24a202a936269f1f18e1" -[[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" @@ -1775,26 +1606,6 @@ 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" @@ -1848,9 +1659,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.46" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] @@ -2124,17 +1935,6 @@ dependencies = [ "bytecheck", ] -[[package]] -name = "rfc6979" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ef608575f6392792f9ecf7890c00086591d29a83910939d430753f7c050525" -dependencies = [ - "crypto-bigint", - "hmac", - "zeroize", -] - [[package]] name = "ripemd160" version = "0.9.1" @@ -2274,15 +2074,6 @@ 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 = "scopeguard" version = "1.1.0" @@ -2301,18 +2092,6 @@ 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", - "subtle", - "zeroize", -] - [[package]] name = "semver" version = "0.11.0" @@ -2429,13 +2208,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.4.0" +version = "1.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02658e48d89f2bec991f9a78e69cfa4c316f8d6a6c4ec12fae1aeb263d486788" -dependencies = [ - "digest 0.9.0", - "rand_core 0.6.4", -] +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" [[package]] name = "simple-error" @@ -2538,8 +2313,8 @@ dependencies = [ [[package]] name = "tendermint" -version = "0.23.5" -source = "git+https://github.com/heliaxdev/tendermint-rs?rev=95c52476bc37927218374f94ac8e2a19bd35bec9#95c52476bc37927218374f94ac8e2a19bd35bec9" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" dependencies = [ "async-trait", "bytes", @@ -2547,12 +2322,10 @@ dependencies = [ "ed25519-dalek", "flex-error", "futures", - "k256", "num-traits", "once_cell", "prost", "prost-types", - "ripemd160", "serde", "serde_bytes", "serde_json", @@ -2566,36 +2339,22 @@ dependencies = [ "zeroize", ] -[[package]] -name = "tendermint-config" -version = "0.23.5" -source = "git+https://github.com/heliaxdev/tendermint-rs?rev=95c52476bc37927218374f94ac8e2a19bd35bec9#95c52476bc37927218374f94ac8e2a19bd35bec9" -dependencies = [ - "flex-error", - "serde", - "serde_json", - "tendermint", - "toml", - "url", -] - [[package]] name = "tendermint-light-client-verifier" -version = "0.23.5" -source = "git+https://github.com/heliaxdev/tendermint-rs?rev=95c52476bc37927218374f94ac8e2a19bd35bec9#95c52476bc37927218374f94ac8e2a19bd35bec9" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" dependencies = [ "derive_more", "flex-error", "serde", "tendermint", - "tendermint-rpc", "time", ] [[package]] name = "tendermint-proto" -version = "0.23.5" -source = "git+https://github.com/heliaxdev/tendermint-rs?rev=95c52476bc37927218374f94ac8e2a19bd35bec9#95c52476bc37927218374f94ac8e2a19bd35bec9" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" dependencies = [ "bytes", "flex-error", @@ -2609,34 +2368,10 @@ dependencies = [ "time", ] -[[package]] -name = "tendermint-rpc" -version = "0.23.5" -source = "git+https://github.com/heliaxdev/tendermint-rs?rev=95c52476bc37927218374f94ac8e2a19bd35bec9#95c52476bc37927218374f94ac8e2a19bd35bec9" -dependencies = [ - "bytes", - "flex-error", - "getrandom", - "peg", - "pin-project", - "serde", - "serde_bytes", - "serde_json", - "subtle-encoding", - "tendermint", - "tendermint-config", - "tendermint-proto", - "thiserror", - "time", - "url", - "uuid", - "walkdir", -] - [[package]] name = "tendermint-testgen" -version = "0.23.5" -source = "git+https://github.com/heliaxdev/tendermint-rs?rev=95c52476bc37927218374f94ac8e2a19bd35bec9#95c52476bc37927218374f94ac8e2a19bd35bec9" +version = "0.23.6" +source = "git+https://github.com/heliaxdev/tendermint-rs.git?rev=87be41b8c9cc2850830f4d8028c1fe1bd9f96284#87be41b8c9cc2850830f4d8028c1fe1bd9f96284" dependencies = [ "ed25519-dalek", "gumdrop", @@ -2714,21 +2449,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" -[[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 = "toml" version = "0.5.9" @@ -2810,27 +2530,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" -[[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" @@ -2849,23 +2554,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" -[[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 = "uuid" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" - [[package]] name = "version_check" version = "0.9.4" @@ -2881,17 +2569,6 @@ 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 = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/wasm_for_tests/wasm_source/Cargo.toml b/wasm_for_tests/wasm_source/Cargo.toml index 5f653b541d..94b01a5e06 100644 --- a/wasm_for_tests/wasm_source/Cargo.toml +++ b/wasm_for_tests/wasm_source/Cargo.toml @@ -37,7 +37,15 @@ borsh = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4 borsh-derive = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"} borsh-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"} borsh-schema-derive-internal = {git = "https://github.com/heliaxdev/borsh-rs.git", rev = "cd5223e5103c4f139e0c54cf8259b7ec5ec4073a"} +# patched to a commit on the `eth-bridge-integration` branch of our fork +tendermint = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"} +tendermint-proto = {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-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"} [dev-dependencies] namada_tests = {path = "../../tests"}