From d0775f9c4a2437e030590d4914ef2b85b011b50d Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Wed, 15 Nov 2023 16:47:59 +0100 Subject: [PATCH 1/5] change buf to tonic build --- Cargo.lock | 348 +++++++-- Cargo.toml | 8 +- crates/astria-proto/Cargo.toml | 2 + .../generated/astria.execution.v1alpha1.rs | 480 ++++++++++++- .../astria.execution.v1alpha1.tonic.rs | 468 ------------ .../generated/astria.execution.v1alpha2.rs | 678 +++++++++++++++++- .../astria.execution.v1alpha2.tonic.rs | 651 ----------------- .../proto/generated/astria.primitive.v1.rs | 6 +- .../generated/astria.sequencer.v1alpha1.rs | 86 ++- crates/astria-proto/tests/proto_build.rs | 153 ++-- 10 files changed, 1583 insertions(+), 1297 deletions(-) delete mode 100644 crates/astria-proto/src/proto/generated/astria.execution.v1alpha1.tonic.rs delete mode 100644 crates/astria-proto/src/proto/generated/astria.execution.v1alpha2.tonic.rs diff --git a/Cargo.lock b/Cargo.lock index 4d8a2723c9..2ad6cbc481 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -455,7 +455,9 @@ dependencies = [ "tendermint 0.33.2", "tendermint-proto 0.33.2", "tonic", + "tonic-build", "tracing", + "walkdir", "which", ] @@ -678,18 +680,18 @@ dependencies = [ [[package]] name = "async-tungstenite" -version = "0.23.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e9efbe14612da0a19fb983059a0b621e9cf6225d7018ecab4f9988215540dc" +checksum = "1e0388bb7a400072bbb41ceb75d65c3baefb2ea99672fa22e85278452cd9b58b" dependencies = [ "futures-io", "futures-util", "log", "pin-project-lite", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", - "tokio-rustls", - "tungstenite", + "tokio-rustls 0.23.4", + "tungstenite 0.18.0", ] [[package]] @@ -873,7 +875,7 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease", + "prettyplease 0.2.15", "proc-macro2", "quote", "regex", @@ -1108,7 +1110,7 @@ source = "git+https://github.com/eigerco/celestia-node-rs?rev=1fa61eb#1fa61ebd6b dependencies = [ "anyhow", "prost 0.12.1", - "prost-build", + "prost-build 0.12.1", "prost-types 0.12.1", "serde", "tendermint-proto 0.32.0", @@ -1491,6 +1493,15 @@ dependencies = [ "typenum", ] +[[package]] +name = "ct-logs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" +dependencies = [ + "sct 0.6.1", +] + [[package]] name = "ct-merkle" version = "0.1.0" @@ -1963,7 +1974,7 @@ dependencies = [ "ethers-core", "ethers-etherscan", "eyre", - "prettyplease", + "prettyplease 0.2.15", "proc-macro2", "quote", "regex", @@ -2554,6 +2565,30 @@ dependencies = [ "num-traits", ] +[[package]] +name = "headers" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" +dependencies = [ + "base64 0.21.4", + "bytes", + "headers-core", + "http", + "httpdate", + "mime", + "sha1", +] + +[[package]] +name = "headers-core" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" +dependencies = [ + "http", +] + [[package]] name = "heck" version = "0.4.1" @@ -2693,6 +2728,43 @@ dependencies = [ "want", ] +[[package]] +name = "hyper-proxy" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca815a891b24fdfb243fa3239c86154392b0953ee584aa1a2a1f66d20cbe75cc" +dependencies = [ + "bytes", + "futures", + "headers", + "http", + "hyper", + "hyper-rustls 0.22.1", + "rustls-native-certs 0.5.0", + "tokio", + "tokio-rustls 0.22.0", + "tower-service", + "webpki 0.21.4", +] + +[[package]] +name = "hyper-rustls" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" +dependencies = [ + "ct-logs", + "futures-util", + "hyper", + "log", + "rustls 0.19.1", + "rustls-native-certs 0.5.0", + "tokio", + "tokio-rustls 0.22.0", + "webpki 0.21.4", + "webpki-roots 0.21.1", +] + [[package]] name = "hyper-rustls" version = "0.24.1" @@ -2703,10 +2775,10 @@ dependencies = [ "http", "hyper", "log", - "rustls", - "rustls-native-certs", + "rustls 0.21.7", + "rustls-native-certs 0.6.3", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -2959,11 +3031,11 @@ dependencies = [ "http", "jsonrpsee-core", "pin-project", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tokio-util 0.7.9", "tracing", "url", @@ -3002,7 +3074,7 @@ checksum = "0dd865d0072764cb937b0110a92b5f53e995f7101cb346beca03d93a2dea79de" dependencies = [ "async-trait", "hyper", - "hyper-rustls", + "hyper-rustls 0.24.1", "jsonrpsee-core", "jsonrpsee-types", "serde", @@ -3085,7 +3157,7 @@ checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ "base64 0.21.4", "pem", - "ring", + "ring 0.16.20", "serde", "serde_json", "simple_asn1", @@ -3996,6 +4068,16 @@ dependencies = [ "termtree", ] +[[package]] +name = "prettyplease" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + [[package]] name = "prettyplease" version = "0.2.15" @@ -4121,6 +4203,28 @@ dependencies = [ "prost-derive 0.12.1", ] +[[package]] +name = "prost-build" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" +dependencies = [ + "bytes", + "heck", + "itertools 0.10.5", + "lazy_static", + "log", + "multimap", + "petgraph", + "prettyplease 0.1.25", + "prost 0.11.9", + "prost-types 0.11.9", + "regex", + "syn 1.0.109", + "tempfile", + "which", +] + [[package]] name = "prost-build" version = "0.12.1" @@ -4134,7 +4238,7 @@ dependencies = [ "multimap", "once_cell", "petgraph", - "prettyplease", + "prettyplease 0.2.15", "prost 0.12.1", "prost-types 0.12.1", "regex", @@ -4405,7 +4509,7 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls", + "hyper-rustls 0.24.1", "ipnet", "js-sys", "log", @@ -4413,21 +4517,20 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", - "rustls-native-certs", + "rustls 0.21.7", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "system-configuration", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots", + "webpki-roots 0.25.2", "winreg", ] @@ -4456,12 +4559,26 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +dependencies = [ + "cc", + "getrandom 0.2.10", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys", +] + [[package]] name = "ripemd" version = "0.1.3" @@ -4587,6 +4704,31 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "rustls" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +dependencies = [ + "base64 0.13.1", + "log", + "ring 0.16.20", + "sct 0.6.1", + "webpki 0.21.4", +] + +[[package]] +name = "rustls" +version = "0.20.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" +dependencies = [ + "log", + "ring 0.16.20", + "sct 0.7.0", + "webpki 0.22.4", +] + [[package]] name = "rustls" version = "0.21.7" @@ -4594,9 +4736,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", - "ring", + "ring 0.16.20", "rustls-webpki", - "sct", + "sct 0.7.0", +] + +[[package]] +name = "rustls-native-certs" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" +dependencies = [ + "openssl-probe", + "rustls 0.19.1", + "schannel", + "security-framework", ] [[package]] @@ -4626,8 +4780,8 @@ version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -4711,14 +4865,24 @@ dependencies = [ "sha2 0.10.8", ] +[[package]] +name = "sct" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + [[package]] name = "sct" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring", - "untrusted", + "ring 0.16.20", + "untrusted 0.7.1", ] [[package]] @@ -5103,6 +5267,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "spki" version = "0.7.2" @@ -5312,7 +5482,8 @@ dependencies = [ [[package]] name = "tendermint" version = "0.33.2" -source = "git+https://github.com/astriaorg/tendermint-rs?branch=v0.33.2-reqwest-backport#7e4d10db18df82691fc9426d4853935642763b2d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c35fe4fd24a7715571814c22416dbc40ec0f2a6e3cce75d73e19699faecd246" dependencies = [ "bytes", "digest 0.10.7", @@ -5340,7 +5511,8 @@ dependencies = [ [[package]] name = "tendermint-config" version = "0.33.2" -source = "git+https://github.com/astriaorg/tendermint-rs?branch=v0.33.2-reqwest-backport#7e4d10db18df82691fc9426d4853935642763b2d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a213a026dfc1c68468160bee24bf128e26002170abc123678ecfbe5ff37f91d" dependencies = [ "flex-error", "serde", @@ -5370,7 +5542,8 @@ dependencies = [ [[package]] name = "tendermint-proto" version = "0.33.2" -source = "git+https://github.com/astriaorg/tendermint-rs?branch=v0.33.2-reqwest-backport#7e4d10db18df82691fc9426d4853935642763b2d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "639e5adffd77220d238a800a72c74c98d7e869290a6e4494c10b6b4e8f702f02" dependencies = [ "bytes", "flex-error", @@ -5387,7 +5560,8 @@ dependencies = [ [[package]] name = "tendermint-rpc" version = "0.33.2" -source = "git+https://github.com/astriaorg/tendermint-rs?branch=v0.33.2-reqwest-backport#7e4d10db18df82691fc9426d4853935642763b2d" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4df40d6d298fdca6cc5af67c85eb62c1113b5834ca321bde30240c919d4912b" dependencies = [ "async-trait", "async-tungstenite", @@ -5395,9 +5569,12 @@ dependencies = [ "flex-error", "futures", "getrandom 0.2.10", + "http", + "hyper", + "hyper-proxy", + "hyper-rustls 0.22.1", "peg", "pin-project", - "reqwest", "semver 1.0.20", "serde", "serde_bytes", @@ -5565,13 +5742,35 @@ dependencies = [ "syn 2.0.38", ] +[[package]] +name = "tokio-rustls" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +dependencies = [ + "rustls 0.19.1", + "tokio", + "webpki 0.21.4", +] + +[[package]] +name = "tokio-rustls" +version = "0.23.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" +dependencies = [ + "rustls 0.20.9", + "tokio", + "webpki 0.22.4", +] + [[package]] name = "tokio-rustls" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.7", "tokio", ] @@ -5607,11 +5806,11 @@ checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls", + "rustls 0.21.7", "tokio", - "tokio-rustls", - "tungstenite", - "webpki-roots", + "tokio-rustls 0.24.1", + "tungstenite 0.20.1", + "webpki-roots 0.25.2", ] [[package]] @@ -5716,6 +5915,19 @@ dependencies = [ "tracing", ] +[[package]] +name = "tonic-build" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6fdaae4c2c638bb70fe42803a26fbd6fc6ac8c72f5c59f67ecc2a2dcabf4b07" +dependencies = [ + "prettyplease 0.1.25", + "proc-macro2", + "prost-build 0.11.9", + "quote", + "syn 1.0.109", +] + [[package]] name = "tower" version = "0.4.13" @@ -5896,6 +6108,27 @@ dependencies = [ "tokio", ] +[[package]] +name = "tungstenite" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" +dependencies = [ + "base64 0.13.1", + "byteorder", + "bytes", + "http", + "httparse", + "log", + "rand 0.8.5", + "rustls 0.20.9", + "sha1", + "thiserror", + "url", + "utf-8", + "webpki 0.22.4", +] + [[package]] name = "tungstenite" version = "0.20.1" @@ -5909,7 +6142,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls", + "rustls 0.21.7", "sha1", "thiserror", "url", @@ -6000,6 +6233,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.4.1" @@ -6174,6 +6413,35 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "webpki" +version = "0.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" +dependencies = [ + "ring 0.16.20", + "untrusted 0.7.1", +] + +[[package]] +name = "webpki" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" +dependencies = [ + "ring 0.17.5", + "untrusted 0.9.0", +] + +[[package]] +name = "webpki-roots" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +dependencies = [ + "webpki 0.21.4", +] + [[package]] name = "webpki-roots" version = "0.25.2" diff --git a/Cargo.toml b/Cargo.toml index a17eafeaf3..f0fffdf974 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ which = "4.4.0" wiremock = "0.5" [patch.crates-io] -tendermint = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } -tendermint-config = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } -tendermint-proto = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } -tendermint-rpc = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } +# tendermint = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } +# tendermint-config = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } +# tendermint-proto = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } +# tendermint-rpc = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } diff --git a/crates/astria-proto/Cargo.toml b/crates/astria-proto/Cargo.toml index 18a01abc11..ad8aa8af81 100644 --- a/crates/astria-proto/Cargo.toml +++ b/crates/astria-proto/Cargo.toml @@ -33,4 +33,6 @@ server = ["dep:tonic"] [dev-dependencies] tempfile = { workspace = true } +tonic-build = "0.9" +walkdir = "2.4.0" which = { workspace = true } diff --git a/crates/astria-proto/src/proto/generated/astria.execution.v1alpha1.rs b/crates/astria-proto/src/proto/generated/astria.execution.v1alpha1.rs index 56d348fd5b..69a041202e 100644 --- a/crates/astria-proto/src/proto/generated/astria.execution.v1alpha1.rs +++ b/crates/astria-proto/src/proto/generated/astria.execution.v1alpha1.rs @@ -1,39 +1,493 @@ -// @generated #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DoBlockRequest { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub prev_block_hash: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", repeated, tag="2")] + #[prost(bytes = "vec", repeated, tag = "2")] pub transactions: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, - #[prost(message, optional, tag="3")] + #[prost(message, optional, tag = "3")] pub timestamp: ::core::option::Option<::prost_types::Timestamp>, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DoBlockResponse { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub block_hash: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct FinalizeBlockRequest { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub block_hash: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct FinalizeBlockResponse { -} +pub struct FinalizeBlockResponse {} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct InitStateRequest { -} +pub struct InitStateRequest {} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct InitStateResponse { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub block_hash: ::prost::alloc::vec::Vec, } -include!("astria.execution.v1alpha1.tonic.rs"); -// @@protoc_insertion_point(module) \ No newline at end of file +/// Generated client implementations. +#[cfg(feature = "client")] +pub mod execution_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + #[derive(Debug, Clone)] + pub struct ExecutionServiceClient { + inner: tonic::client::Grpc, + } + impl ExecutionServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl ExecutionServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> ExecutionServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + ExecutionServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn init_state( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/astria.execution.v1alpha1.ExecutionService/InitState", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "astria.execution.v1alpha1.ExecutionService", + "InitState", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn do_block( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/astria.execution.v1alpha1.ExecutionService/DoBlock", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "astria.execution.v1alpha1.ExecutionService", + "DoBlock", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn finalize_block( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/astria.execution.v1alpha1.ExecutionService/FinalizeBlock", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "astria.execution.v1alpha1.ExecutionService", + "FinalizeBlock", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "server")] +pub mod execution_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with ExecutionServiceServer. + #[async_trait] + pub trait ExecutionService: Send + Sync + 'static { + async fn init_state( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn do_block( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn finalize_block( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + #[derive(Debug)] + pub struct ExecutionServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl ExecutionServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for ExecutionServiceServer + where + T: ExecutionService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/astria.execution.v1alpha1.ExecutionService/InitState" => { + #[allow(non_camel_case_types)] + struct InitStateSvc(pub Arc); + impl< + T: ExecutionService, + > tonic::server::UnaryService + for InitStateSvc { + type Response = super::InitStateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).init_state(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = InitStateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/astria.execution.v1alpha1.ExecutionService/DoBlock" => { + #[allow(non_camel_case_types)] + struct DoBlockSvc(pub Arc); + impl< + T: ExecutionService, + > tonic::server::UnaryService + for DoBlockSvc { + type Response = super::DoBlockResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).do_block(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DoBlockSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/astria.execution.v1alpha1.ExecutionService/FinalizeBlock" => { + #[allow(non_camel_case_types)] + struct FinalizeBlockSvc(pub Arc); + impl< + T: ExecutionService, + > tonic::server::UnaryService + for FinalizeBlockSvc { + type Response = super::FinalizeBlockResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).finalize_block(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = FinalizeBlockSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for ExecutionServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for ExecutionServiceServer { + const NAME: &'static str = "astria.execution.v1alpha1.ExecutionService"; + } +} diff --git a/crates/astria-proto/src/proto/generated/astria.execution.v1alpha1.tonic.rs b/crates/astria-proto/src/proto/generated/astria.execution.v1alpha1.tonic.rs deleted file mode 100644 index 51900f6760..0000000000 --- a/crates/astria-proto/src/proto/generated/astria.execution.v1alpha1.tonic.rs +++ /dev/null @@ -1,468 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod execution_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /// - #[derive(Debug, Clone)] - pub struct ExecutionServiceClient { - inner: tonic::client::Grpc, - } - impl ExecutionServiceClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl ExecutionServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> ExecutionServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - ExecutionServiceClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// - pub async fn init_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/astria.execution.v1alpha1.ExecutionService/InitState", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "astria.execution.v1alpha1.ExecutionService", - "InitState", - ), - ); - self.inner.unary(req, path, codec).await - } - /// - pub async fn do_block( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/astria.execution.v1alpha1.ExecutionService/DoBlock", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "astria.execution.v1alpha1.ExecutionService", - "DoBlock", - ), - ); - self.inner.unary(req, path, codec).await - } - /// - pub async fn finalize_block( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/astria.execution.v1alpha1.ExecutionService/FinalizeBlock", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "astria.execution.v1alpha1.ExecutionService", - "FinalizeBlock", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod execution_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ExecutionServiceServer. - #[async_trait] - pub trait ExecutionService: Send + Sync + 'static { - /// - async fn init_state( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// - async fn do_block( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// - async fn finalize_block( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// - #[derive(Debug)] - pub struct ExecutionServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl ExecutionServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for ExecutionServiceServer - where - T: ExecutionService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/astria.execution.v1alpha1.ExecutionService/InitState" => { - #[allow(non_camel_case_types)] - struct InitStateSvc(pub Arc); - impl< - T: ExecutionService, - > tonic::server::UnaryService - for InitStateSvc { - type Response = super::InitStateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { (*inner).init_state(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = InitStateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/astria.execution.v1alpha1.ExecutionService/DoBlock" => { - #[allow(non_camel_case_types)] - struct DoBlockSvc(pub Arc); - impl< - T: ExecutionService, - > tonic::server::UnaryService - for DoBlockSvc { - type Response = super::DoBlockResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { (*inner).do_block(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = DoBlockSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/astria.execution.v1alpha1.ExecutionService/FinalizeBlock" => { - #[allow(non_camel_case_types)] - struct FinalizeBlockSvc(pub Arc); - impl< - T: ExecutionService, - > tonic::server::UnaryService - for FinalizeBlockSvc { - type Response = super::FinalizeBlockResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).finalize_block(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = FinalizeBlockSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for ExecutionServiceServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for ExecutionServiceServer { - const NAME: &'static str = "astria.execution.v1alpha1.ExecutionService"; - } -} diff --git a/crates/astria-proto/src/proto/generated/astria.execution.v1alpha2.rs b/crates/astria-proto/src/proto/generated/astria.execution.v1alpha2.rs index 63851548c4..d2053b8c08 100644 --- a/crates/astria-proto/src/proto/generated/astria.execution.v1alpha2.rs +++ b/crates/astria-proto/src/proto/generated/astria.execution.v1alpha2.rs @@ -1,37 +1,36 @@ -// @generated /// The set of information which deterministic driver of block production /// must know about a given rollup Block #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Block { /// The block number - #[prost(uint32, tag="1")] + #[prost(uint32, tag = "1")] pub number: u32, /// The hash of the block - #[prost(bytes="vec", tag="2")] + #[prost(bytes = "vec", tag = "2")] pub hash: ::prost::alloc::vec::Vec, /// The hash from the parent block - #[prost(bytes="vec", tag="3")] + #[prost(bytes = "vec", tag = "3")] pub parent_block_hash: ::prost::alloc::vec::Vec, /// Timestamp on the block, standardized to google protobuf standard. - #[prost(message, optional, tag="4")] + #[prost(message, optional, tag = "4")] pub timestamp: ::core::option::Option<::prost_types::Timestamp>, } /// Fields which are indexed for finding blocks on a blockchain. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BlockIdentifier { - #[prost(oneof="block_identifier::Identifier", tags="1, 2")] + #[prost(oneof = "block_identifier::Identifier", tags = "1, 2")] pub identifier: ::core::option::Option, } /// Nested message and enum types in `BlockIdentifier`. pub mod block_identifier { #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Identifier { - #[prost(uint32, tag="1")] + #[prost(uint32, tag = "1")] BlockNumber(u32), - #[prost(bytes, tag="2")] + #[prost(bytes, tag = "2")] BlockHash(::prost::alloc::vec::Vec), } } @@ -39,7 +38,7 @@ pub mod block_identifier { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockRequest { - #[prost(message, optional, tag="1")] + #[prost(message, optional, tag = "1")] pub identifier: ::core::option::Option, } /// Used in BatchGetBlocks, will find all or none based on the list of @@ -47,14 +46,14 @@ pub struct GetBlockRequest { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchGetBlocksRequest { - #[prost(message, repeated, tag="1")] + #[prost(message, repeated, tag = "1")] pub identifiers: ::prost::alloc::vec::Vec, } /// The list of blocks in response to BatchGetBlocks. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BatchGetBlocksResponse { - #[prost(message, repeated, tag="1")] + #[prost(message, repeated, tag = "1")] pub blocks: ::prost::alloc::vec::Vec, } /// ExecuteBlockRequest contains all the information needed to create a new rollup @@ -66,13 +65,13 @@ pub struct BatchGetBlocksResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExecuteBlockRequest { /// The hash of previous block, which new block will be created on top of. - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub prev_block_hash: ::prost::alloc::vec::Vec, /// List of transactions to include in the new block. - #[prost(bytes="vec", repeated, tag="2")] + #[prost(bytes = "vec", repeated, tag = "2")] pub transactions: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, /// Timestamp to be used for new block. - #[prost(message, optional, tag="3")] + #[prost(message, optional, tag = "3")] pub timestamp: ::core::option::Option<::prost_types::Timestamp>, } /// The CommitmentState holds the block at each stage of sequencer commitment @@ -87,23 +86,658 @@ pub struct ExecuteBlockRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct CommitmentState { /// Soft commitment is the rollup block matching latest sequencer block. - #[prost(message, optional, tag="1")] + #[prost(message, optional, tag = "1")] pub soft: ::core::option::Option, /// Firm commitment is achieved when data has been seen in DA. - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub firm: ::core::option::Option, } /// There is only one CommitmentState object, so the request is empty. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetCommitmentStateRequest { -} +pub struct GetCommitmentStateRequest {} /// The CommitmentState to set, must include complete state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpdateCommitmentStateRequest { - #[prost(message, optional, tag="1")] + #[prost(message, optional, tag = "1")] pub commitment_state: ::core::option::Option, } -include!("astria.execution.v1alpha2.tonic.rs"); -// @@protoc_insertion_point(module) \ No newline at end of file +/// Generated client implementations. +#[cfg(feature = "client")] +pub mod execution_service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// ExecutionService is used to drive deterministic production of blocks. + /// + /// The service can be implemented by any blockchain which wants to utilize the + /// Astria Shared Sequencer, and will have block production driven via the Astria + /// "Conductor". + #[derive(Debug, Clone)] + pub struct ExecutionServiceClient { + inner: tonic::client::Grpc, + } + impl ExecutionServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl ExecutionServiceClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> ExecutionServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + ExecutionServiceClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// GetBlock will return a block given an identifier. + pub async fn get_block( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/astria.execution.v1alpha2.ExecutionService/GetBlock", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "astria.execution.v1alpha2.ExecutionService", + "GetBlock", + ), + ); + self.inner.unary(req, path, codec).await + } + /// BatchGetBlocks will return an array of Blocks given an array of block + /// identifiers. + pub async fn batch_get_blocks( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/astria.execution.v1alpha2.ExecutionService/BatchGetBlocks", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "astria.execution.v1alpha2.ExecutionService", + "BatchGetBlocks", + ), + ); + self.inner.unary(req, path, codec).await + } + /// ExecuteBlock is called to deterministically derive a rollup block from + /// filtered sequencer block information. + pub async fn execute_block( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/astria.execution.v1alpha2.ExecutionService/ExecuteBlock", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "astria.execution.v1alpha2.ExecutionService", + "ExecuteBlock", + ), + ); + self.inner.unary(req, path, codec).await + } + /// GetCommitmentState fetches the current CommitmentState of the chain. + pub async fn get_commitment_state( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/astria.execution.v1alpha2.ExecutionService/GetCommitmentState", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "astria.execution.v1alpha2.ExecutionService", + "GetCommitmentState", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateCommitmentState replaces the whole CommitmentState with a new + /// CommitmentState. + pub async fn update_commitment_state( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/astria.execution.v1alpha2.ExecutionService/UpdateCommitmentState", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "astria.execution.v1alpha2.ExecutionService", + "UpdateCommitmentState", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "server")] +pub mod execution_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with ExecutionServiceServer. + #[async_trait] + pub trait ExecutionService: Send + Sync + 'static { + /// GetBlock will return a block given an identifier. + async fn get_block( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// BatchGetBlocks will return an array of Blocks given an array of block + /// identifiers. + async fn batch_get_blocks( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// ExecuteBlock is called to deterministically derive a rollup block from + /// filtered sequencer block information. + async fn execute_block( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// GetCommitmentState fetches the current CommitmentState of the chain. + async fn get_commitment_state( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// UpdateCommitmentState replaces the whole CommitmentState with a new + /// CommitmentState. + async fn update_commitment_state( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + /// ExecutionService is used to drive deterministic production of blocks. + /// + /// The service can be implemented by any blockchain which wants to utilize the + /// Astria Shared Sequencer, and will have block production driven via the Astria + /// "Conductor". + #[derive(Debug)] + pub struct ExecutionServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl ExecutionServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for ExecutionServiceServer + where + T: ExecutionService, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/astria.execution.v1alpha2.ExecutionService/GetBlock" => { + #[allow(non_camel_case_types)] + struct GetBlockSvc(pub Arc); + impl< + T: ExecutionService, + > tonic::server::UnaryService + for GetBlockSvc { + type Response = super::Block; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).get_block(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetBlockSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/astria.execution.v1alpha2.ExecutionService/BatchGetBlocks" => { + #[allow(non_camel_case_types)] + struct BatchGetBlocksSvc(pub Arc); + impl< + T: ExecutionService, + > tonic::server::UnaryService + for BatchGetBlocksSvc { + type Response = super::BatchGetBlocksResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).batch_get_blocks(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = BatchGetBlocksSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/astria.execution.v1alpha2.ExecutionService/ExecuteBlock" => { + #[allow(non_camel_case_types)] + struct ExecuteBlockSvc(pub Arc); + impl< + T: ExecutionService, + > tonic::server::UnaryService + for ExecuteBlockSvc { + type Response = super::Block; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).execute_block(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ExecuteBlockSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/astria.execution.v1alpha2.ExecutionService/GetCommitmentState" => { + #[allow(non_camel_case_types)] + struct GetCommitmentStateSvc(pub Arc); + impl< + T: ExecutionService, + > tonic::server::UnaryService + for GetCommitmentStateSvc { + type Response = super::CommitmentState; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).get_commitment_state(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetCommitmentStateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/astria.execution.v1alpha2.ExecutionService/UpdateCommitmentState" => { + #[allow(non_camel_case_types)] + struct UpdateCommitmentStateSvc(pub Arc); + impl< + T: ExecutionService, + > tonic::server::UnaryService + for UpdateCommitmentStateSvc { + type Response = super::CommitmentState; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).update_commitment_state(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateCommitmentStateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for ExecutionServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for ExecutionServiceServer { + const NAME: &'static str = "astria.execution.v1alpha2.ExecutionService"; + } +} diff --git a/crates/astria-proto/src/proto/generated/astria.execution.v1alpha2.tonic.rs b/crates/astria-proto/src/proto/generated/astria.execution.v1alpha2.tonic.rs deleted file mode 100644 index 3b26fe9270..0000000000 --- a/crates/astria-proto/src/proto/generated/astria.execution.v1alpha2.tonic.rs +++ /dev/null @@ -1,651 +0,0 @@ -// @generated -/// Generated client implementations. -#[cfg(feature = "client")] -pub mod execution_service_client { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - use tonic::codegen::http::Uri; - /** ExecutionService is used to drive deterministic production of blocks. - - The service can be implemented by any blockchain which wants to utilize the - Astria Shared Sequencer, and will have block production driven via the Astria - "Conductor". -*/ - #[derive(Debug, Clone)] - pub struct ExecutionServiceClient { - inner: tonic::client::Grpc, - } - impl ExecutionServiceClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } - } - impl ExecutionServiceClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, - ::Error: Into + Send, - { - pub fn new(inner: T) -> Self { - let inner = tonic::client::Grpc::new(inner); - Self { inner } - } - pub fn with_origin(inner: T, origin: Uri) -> Self { - let inner = tonic::client::Grpc::with_origin(inner, origin); - Self { inner } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> ExecutionServiceClient> - where - F: tonic::service::Interceptor, - T::ResponseBody: Default, - T: tonic::codegen::Service< - http::Request, - Response = http::Response< - >::ResponseBody, - >, - >, - , - >>::Error: Into + Send + Sync, - { - ExecutionServiceClient::new(InterceptedService::new(inner, interceptor)) - } - /// Compress requests with the given encoding. - /// - /// This requires the server to support it otherwise it might respond with an - /// error. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.send_compressed(encoding); - self - } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /** GetBlock will return a block given an identifier. -*/ - pub async fn get_block( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/astria.execution.v1alpha2.ExecutionService/GetBlock", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "astria.execution.v1alpha2.ExecutionService", - "GetBlock", - ), - ); - self.inner.unary(req, path, codec).await - } - /** BatchGetBlocks will return an array of Blocks given an array of block - identifiers. -*/ - pub async fn batch_get_blocks( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/astria.execution.v1alpha2.ExecutionService/BatchGetBlocks", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "astria.execution.v1alpha2.ExecutionService", - "BatchGetBlocks", - ), - ); - self.inner.unary(req, path, codec).await - } - /** ExecuteBlock is called to deterministically derive a rollup block from - filtered sequencer block information. -*/ - pub async fn execute_block( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result, tonic::Status> { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/astria.execution.v1alpha2.ExecutionService/ExecuteBlock", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "astria.execution.v1alpha2.ExecutionService", - "ExecuteBlock", - ), - ); - self.inner.unary(req, path, codec).await - } - /** GetCommitmentState fetches the current CommitmentState of the chain. -*/ - pub async fn get_commitment_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/astria.execution.v1alpha2.ExecutionService/GetCommitmentState", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "astria.execution.v1alpha2.ExecutionService", - "GetCommitmentState", - ), - ); - self.inner.unary(req, path, codec).await - } - /** UpdateCommitmentState replaces the whole CommitmentState with a new - CommitmentState. -*/ - pub async fn update_commitment_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/astria.execution.v1alpha2.ExecutionService/UpdateCommitmentState", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "astria.execution.v1alpha2.ExecutionService", - "UpdateCommitmentState", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -pub mod execution_service_server { - #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] - use tonic::codegen::*; - /// Generated trait containing gRPC methods that should be implemented for use with ExecutionServiceServer. - #[async_trait] - pub trait ExecutionService: Send + Sync + 'static { - /** GetBlock will return a block given an identifier. -*/ - async fn get_block( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /** BatchGetBlocks will return an array of Blocks given an array of block - identifiers. -*/ - async fn batch_get_blocks( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /** ExecuteBlock is called to deterministically derive a rollup block from - filtered sequencer block information. -*/ - async fn execute_block( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /** GetCommitmentState fetches the current CommitmentState of the chain. -*/ - async fn get_commitment_state( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /** UpdateCommitmentState replaces the whole CommitmentState with a new - CommitmentState. -*/ - async fn update_commitment_state( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - } - /** ExecutionService is used to drive deterministic production of blocks. - - The service can be implemented by any blockchain which wants to utilize the - Astria Shared Sequencer, and will have block production driven via the Astria - "Conductor". -*/ - #[derive(Debug)] - pub struct ExecutionServiceServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl ExecutionServiceServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } - pub fn from_arc(inner: Arc) -> Self { - let inner = _Inner(inner); - Self { - inner, - accept_compression_encodings: Default::default(), - send_compression_encodings: Default::default(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - pub fn with_interceptor( - inner: T, - interceptor: F, - ) -> InterceptedService - where - F: tonic::service::Interceptor, - { - InterceptedService::new(Self::new(inner), interceptor) - } - /// Enable decompressing requests with the given encoding. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.accept_compression_encodings.enable(encoding); - self - } - /// Compress responses with the given encoding, if the client supports it. - #[must_use] - pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.send_compression_encodings.enable(encoding); - self - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } - } - impl tonic::codegen::Service> for ExecutionServiceServer - where - T: ExecutionService, - B: Body + Send + 'static, - B::Error: Into + Send + 'static, - { - type Response = http::Response; - type Error = std::convert::Infallible; - type Future = BoxFuture; - fn poll_ready( - &mut self, - _cx: &mut Context<'_>, - ) -> Poll> { - Poll::Ready(Ok(())) - } - fn call(&mut self, req: http::Request) -> Self::Future { - let inner = self.inner.clone(); - match req.uri().path() { - "/astria.execution.v1alpha2.ExecutionService/GetBlock" => { - #[allow(non_camel_case_types)] - struct GetBlockSvc(pub Arc); - impl< - T: ExecutionService, - > tonic::server::UnaryService - for GetBlockSvc { - type Response = super::Block; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { (*inner).get_block(request).await }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetBlockSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/astria.execution.v1alpha2.ExecutionService/BatchGetBlocks" => { - #[allow(non_camel_case_types)] - struct BatchGetBlocksSvc(pub Arc); - impl< - T: ExecutionService, - > tonic::server::UnaryService - for BatchGetBlocksSvc { - type Response = super::BatchGetBlocksResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).batch_get_blocks(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = BatchGetBlocksSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/astria.execution.v1alpha2.ExecutionService/ExecuteBlock" => { - #[allow(non_camel_case_types)] - struct ExecuteBlockSvc(pub Arc); - impl< - T: ExecutionService, - > tonic::server::UnaryService - for ExecuteBlockSvc { - type Response = super::Block; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).execute_block(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ExecuteBlockSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/astria.execution.v1alpha2.ExecutionService/GetCommitmentState" => { - #[allow(non_camel_case_types)] - struct GetCommitmentStateSvc(pub Arc); - impl< - T: ExecutionService, - > tonic::server::UnaryService - for GetCommitmentStateSvc { - type Response = super::CommitmentState; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).get_commitment_state(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = GetCommitmentStateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/astria.execution.v1alpha2.ExecutionService/UpdateCommitmentState" => { - #[allow(non_camel_case_types)] - struct UpdateCommitmentStateSvc(pub Arc); - impl< - T: ExecutionService, - > tonic::server::UnaryService - for UpdateCommitmentStateSvc { - type Response = super::CommitmentState; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - (*inner).update_commitment_state(request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpdateCommitmentStateSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - _ => { - Box::pin(async move { - Ok( - http::Response::builder() - .status(200) - .header("grpc-status", "12") - .header("content-type", "application/grpc") - .body(empty_body()) - .unwrap(), - ) - }) - } - } - } - } - impl Clone for ExecutionServiceServer { - fn clone(&self) -> Self { - let inner = self.inner.clone(); - Self { - inner, - accept_compression_encodings: self.accept_compression_encodings, - send_compression_encodings: self.send_compression_encodings, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } - } - impl tonic::server::NamedService for ExecutionServiceServer { - const NAME: &'static str = "astria.execution.v1alpha2.ExecutionService"; - } -} diff --git a/crates/astria-proto/src/proto/generated/astria.primitive.v1.rs b/crates/astria-proto/src/proto/generated/astria.primitive.v1.rs index 95fde01df9..ba7ebb49a0 100644 --- a/crates/astria-proto/src/proto/generated/astria.primitive.v1.rs +++ b/crates/astria-proto/src/proto/generated/astria.primitive.v1.rs @@ -1,4 +1,3 @@ -// @generated /// A 128 bit unsigned integer encoded in protobuf., /// /// Protobuf does not support integers larger than 64 bits, @@ -14,9 +13,8 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Uint128 { - #[prost(uint64, tag="1")] + #[prost(uint64, tag = "1")] pub lo: u64, - #[prost(uint64, tag="2")] + #[prost(uint64, tag = "2")] pub hi: u64, } -// @@protoc_insertion_point(module) diff --git a/crates/astria-proto/src/proto/generated/astria.sequencer.v1alpha1.rs b/crates/astria-proto/src/proto/generated/astria.sequencer.v1alpha1.rs index 19597804ad..52e9e910b1 100644 --- a/crates/astria-proto/src/proto/generated/astria.sequencer.v1alpha1.rs +++ b/crates/astria-proto/src/proto/generated/astria.sequencer.v1alpha1.rs @@ -1,20 +1,19 @@ -// @generated /// A response containing the balance of an account. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct BalanceResponse { - #[prost(uint64, tag="2")] + #[prost(uint64, tag = "2")] pub height: u64, - #[prost(message, optional, tag="3")] + #[prost(message, optional, tag = "3")] pub balance: ::core::option::Option, } /// A response containing the current nonce for an account. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct NonceResponse { - #[prost(uint64, tag="2")] + #[prost(uint64, tag = "2")] pub height: u64, - #[prost(uint32, tag="3")] + #[prost(uint32, tag = "3")] pub nonce: u32, } /// `IndexedTransaction` represents a sequencer transaction along with the index @@ -23,39 +22,39 @@ pub struct NonceResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct IndexedTransaction { /// TODO: this is usize - how to define for variable size? - #[prost(uint64, tag="1")] + #[prost(uint64, tag = "1")] pub block_index: u64, - #[prost(bytes="vec", tag="2")] + #[prost(bytes = "vec", tag = "2")] pub transaction: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RollupNamespace { - #[prost(uint64, tag="1")] + #[prost(uint64, tag = "1")] pub block_height: u64, - #[prost(bytes="vec", tag="2")] + #[prost(bytes = "vec", tag = "2")] pub namespace: ::prost::alloc::vec::Vec, } /// `RollupNamespaceData` #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct RollupNamespaceData { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub block_hash: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="2")] + #[prost(message, repeated, tag = "2")] pub rollup_txs: ::prost::alloc::vec::Vec, } /// `SequencerNamespaceData` #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SequencerNamespaceData { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub block_hash: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub header: ::core::option::Option<::tendermint_proto::types::Header>, - #[prost(message, repeated, tag="3")] + #[prost(message, repeated, tag = "3")] pub sequencer_txs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="4")] + #[prost(message, repeated, tag = "4")] pub rollup_namespaces: ::prost::alloc::vec::Vec, } /// helper type - these should get parsed into a map from namespace to @@ -63,71 +62,71 @@ pub struct SequencerNamespaceData { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct NamespacedIndexedTransactions { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub namespace: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag="2")] + #[prost(message, repeated, tag = "2")] pub txs: ::prost::alloc::vec::Vec, } /// `SequencerBlock` #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SequencerBlock { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub block_hash: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub header: ::core::option::Option<::tendermint_proto::types::Header>, - #[prost(message, repeated, tag="3")] + #[prost(message, repeated, tag = "3")] pub sequencer_transactions: ::prost::alloc::vec::Vec, /// FIXME: the current nested array layout results in bad allocation behavior on deserialization /// see - #[prost(message, repeated, tag="4")] + #[prost(message, repeated, tag = "4")] pub rollup_transactions: ::prost::alloc::vec::Vec, } /// `SignedTransaction` is a transaction that has /// been signed by the given public key. -/// It wraps an `UnsignedTransaction` with a +/// It wraps an `UnsignedTransaction` with a /// signature and public key. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignedTransaction { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub signature: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] + #[prost(bytes = "vec", tag = "2")] pub public_key: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="3")] + #[prost(message, optional, tag = "3")] pub transaction: ::core::option::Option, } -/// `UnsignedTransaction` is a transaction that does +/// `UnsignedTransaction` is a transaction that does /// not have an attached signature. /// Note: `value` must be set, it cannot be `None`. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnsignedTransaction { - #[prost(uint32, tag="1")] + #[prost(uint32, tag = "1")] pub nonce: u32, - #[prost(message, repeated, tag="2")] + #[prost(message, repeated, tag = "2")] pub actions: ::prost::alloc::vec::Vec, } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Action { - #[prost(oneof="action::Value", tags="1, 2, 3, 4, 5")] + #[prost(oneof = "action::Value", tags = "1, 2, 3, 4, 5")] pub value: ::core::option::Option, } /// Nested message and enum types in `Action`. pub mod action { #[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Oneof)] + #[derive(Clone, PartialEq, ::prost::Oneof)] pub enum Value { - #[prost(message, tag="1")] + #[prost(message, tag = "1")] TransferAction(super::TransferAction), - #[prost(message, tag="2")] + #[prost(message, tag = "2")] SequenceAction(super::SequenceAction), - #[prost(message, tag="3")] + #[prost(message, tag = "3")] ValidatorUpdateAction(::tendermint_proto::abci::ValidatorUpdate), - #[prost(message, tag="4")] + #[prost(message, tag = "4")] SudoAddressChangeAction(super::SudoAddressChangeAction), - #[prost(message, tag="5")] + #[prost(message, tag = "5")] MintAction(super::MintAction), } } @@ -138,9 +137,9 @@ pub mod action { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TransferAction { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub to: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub amount: ::core::option::Option, } /// `SequenceAction` represents a transaction destined for another @@ -151,20 +150,20 @@ pub struct TransferAction { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SequenceAction { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub chain_id: ::prost::alloc::vec::Vec, - #[prost(bytes="vec", tag="2")] + #[prost(bytes = "vec", tag = "2")] pub data: ::prost::alloc::vec::Vec, } /// / `SudoAddressChangeAction` represents a transaction that changes -/// / the sudo address of the chain, which is the address authorized to +/// / the sudo address of the chain, which is the address authorized to /// / make validator update actions. /// / /// / It contains the new sudo address. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SudoAddressChangeAction { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub new_address: ::prost::alloc::vec::Vec, } /// `MintAction` represents a minting transaction. @@ -174,9 +173,8 @@ pub struct SudoAddressChangeAction { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MintAction { - #[prost(bytes="vec", tag="1")] + #[prost(bytes = "vec", tag = "1")] pub to: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag="2")] + #[prost(message, optional, tag = "2")] pub amount: ::core::option::Option, } -// @@protoc_insertion_point(module) diff --git a/crates/astria-proto/tests/proto_build.rs b/crates/astria-proto/tests/proto_build.rs index b085a2b0af..49db6a6f77 100644 --- a/crates/astria-proto/tests/proto_build.rs +++ b/crates/astria-proto/tests/proto_build.rs @@ -1,12 +1,11 @@ use std::{ collections::HashMap, - env::{ - self, - consts::OS, - }, + env, + ffi::OsStr, fs::{ read_dir, read_to_string, + remove_file, write, }, path::{ @@ -20,8 +19,11 @@ use tempfile::tempdir; const OUT_DIR: &str = "src/proto/generated"; -fn buf_from_env() -> PathBuf { - let os_specific_hint = match OS { +const PROTO_DIR: &str = "proto/"; +const INCLUDES: &[&str] = &[PROTO_DIR]; + +fn get_buf_from_env() -> PathBuf { + let os_specific_hint = match env::consts::OS { "macos" => "You could try running `brew install buf` or downloading a recent release from https://github.com/bufbuild/buf/releases", "linux" => "You can download it from https://github.com/bufbuild/buf/releases; if you are on Arch Linux, install it from the AUR with `rua install buf` or another helper", _other => "Check if there is a precompiled version for your OS at https://github.com/bufbuild/buf/releases" @@ -37,72 +39,92 @@ fn buf_from_env() -> PathBuf { .or_else(|| which::which("buf").ok()) .expect(&msg) } - -fn build_content_map(path: impl AsRef) -> HashMap { - read_dir(path) - .expect("should be able to read target folder for generated files") - .flatten() - .map(|entry| { - let path = entry.path(); - let name = path - .file_name() - .expect("every generated file should have a file name") - .to_string_lossy() - .to_string(); - let contents = read_to_string(path) - .expect("should be able to read the contents of an existing generated file"); - (name, contents) - }) - .collect() -} - #[test] fn build() { let before_build = build_content_map(OUT_DIR); - let buf = buf_from_env(); - let out_dir = - tempdir().expect("should be able to create a temp dir to store the generated files"); - let out_dir_str = out_dir - .path() - .to_str() - .expect( - "temp out dir should always be generated with valid utf8 encoded alphanumeric bytes", - ) - .to_string(); - - // Run the `buf generate` command to generate the Rust files + let buf = get_buf_from_env(); let mut cmd = Command::new(buf.clone()); - cmd.arg("generate") + + let buf_img = tempfile::NamedTempFile::new() + .expect("should be able to create a temp file to hold the buf image file descriptor set"); + cmd.arg("build") .arg("--output") - .arg(out_dir_str) - .arg("--template") - .arg("buf.gen.yaml") + .arg(buf_img.path()) + .arg("--as-file-descriptor-set") + .arg(".") .current_dir(env!("CARGO_MANIFEST_DIR")); match cmd.output() { Err(e) => { - panic!("failed compiling protobuf: failed to invoke buf (path: {buf:?}): {e:?}"); + panic!( + "failed creating file descriptor set from protobuf: failed to invoke buf (path: \ + {buf:?}): {e:?}" + ); } Ok(output) if !output.status.success() => { panic!( - "failed compiling protobuf: `buf` returned error: {}", + "failed creating file descriptor set from protobuf: `buf` returned error: {}", String::from_utf8_lossy(&output.stderr) ); } Ok(_) => {} }; - let after_build = build_content_map(out_dir.path()); + let files = find_protos(PROTO_DIR); + + let out_dir = + tempdir().expect("should be able to create a temp dir to store the generated files"); + + tonic_build::configure() + .build_client(true) + .build_server(true) + .client_mod_attribute(".", "#[cfg(feature=\"client\")]") + .server_mod_attribute(".", "#[cfg(feature=\"server\")]") + .extern_path(".tendermint.abci", "::tendermint-proto::abci") + .extern_path(".tendermint.crypto", "::tendermint-proto::crypto") + .extern_path(".tendermint.version", "::tendermint-proto::version") + .extern_path(".tendermint.types", "::tendermint-proto::types") + .type_attribute(".astria.primitive.v1.Uint128", "#[derive(Copy)]") + .out_dir(out_dir.path()) + .file_descriptor_set_path(buf_img.path()) + .skip_protoc_run() + .compile(&files, INCLUDES) + .expect("should be able to compile protobuf using tonic"); + + let mut after_build = build_content_map(out_dir.path()); + clean_non_astria_code(&mut after_build); ensure_files_are_the_same(&before_build, after_build, OUT_DIR); } -fn ensure_files_are_the_same( - before: &HashMap, - after: HashMap, - target_dir: &'static str, -) { - if before == &after { +fn clean_non_astria_code(generated: &mut ContentMap) { + let foreign_file_names: Vec<_> = generated + .files + .keys() + .filter(|name| !name.starts_with("astria.")) + .cloned() + .collect(); + for name in foreign_file_names { + let _ = generated.codes.remove(&name); + let file = generated + .files + .remove(&name) + .expect("file should exist under the name"); + let _ = remove_file(file); + } +} + +fn find_protos>(dir: P) -> Vec { + walkdir::WalkDir::new(dir) + .into_iter() + .filter_map(|e| e.ok()) + .filter(|e| e.file_type().is_file() && e.path().extension() == Some(OsStr::new("proto"))) + .map(|e| e.into_path()) + .collect() +} + +fn ensure_files_are_the_same(before: &ContentMap, after: ContentMap, target_dir: &'static str) { + if &before.codes == &after.codes { return; } @@ -112,7 +134,7 @@ fn ensure_files_are_the_same( locally and commit the changes." ); - for (name, content) in after { + for (name, content) in after.codes { let dst = Path::new(target_dir).join(name); if let Err(e) = write(&dst, content) { panic!( @@ -125,3 +147,32 @@ fn ensure_files_are_the_same( panic!("the generated files have changed; please commit the changes"); } + +struct ContentMap { + files: HashMap, + codes: HashMap, +} + +fn build_content_map(path: impl AsRef) -> ContentMap { + let mut files = HashMap::new(); + let mut codes = HashMap::new(); + for entry in read_dir(path) + .expect("should be able to read target folder for generated files") + .flatten() + { + let path = entry.path(); + let name = path + .file_name() + .expect("generated file should have a file name") + .to_string_lossy() + .to_string(); + let contents = read_to_string(&path) + .expect("should be able to read the contents of an existing generated file"); + files.insert(name.clone(), path); + codes.insert(name.clone(), contents); + } + ContentMap { + files, + codes, + } +} From 98b2dbf7aa8a4bba417255fa17b27d604c391e21 Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Wed, 15 Nov 2023 16:53:03 +0100 Subject: [PATCH 2/5] remove buf.gen.yaml --- crates/astria-proto/buf.gen.yaml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 crates/astria-proto/buf.gen.yaml diff --git a/crates/astria-proto/buf.gen.yaml b/crates/astria-proto/buf.gen.yaml deleted file mode 100644 index 618788decc..0000000000 --- a/crates/astria-proto/buf.gen.yaml +++ /dev/null @@ -1,15 +0,0 @@ -version: v1 -managed: - enabled: true -plugins: - - plugin: buf.build/community/neoeinstein-prost:v0.2.3 - out: . - opt: - - extern_path=.tendermint.types=::tendermint-proto::types - - extern_path=.tendermint.abci=::tendermint-proto::abci - - type_attribute=.astria.primitive.v1.Uint128=#[derive(Copy)] - - plugin: buf.build/community/neoeinstein-tonic:v0.3.0 - out: . - opt: - - server_mod_attribute=.=#[cfg(feature="server")] - - client_mod_attribute=.=#[cfg(feature="client")] From 60062d8e2b8f7e3437b731f25f40e9f8865c83f0 Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Wed, 15 Nov 2023 17:01:23 +0100 Subject: [PATCH 3/5] clippy --- crates/astria-proto/tests/proto_build.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/astria-proto/tests/proto_build.rs b/crates/astria-proto/tests/proto_build.rs index 49db6a6f77..60b8c02c8e 100644 --- a/crates/astria-proto/tests/proto_build.rs +++ b/crates/astria-proto/tests/proto_build.rs @@ -115,16 +115,20 @@ fn clean_non_astria_code(generated: &mut ContentMap) { } fn find_protos>(dir: P) -> Vec { - walkdir::WalkDir::new(dir) + use walkdir::{ + DirEntry, + WalkDir, + }; + WalkDir::new(dir) .into_iter() - .filter_map(|e| e.ok()) + .filter_map(Result::ok) .filter(|e| e.file_type().is_file() && e.path().extension() == Some(OsStr::new("proto"))) - .map(|e| e.into_path()) + .map(DirEntry::into_path) .collect() } fn ensure_files_are_the_same(before: &ContentMap, after: ContentMap, target_dir: &'static str) { - if &before.codes == &after.codes { + if before.codes == after.codes { return; } From 423fe4f4cfbf85c57f0a16cf0e3ba187ad734daf Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Wed, 15 Nov 2023 17:02:02 +0100 Subject: [PATCH 4/5] undo uncomment --- Cargo.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f0fffdf974..a17eafeaf3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,7 +62,7 @@ which = "4.4.0" wiremock = "0.5" [patch.crates-io] -# tendermint = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } -# tendermint-config = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } -# tendermint-proto = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } -# tendermint-rpc = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } +tendermint = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } +tendermint-config = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } +tendermint-proto = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } +tendermint-rpc = { git = "https://github.com/astriaorg/tendermint-rs", branch = "v0.33.2-reqwest-backport" } From 6120bea8eb8599c1eba3eb202637077c0210852a Mon Sep 17 00:00:00 2001 From: Richard Janis Goldschmidt Date: Wed, 15 Nov 2023 17:03:36 +0100 Subject: [PATCH 5/5] update lock file --- Cargo.lock | 293 +++++++---------------------------------------------- 1 file changed, 36 insertions(+), 257 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2ad6cbc481..4792f6bd89 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -680,18 +680,18 @@ dependencies = [ [[package]] name = "async-tungstenite" -version = "0.20.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0388bb7a400072bbb41ceb75d65c3baefb2ea99672fa22e85278452cd9b58b" +checksum = "a1e9efbe14612da0a19fb983059a0b621e9cf6225d7018ecab4f9988215540dc" dependencies = [ "futures-io", "futures-util", "log", "pin-project-lite", - "rustls-native-certs 0.6.3", + "rustls-native-certs", "tokio", - "tokio-rustls 0.23.4", - "tungstenite 0.18.0", + "tokio-rustls", + "tungstenite", ] [[package]] @@ -1493,15 +1493,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "ct-logs" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1a816186fa68d9e426e3cb4ae4dff1fcd8e4a2c34b781bf7a822574a0d0aac8" -dependencies = [ - "sct 0.6.1", -] - [[package]] name = "ct-merkle" version = "0.1.0" @@ -2565,30 +2556,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "headers" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" -dependencies = [ - "base64 0.21.4", - "bytes", - "headers-core", - "http", - "httpdate", - "mime", - "sha1", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http", -] - [[package]] name = "heck" version = "0.4.1" @@ -2728,43 +2695,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-proxy" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca815a891b24fdfb243fa3239c86154392b0953ee584aa1a2a1f66d20cbe75cc" -dependencies = [ - "bytes", - "futures", - "headers", - "http", - "hyper", - "hyper-rustls 0.22.1", - "rustls-native-certs 0.5.0", - "tokio", - "tokio-rustls 0.22.0", - "tower-service", - "webpki 0.21.4", -] - -[[package]] -name = "hyper-rustls" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" -dependencies = [ - "ct-logs", - "futures-util", - "hyper", - "log", - "rustls 0.19.1", - "rustls-native-certs 0.5.0", - "tokio", - "tokio-rustls 0.22.0", - "webpki 0.21.4", - "webpki-roots 0.21.1", -] - [[package]] name = "hyper-rustls" version = "0.24.1" @@ -2775,10 +2705,10 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.21.7", - "rustls-native-certs 0.6.3", + "rustls", + "rustls-native-certs", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", ] [[package]] @@ -3031,11 +2961,11 @@ dependencies = [ "http", "jsonrpsee-core", "pin-project", - "rustls-native-certs 0.6.3", + "rustls-native-certs", "soketto", "thiserror", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", "tokio-util 0.7.9", "tracing", "url", @@ -3074,7 +3004,7 @@ checksum = "0dd865d0072764cb937b0110a92b5f53e995f7101cb346beca03d93a2dea79de" dependencies = [ "async-trait", "hyper", - "hyper-rustls 0.24.1", + "hyper-rustls", "jsonrpsee-core", "jsonrpsee-types", "serde", @@ -3157,7 +3087,7 @@ checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ "base64 0.21.4", "pem", - "ring 0.16.20", + "ring", "serde", "serde_json", "simple_asn1", @@ -4509,7 +4439,7 @@ dependencies = [ "http", "http-body", "hyper", - "hyper-rustls 0.24.1", + "hyper-rustls", "ipnet", "js-sys", "log", @@ -4517,20 +4447,21 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.7", + "rustls", + "rustls-native-certs", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "system-configuration", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "webpki-roots 0.25.2", + "webpki-roots", "winreg", ] @@ -4559,26 +4490,12 @@ dependencies = [ "cc", "libc", "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", + "spin", + "untrusted", "web-sys", "winapi", ] -[[package]] -name = "ring" -version = "0.17.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" -dependencies = [ - "cc", - "getrandom 0.2.10", - "libc", - "spin 0.9.8", - "untrusted 0.9.0", - "windows-sys", -] - [[package]] name = "ripemd" version = "0.1.3" @@ -4704,31 +4621,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "rustls" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" -dependencies = [ - "base64 0.13.1", - "log", - "ring 0.16.20", - "sct 0.6.1", - "webpki 0.21.4", -] - -[[package]] -name = "rustls" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" -dependencies = [ - "log", - "ring 0.16.20", - "sct 0.7.0", - "webpki 0.22.4", -] - [[package]] name = "rustls" version = "0.21.7" @@ -4736,21 +4628,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", - "ring 0.16.20", + "ring", "rustls-webpki", - "sct 0.7.0", -] - -[[package]] -name = "rustls-native-certs" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a07b7c1885bd8ed3831c289b7870b13ef46fe0e856d288c30d9cc17d75a2092" -dependencies = [ - "openssl-probe", - "rustls 0.19.1", - "schannel", - "security-framework", + "sct", ] [[package]] @@ -4780,8 +4660,8 @@ version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring", + "untrusted", ] [[package]] @@ -4865,24 +4745,14 @@ dependencies = [ "sha2 0.10.8", ] -[[package]] -name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - [[package]] name = "sct" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", + "ring", + "untrusted", ] [[package]] @@ -5267,12 +5137,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "spki" version = "0.7.2" @@ -5482,8 +5346,7 @@ dependencies = [ [[package]] name = "tendermint" version = "0.33.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c35fe4fd24a7715571814c22416dbc40ec0f2a6e3cce75d73e19699faecd246" +source = "git+https://github.com/astriaorg/tendermint-rs?branch=v0.33.2-reqwest-backport#7e4d10db18df82691fc9426d4853935642763b2d" dependencies = [ "bytes", "digest 0.10.7", @@ -5511,8 +5374,7 @@ dependencies = [ [[package]] name = "tendermint-config" version = "0.33.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a213a026dfc1c68468160bee24bf128e26002170abc123678ecfbe5ff37f91d" +source = "git+https://github.com/astriaorg/tendermint-rs?branch=v0.33.2-reqwest-backport#7e4d10db18df82691fc9426d4853935642763b2d" dependencies = [ "flex-error", "serde", @@ -5542,8 +5404,7 @@ dependencies = [ [[package]] name = "tendermint-proto" version = "0.33.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639e5adffd77220d238a800a72c74c98d7e869290a6e4494c10b6b4e8f702f02" +source = "git+https://github.com/astriaorg/tendermint-rs?branch=v0.33.2-reqwest-backport#7e4d10db18df82691fc9426d4853935642763b2d" dependencies = [ "bytes", "flex-error", @@ -5560,8 +5421,7 @@ dependencies = [ [[package]] name = "tendermint-rpc" version = "0.33.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4df40d6d298fdca6cc5af67c85eb62c1113b5834ca321bde30240c919d4912b" +source = "git+https://github.com/astriaorg/tendermint-rs?branch=v0.33.2-reqwest-backport#7e4d10db18df82691fc9426d4853935642763b2d" dependencies = [ "async-trait", "async-tungstenite", @@ -5569,12 +5429,9 @@ dependencies = [ "flex-error", "futures", "getrandom 0.2.10", - "http", - "hyper", - "hyper-proxy", - "hyper-rustls 0.22.1", "peg", "pin-project", + "reqwest", "semver 1.0.20", "serde", "serde_bytes", @@ -5742,35 +5599,13 @@ dependencies = [ "syn 2.0.38", ] -[[package]] -name = "tokio-rustls" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" -dependencies = [ - "rustls 0.19.1", - "tokio", - "webpki 0.21.4", -] - -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls 0.20.9", - "tokio", - "webpki 0.22.4", -] - [[package]] name = "tokio-rustls" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.7", + "rustls", "tokio", ] @@ -5806,11 +5641,11 @@ checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" dependencies = [ "futures-util", "log", - "rustls 0.21.7", + "rustls", "tokio", - "tokio-rustls 0.24.1", - "tungstenite 0.20.1", - "webpki-roots 0.25.2", + "tokio-rustls", + "tungstenite", + "webpki-roots", ] [[package]] @@ -6108,27 +5943,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tungstenite" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" -dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "http", - "httparse", - "log", - "rand 0.8.5", - "rustls 0.20.9", - "sha1", - "thiserror", - "url", - "utf-8", - "webpki 0.22.4", -] - [[package]] name = "tungstenite" version = "0.20.1" @@ -6142,7 +5956,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "rustls 0.21.7", + "rustls", "sha1", "thiserror", "url", @@ -6233,12 +6047,6 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" - [[package]] name = "url" version = "2.4.1" @@ -6413,35 +6221,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring 0.16.20", - "untrusted 0.7.1", -] - -[[package]] -name = "webpki" -version = "0.22.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" -dependencies = [ - "ring 0.17.5", - "untrusted 0.9.0", -] - -[[package]] -name = "webpki-roots" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" -dependencies = [ - "webpki 0.21.4", -] - [[package]] name = "webpki-roots" version = "0.25.2"