diff --git a/.github/workflows/build-and-test-bridge.yml b/.github/workflows/build-and-test-bridge.yml index cee43b941b..c3b7fd41cd 100644 --- a/.github/workflows/build-and-test-bridge.yml +++ b/.github/workflows/build-and-test-bridge.yml @@ -53,6 +53,11 @@ jobs: # to disallow that. with: ref: ${{ github.event.pull_request.head.sha }} + - name: Setup protoc (ubuntu-latest) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt install -y protobuf-compiler + echo "PROTOC=$(which protoc)" >> $GITHUB_ENV - name: Duplicate checksums file run: cp wasm/checksums.json wasm/original-checksums.json - name: Build WASM @@ -139,6 +144,16 @@ jobs: with: role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master aws-region: eu-west-1 + - name: Setup protoc (ubuntu-latest) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt install -y protobuf-compiler + echo "PROTOC=$(which protoc)" >> $GITHUB_ENV + - name: Setup protoc (macos-latest) + if: matrix.os == 'macos-latest' + run: | + brew install protobuf + echo "PROTOC=$(which protoc)" >> $GITHUB_ENV - name: Install sccache (ubuntu-latest) if: matrix.os == 'ubuntu-latest' env: diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 1c4cbd3412..df8bd81afd 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -55,6 +55,11 @@ jobs: # to disallow that. with: ref: ${{ github.event.pull_request.head.sha }} + - name: Setup protoc (ubuntu-latest) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt install -y protobuf-compiler + echo "PROTOC=$(which protoc)" >> $GITHUB_ENV - name: Duplicate checksums file run: cp wasm/checksums.json wasm/original-checksums.json - name: Build WASM diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 22792c8d9b..fb0294c018 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -51,6 +51,11 @@ jobs: # See comment in build-and-test.yml with: ref: ${{ github.event.pull_request.head.sha }} + - name: Setup protoc (ubuntu-latest) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt install -y protobuf-compiler + echo "PROTOC=$(which protoc)" >> $GITHUB_ENV - name: Setup rust toolchain uses: oxidecomputer/actions-rs_toolchain@ad3f86084a8a5acf2c09cb691421b31cf8af7a36 with: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 0ba9f39b98..cae15e69d0 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -75,6 +75,11 @@ jobs: with: role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master aws-region: eu-west-1 + - name: Setup protoc (ubuntu-latest) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt install -y protobuf-compiler + echo "PROTOC=$(which protoc)" >> $GITHUB_ENV - name: Install sccache (ubuntu-latest) if: matrix.os == 'ubuntu-latest' env: @@ -162,6 +167,11 @@ jobs: with: role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master aws-region: eu-west-1 + - name: Setup protoc (ubuntu-latest) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt install -y protobuf-compiler + echo "PROTOC=$(which protoc)" >> $GITHUB_ENV - name: Install sccache (ubuntu-latest) if: matrix.os == 'ubuntu-latest' env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5cbc1e9207..a7564e3533 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -41,6 +41,16 @@ jobs: with: role-to-assume: arn:aws:iam::375643557360:role/anoma-github-action-ci-master aws-region: eu-west-1 + - name: Setup protoc (ubuntu-latest) + if: matrix.os == 'ubuntu-latest' + run: | + sudo apt install -y protobuf-compiler + echo "PROTOC=$(which protoc)" >> $GITHUB_ENV + - name: Setup protoc (macos-latest) + if: matrix.os == 'macos-latest' + run: | + brew install protobuf + echo "PROTOC=$(which protoc)" >> $GITHUB_ENV - name: Install sccache (ubuntu-latest) if: matrix.os == 'ubuntu-latest' env: diff --git a/Cargo.lock b/Cargo.lock index 34ab8ab550..4d0523372f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -428,6 +428,51 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "axum" +version = "0.5.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43" +dependencies = [ + "async-trait", + "axum-core", + "bitflags", + "bytes 1.2.1", + "futures-util", + "http", + "http-body", + "hyper 0.14.20", + "itoa", + "matchit", + "memchr", + "mime 0.3.16", + "percent-encoding 2.2.0", + "pin-project-lite", + "serde 1.0.145", + "sync_wrapper", + "tokio", + "tower", + "tower-http", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37e5939e02c56fecd5c017c37df4238c0a839fa76b7f97acdd7efb804fd181cc" +dependencies = [ + "async-trait", + "bytes 1.2.1", + "futures-util", + "http", + "http-body", + "mime 0.3.16", + "tower-layer", + "tower-service", +] + [[package]] name = "backtrace" version = "0.3.66" @@ -528,9 +573,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "blake2" @@ -2028,12 +2073,9 @@ dependencies = [ [[package]] name = "heck" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" [[package]] name = "hermit-abi" @@ -2093,6 +2135,12 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "http-range-header" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" + [[package]] name = "httparse" version = "1.8.0" @@ -2245,8 +2293,8 @@ dependencies = [ "ibc-proto 0.17.1 (git+https://github.com/heliaxdev/ibc-rs?rev=9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d)", "ics23", "num-traits 0.2.15", - "prost", - "prost-types", + "prost 0.9.0", + "prost-types 0.9.0", "safe-regex", "serde 1.0.145", "serde_derive", @@ -2272,8 +2320,8 @@ dependencies = [ "ibc-proto 0.17.1 (git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279ab74f10f3e0f6827e2)", "ics23", "num-traits 0.2.15", - "prost", - "prost-types", + "prost 0.9.0", + "prost-types 0.9.0", "safe-regex", "serde 1.0.145", "serde_derive", @@ -2295,8 +2343,8 @@ source = "git+https://github.com/heliaxdev/ibc-rs?rev=9fcc1c8c19db6af50806ffe5b2 dependencies = [ "base64 0.13.0", "bytes 1.2.1", - "prost", - "prost-types", + "prost 0.9.0", + "prost-types 0.9.0", "serde 1.0.145", "tendermint-proto 0.23.5", ] @@ -2308,8 +2356,8 @@ source = "git+https://github.com/heliaxdev/ibc-rs.git?rev=f4703dfe2c1f25cc431279 dependencies = [ "base64 0.13.0", "bytes 1.2.1", - "prost", - "prost-types", + "prost 0.9.0", + "prost-types 0.9.0", "serde 1.0.145", "tendermint-proto 0.23.6", ] @@ -2323,7 +2371,7 @@ dependencies = [ "anyhow", "bytes 1.2.1", "hex", - "prost", + "prost 0.9.0", "ripemd160", "sha2 0.9.9", "sha3", @@ -2747,6 +2795,12 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +[[package]] +name = "matchit" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" + [[package]] name = "maybe-uninit" version = "2.0.0" @@ -2940,8 +2994,8 @@ dependencies = [ "parity-wasm", "pretty_assertions", "proptest", - "prost", - "prost-types", + "prost 0.11.0", + "prost-types 0.11.1", "pwasm-utils", "rand 0.8.5", "rand_core 0.6.4", @@ -3010,8 +3064,8 @@ dependencies = [ "once_cell", "orion", "proptest", - "prost", - "prost-types", + "prost 0.11.0", + "prost-types 0.11.1", "rand 0.8.5", "rand_core 0.6.4", "rayon", @@ -3105,7 +3159,7 @@ dependencies = [ "namada_vp_prelude", "pretty_assertions", "proptest", - "prost", + "prost 0.11.0", "rand 0.8.5", "serde_json", "sha2 0.9.9", @@ -3179,9 +3233,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.21.2" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77d9f3521ea8e0641a153b3cddaf008dcbf26acd4ed739a2517295e0760d12c7" +checksum = "5c3728fec49d363a50a8828a190b379a446cc5cf085c06259bbbeb34447e4ec7" dependencies = [ "bitflags", "cc", @@ -3720,6 +3774,16 @@ dependencies = [ "output_vt100", ] +[[package]] +name = "prettyplease" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c142c0e46b57171fe0c528bee8c5b7569e80f0c17e377cd0e30ea57dbc11bb51" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "proc-macro-crate" version = "0.1.5" @@ -3788,14 +3852,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" dependencies = [ "bytes 1.2.1", - "prost-derive", + "prost-derive 0.9.0", +] + +[[package]] +name = "prost" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "399c3c31cdec40583bb68f0b18403400d01ec4289c383aa047560439952c4dd7" +dependencies = [ + "bytes 1.2.1", + "prost-derive 0.11.0", ] [[package]] name = "prost-build" -version = "0.9.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62941722fb675d463659e49c4f3fe1fe792ff24fe5bbaa9c08cd3b98a1c354f5" +checksum = "7f835c582e6bd972ba8347313300219fed5bfa52caf175298d860b61ff6069bb" dependencies = [ "bytes 1.2.1", "heck", @@ -3804,8 +3878,8 @@ dependencies = [ "log 0.4.17", "multimap", "petgraph", - "prost", - "prost-types", + "prost 0.11.0", + "prost-types 0.11.1", "regex", "tempfile", "which", @@ -3824,6 +3898,19 @@ dependencies = [ "syn", ] +[[package]] +name = "prost-derive" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "prost-types" version = "0.9.0" @@ -3831,7 +3918,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534b7a0e836e3c482d2693070f982e39e7611da9695d4d1f5a4b186b51faef0a" dependencies = [ "bytes 1.2.1", - "prost", + "prost 0.9.0", +] + +[[package]] +name = "prost-types" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dfaa718ad76a44b3415e6c4d53b17c8f99160dcb3a99b10470fce8ad43f6e3e" +dependencies = [ + "bytes 1.2.1", + "prost 0.11.0", ] [[package]] @@ -3860,7 +3957,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69c28fcebfd842bfe19d69409fc321230ea8c1bebe31f274906485c761ce1917" dependencies = [ - "nix 0.21.2", + "nix 0.21.0", ] [[package]] @@ -4898,6 +4995,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" + [[package]] name = "synstructure" version = "0.12.6" @@ -4968,8 +5071,8 @@ dependencies = [ "futures 0.3.25", "num-traits 0.2.15", "once_cell", - "prost", - "prost-types", + "prost 0.9.0", + "prost-types 0.9.0", "serde 1.0.145", "serde_bytes", "serde_json", @@ -4996,8 +5099,8 @@ dependencies = [ "futures 0.3.25", "num-traits 0.2.15", "once_cell", - "prost", - "prost-types", + "prost 0.9.0", + "prost-types 0.9.0", "serde 1.0.145", "serde_bytes", "serde_json", @@ -5071,8 +5174,8 @@ dependencies = [ "flex-error", "num-derive", "num-traits 0.2.15", - "prost", - "prost-types", + "prost 0.9.0", + "prost-types 0.9.0", "serde 1.0.145", "serde_bytes", "subtle-encoding", @@ -5088,8 +5191,8 @@ dependencies = [ "flex-error", "num-derive", "num-traits 0.2.15", - "prost", - "prost-types", + "prost 0.9.0", + "prost-types 0.9.0", "serde 1.0.145", "serde_bytes", "subtle-encoding", @@ -5535,12 +5638,13 @@ dependencies = [ [[package]] name = "tonic" -version = "0.6.2" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff08f4649d10a70ffa3522ca559031285d8e421d727ac85c60825761818f5d0a" +checksum = "55b9af819e54b8f33d453655bef9b9acc171568fb49523078d0cc4e7484200ec" dependencies = [ "async-stream", "async-trait", + "axum", "base64 0.13.0", "bytes 1.2.1", "futures-core", @@ -5552,11 +5656,11 @@ dependencies = [ "hyper-timeout", "percent-encoding 2.2.0", "pin-project", - "prost", - "prost-derive", + "prost 0.11.0", + "prost-derive 0.11.0", "tokio", "tokio-stream", - "tokio-util 0.6.10", + "tokio-util 0.7.4", "tower", "tower-layer", "tower-service", @@ -5566,10 +5670,11 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.6.2" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9403f1bafde247186684b230dc6f38b5cd514584e8bec1dd32514be4745fa757" +checksum = "48c6fd7c2581e36d63388a9e04c350c21beb7a8b059580b2e93993c526899ddc" dependencies = [ + "prettyplease", "proc-macro2", "prost-build", "quote", @@ -5605,7 +5710,7 @@ dependencies = [ "bytes 1.2.1", "futures 0.3.25", "pin-project", - "prost", + "prost 0.9.0", "tendermint-proto 0.23.5", "tokio", "tokio-stream", @@ -5623,7 +5728,7 @@ dependencies = [ "bytes 1.2.1", "futures 0.3.25", "pin-project", - "prost", + "prost 0.9.0", "tendermint-proto 0.23.6", "tokio", "tokio-stream", @@ -5633,6 +5738,25 @@ dependencies = [ "tracing-tower", ] +[[package]] +name = "tower-http" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" +dependencies = [ + "bitflags", + "bytes 1.2.1", + "futures-core", + "futures-util", + "http", + "http-body", + "http-range-header", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.2" @@ -5888,12 +6012,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" - [[package]] name = "unicode-width" version = "0.1.10" diff --git a/apps/Cargo.toml b/apps/Cargo.toml index 45cdb9aa5e..561cca3037 100644 --- a/apps/Cargo.toml +++ b/apps/Cargo.toml @@ -100,8 +100,8 @@ num-traits = "0.2.14" num_cpus = "1.13.0" once_cell = "1.8.0" orion = "0.16.0" -prost = "0.9.0" -prost-types = "0.9.0" +prost = "0.11" +prost-types = "0.11" rand = {version = "0.8", default-features = false} rand_core = {version = "0.6", default-features = false} rayon = "=1.5.1" @@ -130,7 +130,7 @@ tendermint-rpc = {version = "0.23.6", features = ["http-client", "websocket-clie thiserror = "1.0.30" tokio = {version = "1.8.2", features = ["full"]} toml = "0.5.8" -tonic = "0.6.1" +tonic = "0.8.2" 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. diff --git a/shared/Cargo.toml b/shared/Cargo.toml index 6469694ea9..89588e34dd 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -95,8 +95,8 @@ libsecp256k1 = {git = "https://github.com/heliaxdev/libsecp256k1", rev = "bbb3bd parity-wasm = {version = "0.42.2", optional = true} # A fork with state machine testing proptest = {git = "https://github.com/heliaxdev/proptest", branch = "tomas/sm", optional = true} -prost = "0.9.0" -prost-types = "0.9.0" +prost = "0.11" +prost-types = "0.11" pwasm-utils = {version = "0.18.0", optional = true} rand = {version = "0.8", optional = true} # TODO proptest rexports the RngCore trait but the re-implementations only work for version `0.8`. *sigh* @@ -134,4 +134,4 @@ test-log = {version = "0.2.7", default-features = false, features = ["trace"]} tracing-subscriber = {version = "0.3.7", default-features = false, features = ["env-filter", "fmt"]} [build-dependencies] -tonic-build = "0.6.0" +tonic-build = "0.8.2" diff --git a/shared/build.rs b/shared/build.rs index 74dd72b753..5d66960193 100644 --- a/shared/build.rs +++ b/shared/build.rs @@ -1,13 +1,8 @@ -use std::fs::read_to_string; -use std::process::Command; use std::{env, str}; /// Path to the .proto source files, relative to `shared` directory const PROTO_SRC: &str = "./proto"; -/// The version should match the one we use in the `Makefile` -const RUSTFMT_TOOLCHAIN_SRC: &str = "../rust-nightly-version"; - fn main() { if let Ok(val) = env::var("COMPILE_PROTO") { if val.to_ascii_lowercase() == "false" { @@ -28,36 +23,8 @@ fn main() { } } - let mut use_rustfmt = false; - - // The version should match the one we use in the `Makefile` - if let Ok(rustfmt_toolchain) = read_to_string(RUSTFMT_TOOLCHAIN_SRC) { - // Try to find the path to rustfmt. - if let Ok(output) = Command::new("rustup") - .args(&[ - "which", - "rustfmt", - "--toolchain", - rustfmt_toolchain.trim(), - ]) - .output() - { - if let Ok(rustfmt) = str::from_utf8(&output.stdout) { - // Set the command to be used by tonic_build below to format the - // generated files - let rustfmt = rustfmt.trim(); - if !rustfmt.is_empty() { - println!("using rustfmt from path \"{}\"", rustfmt); - env::set_var("RUSTFMT", rustfmt); - use_rustfmt = true - } - } - } - } - tonic_build::configure() .out_dir("src/proto/generated") - .format(use_rustfmt) .protoc_arg("--experimental_allow_proto3_optional") .compile(&[format!("{}/types.proto", PROTO_SRC)], &[PROTO_SRC]) .unwrap(); diff --git a/tests/Cargo.toml b/tests/Cargo.toml index dc3bf7b8aa..fe56afe23b 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -17,7 +17,7 @@ namada_vp_prelude = {path = "../vp_prelude"} namada_tx_prelude = {path = "../tx_prelude"} chrono = {version = "0.4.22", default-features = false, features = ["clock", "std"]} concat-idents = "1.1.2" -prost = "0.9.0" +prost = "0.11" serde_json = {version = "1.0.65"} sha2 = "0.9.3" test-log = {version = "0.2.7", default-features = false, features = ["trace"]}