From dc9861d80197df242b21053880d8f12ec3a3640a Mon Sep 17 00:00:00 2001 From: Mikhail Zabaluev Date: Mon, 17 Jul 2023 15:51:11 +0300 Subject: [PATCH 1/2] Release 0.32.1 (#1331) * rpc: use compat mode in latest_block_results() (#1326) Just like with the block_results method, the response needs to be parsed varyingly with the RPC dialect. * Fix lints in clippy 0.1.71 (#1330) * tendermint: fix doc links problems in hash --- .../1326-compat-for-latest_block_results.md | 3 +++ .changelog/v0.32.1/summary.md | 2 ++ CHANGELOG.md | 27 +++++++++++++------ abci/Cargo.toml | 4 +-- abci/tests/echo_app.rs | 2 +- config/Cargo.toml | 4 +-- light-client-cli/Cargo.toml | 10 +++---- light-client-detector/Cargo.toml | 10 +++---- light-client-js/Cargo.toml | 6 ++--- light-client-verifier/Cargo.toml | 4 +-- light-client-verifier/src/predicates.rs | 24 ++++++++--------- light-client/Cargo.toml | 8 +++--- p2p/Cargo.toml | 8 +++--- pbt-gen/Cargo.toml | 2 +- proto/Cargo.toml | 2 +- rpc/Cargo.toml | 8 +++--- rpc/src/client/transport/http.rs | 4 +++ rpc/src/client/transport/websocket.rs | 4 +++ std-ext/Cargo.toml | 2 +- tendermint/Cargo.toml | 4 +-- tendermint/src/hash.rs | 4 +-- tendermint/src/time.rs | 2 +- test/Cargo.toml | 2 +- testgen/Cargo.toml | 4 +-- testgen/src/tester.rs | 2 +- tools/abci-test/Cargo.toml | 8 +++--- tools/kvstore-test/Cargo.toml | 6 ++--- tools/rpc-probe/Cargo.toml | 2 +- 28 files changed, 96 insertions(+), 72 deletions(-) create mode 100644 .changelog/v0.32.1/bug-fixes/1326-compat-for-latest_block_results.md create mode 100644 .changelog/v0.32.1/summary.md diff --git a/.changelog/v0.32.1/bug-fixes/1326-compat-for-latest_block_results.md b/.changelog/v0.32.1/bug-fixes/1326-compat-for-latest_block_results.md new file mode 100644 index 000000000..67e134650 --- /dev/null +++ b/.changelog/v0.32.1/bug-fixes/1326-compat-for-latest_block_results.md @@ -0,0 +1,3 @@ +- `[tendermint-rpc]` Use compatibility mode in implementations + of the `Client::latest_block_results` method + ([\#1326](https://github.com/informalsystems/tendermint-rs/pull/1326)) diff --git a/.changelog/v0.32.1/summary.md b/.changelog/v0.32.1/summary.md new file mode 100644 index 000000000..1be47576d --- /dev/null +++ b/.changelog/v0.32.1/summary.md @@ -0,0 +1,2 @@ +Fixed a bug with processing the `latest_block_result` endpoint result +in the RPC client set to the 0.34 compatibility mode. diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e0e342b7..bceb25982 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # CHANGELOG +## v0.32.1 + +Fixed a bug with processing the `latest_block_result` endpoint result +in the RPC client set to the 0.34 compatibility mode. + +### BUG FIXES + +- `[tendermint-rpc]` Use compatibility mode in implementations + of the `Client::latest_block_results` method + ([\#1326](https://github.com/informalsystems/tendermint-rs/pull/1326)) + ## v0.32.0 *May 3rd, 2023* @@ -606,18 +617,18 @@ not yet support `no_std`. - Upgraded Prost to the official v0.9 release to finally resolve the security issue introduced by v0.7 ([#925](https://github.com/informalsystems/tendermint-rs/issues/925)) -- `[tendermint]` The `tendermint::node::info::ListenAddress::to_net_address` - method was replaced with a simple `as_str` method toward facilitating - `no_std` compatibility ([#983](https://github.com/informalsystems/tendermint- - rs/issues/983)) -- `[tendermint]` The `tendermint::node::info::OtherInfo::rpc_address` - field type has been changed from `tendermint::net::Address` - to `String` toward facilitating `no_std` compatibility - ([#983](https://github.com/informalsystems/tendermint-rs/issues/983)) - `[tendermint, tendermint-config]` The `tendermint::config` module has now been broken out into its own crate (`tendermint- config`) to help towards facilitating `no_std` compatibility ([#983](https://github.com/informalsystems/tendermint-rs/issues/983)) +- `[tendermint]` The `tendermint::node::info::OtherInfo::rpc_address` + field type has been changed from `tendermint::net::Address` + to `String` toward facilitating `no_std` compatibility + ([#983](https://github.com/informalsystems/tendermint-rs/issues/983)) +- `[tendermint]` The `tendermint::node::info::ListenAddress::to_net_address` + method was replaced with a simple `as_str` method toward facilitating + `no_std` compatibility ([#983](https://github.com/informalsystems/tendermint- + rs/issues/983)) ### FEATURES diff --git a/abci/Cargo.toml b/abci/Cargo.toml index e4cdb69cf..11ded3525 100644 --- a/abci/Cargo.toml +++ b/abci/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint-abci" -version = "0.32.0" +version = "0.32.1" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" @@ -33,7 +33,7 @@ binary = [ [dependencies] bytes = { version = "1.0", default-features = false } prost = { version = "0.11", default-features = false } -tendermint-proto = { version = "0.32.0", default-features = false, path = "../proto" } +tendermint-proto = { version = "0.32.1", default-features = false, path = "../proto" } tracing = { version = "0.1", default-features = false } flex-error = { version = "0.4.4", default-features = false } structopt = { version = "0.3", optional = true, default-features = false } diff --git a/abci/tests/echo_app.rs b/abci/tests/echo_app.rs index c2f07895b..4fd9fbe2a 100644 --- a/abci/tests/echo_app.rs +++ b/abci/tests/echo_app.rs @@ -8,7 +8,7 @@ mod echo_app_integration { #[test] fn echo() { let server = ServerBuilder::default() - .bind("127.0.0.1:0", EchoApp::default()) + .bind("127.0.0.1:0", EchoApp) .unwrap(); let server_addr = server.local_addr(); let _ = std::thread::spawn(move || server.listen()); diff --git a/config/Cargo.toml b/config/Cargo.toml index 72ae4c785..3c21146be 100644 --- a/config/Cargo.toml +++ b/config/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint-config" -version = "0.32.0" # Also update depending crates (rpc, light-node, ..) when bumping this. +version = "0.32.1" # Also update depending crates (rpc, light-node, ..) when bumping this. license = "Apache-2.0" homepage = "https://www.tendermint.com/" repository = "https://github.com/informalsystems/tendermint-rs/tree/main/tendermint" @@ -24,7 +24,7 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies] -tendermint = { version = "0.32.0", default-features = false, features = ["rust-crypto"], path = "../tendermint" } +tendermint = { version = "0.32.1", default-features = false, features = ["rust-crypto"], path = "../tendermint" } flex-error = { version = "0.4.4", default-features = false } serde = { version = "1", features = ["derive"] } serde_json = "1" diff --git a/light-client-cli/Cargo.toml b/light-client-cli/Cargo.toml index 8ee946421..b42b8d62f 100644 --- a/light-client-cli/Cargo.toml +++ b/light-client-cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint-light-client-cli" -version = "0.32.0" +version = "0.32.1" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -23,10 +23,10 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies] -tendermint = { version = "0.32.0", path = "../tendermint" } -tendermint-rpc = { version = "0.32.0", path = "../rpc", features = ["http-client"] } -tendermint-light-client = { version = "0.32.0", path = "../light-client" } -tendermint-light-client-detector = { version = "0.32.0", path = "../light-client-detector" } +tendermint = { version = "0.32.1", path = "../tendermint" } +tendermint-rpc = { version = "0.32.1", path = "../rpc", features = ["http-client"] } +tendermint-light-client = { version = "0.32.1", path = "../light-client" } +tendermint-light-client-detector = { version = "0.32.1", path = "../light-client-detector" } clap = { version = "4.1.8", features = ["derive"] } color-eyre = "0.6.2" diff --git a/light-client-detector/Cargo.toml b/light-client-detector/Cargo.toml index da31a20b7..49c0429e9 100644 --- a/light-client-detector/Cargo.toml +++ b/light-client-detector/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint-light-client-detector" -version = "0.32.0" +version = "0.32.1" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -23,10 +23,10 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies] -tendermint = { version = "0.32.0", path = "../tendermint" } -tendermint-rpc = { version = "0.32.0", path = "../rpc", features = ["http-client"] } -tendermint-proto = { version = "0.32.0", path = "../proto" } -tendermint-light-client = { version = "0.32.0", path = "../light-client" } +tendermint = { version = "0.32.1", path = "../tendermint" } +tendermint-rpc = { version = "0.32.1", path = "../rpc", features = ["http-client"] } +tendermint-proto = { version = "0.32.1", path = "../proto" } +tendermint-light-client = { version = "0.32.1", path = "../light-client" } contracts = { version = "0.6.2", default-features = false } crossbeam-channel = { version = "0.4.2", default-features = false } diff --git a/light-client-js/Cargo.toml b/light-client-js/Cargo.toml index 96e0664e5..110577adb 100644 --- a/light-client-js/Cargo.toml +++ b/light-client-js/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint-light-client-js" -version = "0.32.0" +version = "0.32.1" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" @@ -22,8 +22,8 @@ default = ["console_error_panic_hook"] [dependencies] serde = { version = "1.0", default-features = false, features = [ "derive" ] } serde_json = { version = "1.0", default-features = false } -tendermint = { version = "0.32.0", default-features = false, path = "../tendermint" } -tendermint-light-client-verifier = { version = "0.32.0", features = ["rust-crypto"], default-features = false, path = "../light-client-verifier" } +tendermint = { version = "0.32.1", default-features = false, path = "../tendermint" } +tendermint-light-client-verifier = { version = "0.32.1", features = ["rust-crypto"], default-features = false, path = "../light-client-verifier" } wasm-bindgen = { version = "0.2.63", default-features = false, features = [ "serde-serialize" ] } serde-wasm-bindgen = { version = "0.4.5", default-features = false } diff --git a/light-client-verifier/Cargo.toml b/light-client-verifier/Cargo.toml index fadf29f25..d0778d609 100644 --- a/light-client-verifier/Cargo.toml +++ b/light-client-verifier/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint-light-client-verifier" -version = "0.32.0" +version = "0.32.1" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -27,7 +27,7 @@ default = ["rust-crypto", "flex-error/std", "flex-error/eyre_tracer"] rust-crypto = ["tendermint/rust-crypto"] [dependencies] -tendermint = { version = "0.32.0", path = "../tendermint", default-features = false } +tendermint = { version = "0.32.1", path = "../tendermint", default-features = false } derive_more = { version = "0.99.5", default-features = false, features = ["display"] } serde = { version = "1.0.106", default-features = false } diff --git a/light-client-verifier/src/predicates.rs b/light-client-verifier/src/predicates.rs index 175e151f3..8383ff482 100644 --- a/light-client-verifier/src/predicates.rs +++ b/light-client-verifier/src/predicates.rs @@ -263,7 +263,7 @@ mod tests { let header_one = Header::new(&val).generate().unwrap(); let header_two = Header::new(&val).generate().unwrap(); - let vp = ProdPredicates::default(); + let vp = ProdPredicates; // 1. ensure valid header verifies let result_ok = vp.is_monotonic_bft_time(header_two.time, header_one.time); @@ -286,7 +286,7 @@ mod tests { let header_one = Header::new(&val).generate().unwrap(); let header_two = Header::new(&val).height(2).generate().unwrap(); - let vp = ProdPredicates::default(); + let vp = ProdPredicates; // 1. ensure valid header verifies let result_ok = vp.is_monotonic_height(header_two.height, header_one.height); @@ -310,7 +310,7 @@ mod tests { let header_one = Header::new(&val).chain_id("chaina-1").generate().unwrap(); let header_two = Header::new(&val).chain_id("chainb-1").generate().unwrap(); - let vp = ProdPredicates::default(); + let vp = ProdPredicates; // 1. ensure valid header verifies let result_ok = vp.is_matching_chain_id(&header_one.chain_id, &header_one.chain_id); @@ -333,7 +333,7 @@ mod tests { let val = Validator::new("val-1"); let header = Header::new(&[val]).generate().unwrap(); - let vp = ProdPredicates::default(); + let vp = ProdPredicates; // 1. ensure valid header verifies let mut trusting_period = Duration::new(1000, 0); @@ -362,7 +362,7 @@ mod tests { let val = Validator::new("val-1"); let header = Header::new(&[val]).generate().unwrap(); - let vp = ProdPredicates::default(); + let vp = ProdPredicates; let one_second = Duration::new(1, 0); let now = OffsetDateTime::now_utc().try_into().unwrap(); @@ -393,7 +393,7 @@ mod tests { let bad_validator_set = ValidatorSet::new(vec!["bad-val"]).generate().unwrap(); - let vp = ProdPredicates::default(); + let vp = ProdPredicates; // Test positive case // 1. For predicate: validator_sets_match @@ -458,7 +458,7 @@ mod tests { .unwrap() .signed_header; - let vp = ProdPredicates::default(); + let vp = ProdPredicates; // 1. ensure valid signed header verifies let result_ok = @@ -493,8 +493,8 @@ mod tests { let mut signed_header = light_block.signed_header; let val_set = light_block.validators; - let vp = ProdPredicates::default(); - let commit_validator = ProdCommitValidator::default(); + let vp = ProdPredicates; + let commit_validator = ProdCommitValidator; // Test scenarios --> // 1. valid commit - must result "Ok" @@ -580,7 +580,7 @@ mod tests { let light_block2: LightBlock = test_lb1.next().generate().unwrap().into(); - let vp = ProdPredicates::default(); + let vp = ProdPredicates; // Test scenarios --> // 1. next_validator_set hash matches @@ -627,7 +627,7 @@ mod tests { let val_set = light_block.validators; let signed_header = light_block.signed_header; - let vp = ProdPredicates::default(); + let vp = ProdPredicates; let mut trust_threshold = TrustThreshold::new(1, 3).expect("Cannot make trust threshold"); let voting_power_calculator = ProdVotingPowerCalculator::default(); @@ -681,7 +681,7 @@ mod tests { let mut light_block: LightBlock = TestgenLightBlock::new_default(2).generate().unwrap().into(); - let vp = ProdPredicates::default(); + let vp = ProdPredicates; let voting_power_calculator = ProdVotingPowerCalculator::default(); // Test scenarios --> diff --git a/light-client/Cargo.toml b/light-client/Cargo.toml index 6b354774f..accb3610a 100644 --- a/light-client/Cargo.toml +++ b/light-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint-light-client" -version = "0.32.0" +version = "0.32.1" edition = "2021" license = "Apache-2.0" readme = "README.md" @@ -35,9 +35,9 @@ unstable = ["rust-crypto"] mbt = ["rust-crypto"] [dependencies] -tendermint = { version = "0.32.0", path = "../tendermint", default-features = false } -tendermint-rpc = { version = "0.32.0", path = "../rpc", default-features = false } -tendermint-light-client-verifier = { version = "0.32.0", path = "../light-client-verifier", default-features = false } +tendermint = { version = "0.32.1", path = "../tendermint", default-features = false } +tendermint-rpc = { version = "0.32.1", path = "../rpc", default-features = false } +tendermint-light-client-verifier = { version = "0.32.1", path = "../light-client-verifier", default-features = false } contracts = { version = "0.6.2", default-features = false } crossbeam-channel = { version = "0.4.2", default-features = false } diff --git a/p2p/Cargo.toml b/p2p/Cargo.toml index 6696932ac..63d324622 100644 --- a/p2p/Cargo.toml +++ b/p2p/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint-p2p" -version = "0.32.0" +version = "0.32.1" edition = "2021" license = "Apache-2.0" repository = "https://github.com/informalsystems/tendermint-rs" @@ -44,9 +44,9 @@ aead = { version = "0.4.1", default-features = false } flex-error = { version = "0.4.4", default-features = false } # path dependencies -tendermint = { path = "../tendermint", version = "0.32.0", default-features = false } -tendermint-proto = { path = "../proto", version = "0.32.0", default-features = false } -tendermint-std-ext = { path = "../std-ext", version = "0.32.0", default-features = false } +tendermint = { path = "../tendermint", version = "0.32.1", default-features = false } +tendermint-proto = { path = "../proto", version = "0.32.1", default-features = false } +tendermint-std-ext = { path = "../std-ext", version = "0.32.1", default-features = false } # optional dependencies prost-derive = { version = "0.11", optional = true } diff --git a/pbt-gen/Cargo.toml b/pbt-gen/Cargo.toml index f44f27211..53ce45f18 100644 --- a/pbt-gen/Cargo.toml +++ b/pbt-gen/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint-pbt-gen" -version = "0.32.0" +version = "0.32.1" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" diff --git a/proto/Cargo.toml b/proto/Cargo.toml index f0c0847b7..8e09ded42 100644 --- a/proto/Cargo.toml +++ b/proto/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint-proto" -version = "0.32.0" +version = "0.32.1" authors = ["Informal Systems "] edition = "2021" license = "Apache-2.0" diff --git a/rpc/Cargo.toml b/rpc/Cargo.toml index 7d0150fdd..31cc332dd 100644 --- a/rpc/Cargo.toml +++ b/rpc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint-rpc" -version = "0.32.0" +version = "0.32.1" edition = "2021" license = "Apache-2.0" homepage = "https://www.tendermint.com/" @@ -60,9 +60,9 @@ websocket-client = [ ] [dependencies] -tendermint = { version = "0.32.0", default-features = false, path = "../tendermint" } -tendermint-config = { version = "0.32.0", path = "../config", default-features = false } -tendermint-proto = { version = "0.32.0", path = "../proto", default-features = false } +tendermint = { version = "0.32.1", default-features = false, path = "../tendermint" } +tendermint-config = { version = "0.32.1", path = "../config", default-features = false } +tendermint-proto = { version = "0.32.1", path = "../proto", default-features = false } async-trait = { version = "0.1", default-features = false } bytes = { version = "1.0", default-features = false } diff --git a/rpc/src/client/transport/http.rs b/rpc/src/client/transport/http.rs index 2c89d4163..ceaa427cd 100644 --- a/rpc/src/client/transport/http.rs +++ b/rpc/src/client/transport/http.rs @@ -181,6 +181,10 @@ impl Client for HttpClient { perform_with_compat!(self, endpoint::block_results::Request::new(height.into())) } + async fn latest_block_results(&self) -> Result { + perform_with_compat!(self, endpoint::block_results::Request::default()) + } + async fn header(&self, height: H) -> Result where H: Into + Send, diff --git a/rpc/src/client/transport/websocket.rs b/rpc/src/client/transport/websocket.rs index 0c1a710e6..c28ab14f7 100644 --- a/rpc/src/client/transport/websocket.rs +++ b/rpc/src/client/transport/websocket.rs @@ -244,6 +244,10 @@ impl Client for WebSocketClient { perform_with_compat!(self, endpoint::block_results::Request::new(height.into())) } + async fn latest_block_results(&self) -> Result { + perform_with_compat!(self, endpoint::block_results::Request::default()) + } + async fn header(&self, height: H) -> Result where H: Into + Send, diff --git a/std-ext/Cargo.toml b/std-ext/Cargo.toml index bfb598060..85b3edd24 100644 --- a/std-ext/Cargo.toml +++ b/std-ext/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint-std-ext" -version = "0.32.0" +version = "0.32.1" edition = "2021" license = "Apache-2.0" homepage = "https://www.tendermint.com/" diff --git a/tendermint/Cargo.toml b/tendermint/Cargo.toml index 97db45d69..edeb5588f 100644 --- a/tendermint/Cargo.toml +++ b/tendermint/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tendermint" -version = "0.32.0" # Also update depending crates (rpc, light-node, etc..) when bumping this . +version = "0.32.1" # Also update depending crates (rpc, light-node, etc..) when bumping this . license = "Apache-2.0" homepage = "https://www.tendermint.com/" repository = "https://github.com/informalsystems/tendermint-rs/tree/main/tendermint" @@ -44,7 +44,7 @@ serde_repr = { version = "0.1", default-features = false } signature = { version = "2", default-features = false, features = ["alloc"] } subtle = { version = "2", default-features = false } subtle-encoding = { version = "0.5", default-features = false, features = ["bech32-preview"] } -tendermint-proto = { version = "0.32.0", default-features = false, path = "../proto" } +tendermint-proto = { version = "0.32.1", default-features = false, path = "../proto" } time = { version = "0.3", default-features = false, features = ["macros", "parsing"] } zeroize = { version = "1.1", default-features = false, features = ["zeroize_derive", "alloc"] } flex-error = { version = "0.4.4", default-features = false } diff --git a/tendermint/src/hash.rs b/tendermint/src/hash.rs index 56f64736b..f210ee09f 100644 --- a/tendermint/src/hash.rs +++ b/tendermint/src/hash.rs @@ -186,7 +186,7 @@ impl Serialize for Hash { pub mod allow_empty { use super::*; - /// Serialize [`Hash`](crate::hash::Hash) into a string. + /// Serialize [`Hash`](enum@crate::hash::Hash) into a string. pub fn serialize(value: &Hash, serializer: S) -> Result where S: Serializer, @@ -194,7 +194,7 @@ pub mod allow_empty { value.to_string().serialize(serializer) } - /// Deserialize [`Hash`](crate::hash::Hash) from a string, allowing for + /// Deserialize [`Hash`](enum@crate::hash::Hash) from a string, allowing for /// empty hashes. pub fn deserialize<'de, D>(deserializer: D) -> Result where diff --git a/tendermint/src/time.rs b/tendermint/src/time.rs index 90a0e47e3..c3739e0d5 100644 --- a/tendermint/src/time.rs +++ b/tendermint/src/time.rs @@ -64,7 +64,7 @@ impl From