Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v0.19.0 #854

Merged
merged 9 commits into from
Apr 7, 2021
30 changes: 29 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
## Unreleased
## v0.19.0

This release primarily aims to enhance RPC and Light Client functionality,
thereby improving [`ibc-rs`] and fixing an important bug affecting the Light
Client ([#831]).

The RPC now supports TLS 1.2+ connections (through the use of [`rustls`]),
allowing for secure HTTP and WebSocket connections, as well as HTTP/HTTPS
proxies. This implies that the Light Client now also supports these types of
connections.

We additionally introduce two new crates:

* `tendermint-abci` - A lightweight, minimal framework for building Tendermint
[ABCI] applications in Rust.
* `tendermint-light-client-js` - Exposes the Light Client's `verify` method to
JavaScript/WASM. This implies that, for now, you need to bring your own
networking functionality to practically make use of the Light Client's
verification mechanisms.

Various relatively minor breaking API changes were introduced, and are listed
below.

### BREAKING CHANGES

Expand Down Expand Up @@ -51,6 +72,9 @@
### IMPROVEMENTS

* `[tendermint]` IPv6 support has been added for `net::Address` ([#5])
* `[tendermint-rpc]` Add `wait_until_healthy` utility method for RPC clients
to poll the `/health` endpoint of a node until it either returns successfully
or times out ([#855])

### BUG FIXES

Expand All @@ -69,6 +93,10 @@
[#835]: https://github.com/informalsystems/tendermint-rs/issues/835
[#836]: https://github.com/informalsystems/tendermint-rs/issues/836
[#839]: https://github.com/informalsystems/tendermint-rs/pull/839
[#855]: https://github.com/informalsystems/tendermint-rs/pull/855
[ABCI]: https://docs.tendermint.com/master/spec/abci/
[`ibc-rs`]: https://github.com/informalsystems/ibc-rs
[`rustls`]: https://github.com/ctz/rustls

## v0.18.1

Expand Down
14 changes: 9 additions & 5 deletions abci/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
[package]
name = "tendermint-abci"
version = "0.18.1"
authors = ["Thane Thomson <thane@informal.systems>"]
edition = "2018"
name = "tendermint-abci"
version = "0.19.0"
authors = ["Thane Thomson <thane@informal.systems>"]
edition = "2018"
license = "Apache-2.0"
readme = "README.md"
keywords = ["abci", "blockchain", "bft", "consensus", "tendermint"]
repository = "https://github.com/informalsystems/tendermint-rs"
description = """
tendermint-abci provides a simple framework with which to build low-level
applications on top of Tendermint.
Expand All @@ -25,7 +29,7 @@ binary = [ "structopt", "tracing-subscriber" ]
bytes = "1.0"
eyre = "0.6"
prost = "0.7"
tendermint-proto = { version = "0.18.1", path = "../proto" }
tendermint-proto = { version = "0.19.0", path = "../proto" }
thiserror = "1.0"
tracing = "0.1"

Expand Down
18 changes: 10 additions & 8 deletions light-client-js/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
[package]
name = "tendermint-light-client-js"
version = "0.18.1"
authors = [
name = "tendermint-light-client-js"
version = "0.19.0"
authors = [
"Romain Ruetschi <romain@informal.systems>",
"Thane Thomson <thane@informal.systems>"
]
edition = "2018"
license = "Apache-2.0"
edition = "2018"
license = "Apache-2.0"
readme = "README.md"
keywords = ["blockchain", "bft", "consensus", "light-client", "tendermint"]
repository = "https://github.com/informalsystems/tendermint-rs"
description = """
tendermint-light-client-js provides a lightweight, WASM-based interface to
the Tendermint Light Client's verification functionality.
"""
repository = "https://github.com/informalsystems/tendermint-rs"

[lib]
crate-type = ["cdylib", "rlib"]
Expand All @@ -24,8 +26,8 @@ serde = { version = "1.0", features = [ "derive" ] }
serde_json = "1.0"
# TODO(thane): Remove once https://github.com/rustwasm/wasm-bindgen/issues/2508 is resolved
syn = "=1.0.65"
tendermint = { version = "0.18.1", path = "../tendermint" }
tendermint-light-client = { version = "0.18.1", path = "../light-client", default-features = false }
tendermint = { version = "0.19.0", path = "../tendermint" }
tendermint-light-client = { version = "0.19.0", path = "../light-client", default-features = false }
wasm-bindgen = { version = "0.2.63", features = [ "serde-serialize" ] }

# The `console_error_panic_hook` crate provides better debugging of panics by
Expand Down
11 changes: 11 additions & 0 deletions light-client-js/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
//! Tendermint Light Client JavaScript/WASM interface.
//!
//! This crate exposes some of the [`tendermint-light-client`] crate's
//! functionality to be used from the JavaScript ecosystem.
//!
//! For a detailed example, please see the [`verifier-web` example] in the
//! repository.
//!
//! [`tendermint-light-client`]: https://github.com/informalsystems/tendermint-rs/tree/master/light-client
//! [`verifier-web` example]: https://github.com/informalsystems/tendermint-rs/tree/master/light-client-js/examples/verifier-web

mod utils;

use serde::{Deserialize, Serialize};
Expand Down
6 changes: 3 additions & 3 deletions light-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tendermint-light-client"
version = "0.18.1"
version = "0.19.0"
edition = "2018"
license = "Apache-2.0"
readme = "README.md"
Expand Down Expand Up @@ -36,8 +36,8 @@ lightstore-sled = ["sled"]
unstable = []

[dependencies]
tendermint = { version = "0.18.1", path = "../tendermint" }
tendermint-rpc = { version = "0.18.1", path = "../rpc", default-features = false }
tendermint = { version = "0.19.0", path = "../tendermint" }
tendermint-rpc = { version = "0.19.0", path = "../rpc", default-features = false }

anomaly = { version = "0.2.0", features = ["serializer"] }
contracts = "0.4.0"
Expand Down
2 changes: 1 addition & 1 deletion light-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
nonstandard_style
)]
#![doc(
html_root_url = "https://docs.rs/tendermint-light-client/0.18.1",
html_root_url = "https://docs.rs/tendermint-light-client/0.19.0",
html_logo_url = "https://raw.githubusercontent.com/informalsystems/tendermint-rs/master/img/logo-tendermint-rs_3961x4001.png"
)]
#![cfg_attr(docsrs, feature(doc_cfg))]
Expand Down
10 changes: 5 additions & 5 deletions light-node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tendermint-light-node"
version = "0.18.1"
version = "0.19.0"
edition = "2018"
license = "Apache-2.0"
repository = "https://github.com/informalsystems/tendermint-rs"
Expand Down Expand Up @@ -38,10 +38,10 @@ serde = { version = "1", features = ["serde_derive"] }
serde_json = "1.0"
thiserror = "1.0"

tendermint = { version = "0.18.1", path = "../tendermint" }
tendermint-light-client = { version = "0.18.1", path = "../light-client", features = ["lightstore-sled"] }
tendermint-proto = { version = "0.18.1", path = "../proto" }
tendermint-rpc = { version = "0.18.1", path = "../rpc", features = ["http-client"] }
tendermint = { version = "0.19.0", path = "../tendermint" }
tendermint-light-client = { version = "0.19.0", path = "../light-client", features = ["lightstore-sled"] }
tendermint-proto = { version = "0.19.0", path = "../proto" }
tendermint-rpc = { version = "0.19.0", path = "../rpc", features = ["http-client"] }

[dependencies.abscissa_core]
version = "0.5.0"
Expand Down
2 changes: 1 addition & 1 deletion light-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
unused_qualifications
)]
#![doc(
html_root_url = "https://docs.rs/tendermint-light-node/0.18.1",
html_root_url = "https://docs.rs/tendermint-light-node/0.19.0",
html_logo_url = "https://raw.githubusercontent.com/informalsystems/tendermint-rs/master/img/logo-tendermint-rs_3961x4001.png"
)]

Expand Down
6 changes: 3 additions & 3 deletions p2p/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tendermint-p2p"
version = "0.18.1"
version = "0.19.0"
edition = "2018"
license = "Apache-2.0"
repository = "https://github.com/informalsystems/tendermint-rs"
Expand Down Expand Up @@ -31,8 +31,8 @@ x25519-dalek = "1.1"
zeroize = "1"

# path dependencies
tendermint = { path = "../tendermint", version = "0.18.1" }
tendermint-proto = { path = "../proto", version = "0.18.1" }
tendermint = { path = "../tendermint", version = "0.19.0" }
tendermint-proto = { path = "../proto", version = "0.19.0" }

# optional dependencies
prost-amino = { version = "0.6", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion p2p/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
nonstandard_style
)]
#![doc(
html_root_url = "https://docs.rs/tendermint-p2p/0.1.0",
html_root_url = "https://docs.rs/tendermint-p2p/0.19.0",
html_logo_url = "https://raw.githubusercontent.com/informalsystems/tendermint-rs/master/img/logo-tendermint-rs_3961x4001.png"
)]

Expand Down
5 changes: 1 addition & 4 deletions pbt-gen/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tendermint-pbt-gen"
version = "0.1.0"
version = "0.19.0"
authors = ["Shon Feder <shon@informal.systems>"]
edition = "2018"
description = """
Expand All @@ -11,12 +11,9 @@ description = """
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[features]

default = ["time"]

time = ["chrono"]

[dependencies]

chrono = { version = "0.4", features = ["serde"], optional = true}
proptest = "0.10.1"
2 changes: 1 addition & 1 deletion proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tendermint-proto"
version = "0.18.1"
version = "0.19.0"
authors = ["Greg Szabo <greg@informal.systems>"]
edition = "2018"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#![deny(warnings, trivial_casts, trivial_numeric_casts, unused_import_braces)]
#![allow(clippy::large_enum_variant)]
#![forbid(unsafe_code)]
#![doc(html_root_url = "https://docs.rs/tendermint-proto/0.18.1")]
#![doc(html_root_url = "https://docs.rs/tendermint-proto/0.19.0")]

/// Built-in prost_types with slight customization to enable JSON-encoding
#[allow(warnings)]
Expand Down
2 changes: 1 addition & 1 deletion release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set -e
# A space-separated list of all the crates we want to publish, in the order in
# which they must be published. It's important to respect this order, since
# each subsequent crate depends on one or more of the preceding ones.
DEFAULT_CRATES="tendermint-proto tendermint tendermint-rpc tendermint-p2p tendermint-light-client tendermint-light-node tendermint-testgen"
DEFAULT_CRATES="tendermint-proto tendermint tendermint-abci tendermint-rpc tendermint-p2p tendermint-light-client tendermint-light-client-js tendermint-light-node tendermint-testgen"

# Allows us to override the crates we want to publish.
CRATES=${*:-${DEFAULT_CRATES}}
Expand Down
9 changes: 3 additions & 6 deletions rpc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tendermint-rpc"
version = "0.18.1"
version = "0.19.0"
edition = "2018"
license = "Apache-2.0"
homepage = "https://www.tendermint.com/"
Expand Down Expand Up @@ -64,15 +64,12 @@ websocket-client = [
bytes = "1.0"
chrono = "0.4"
getrandom = "0.1"
# TODO(thane): Use a released version once support for inverted patterns is released.
# See https://github.com/kevinmehall/rust-peg/pull/245
peg = { git = "https://github.com/kevinmehall/rust-peg.git", rev = "ba6019539b2cf80289190cbb9537c94113b6b7d1" }
pin-project = "1.0.1"
serde = { version = "1", features = [ "derive" ] }
serde_bytes = "0.11"
serde_json = "1"
tendermint = { version = "0.18.1", path = "../tendermint" }
tendermint-proto = { version = "0.18.1", path = "../proto" }
tendermint = { version = "0.19.0", path = "../tendermint" }
tendermint-proto = { version = "0.19.0", path = "../proto" }
thiserror = "1"
uuid = { version = "0.8", default-features = false }
subtle-encoding = { version = "0.5", features = ["bech32-preview"] }
Expand Down
28 changes: 28 additions & 0 deletions rpc/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ pub use transport::websocket::{WebSocketClient, WebSocketClientDriver, WebSocket

use crate::endpoint::validators::DEFAULT_VALIDATORS_PER_PAGE;
use crate::endpoint::*;
use crate::error::Error;
use crate::paging::Paging;
use crate::query::Query;
use crate::{Order, Result, SimpleRequest};
use async_trait::async_trait;
use std::time::Duration;
use tendermint::abci::{self, Transaction};
use tendermint::block::Height;
use tendermint::evidence::Evidence;
use tendermint::Genesis;
use tokio::time;

/// Provides lightweight access to the Tendermint RPC. It gives access to all
/// endpoints with the exception of the event subscription-related ones.
Expand Down Expand Up @@ -221,6 +224,31 @@ pub trait Client {
.await
}

/// Poll the `/health` endpoint until it returns a successful result or
/// the given `timeout` has elapsed.
async fn wait_until_healthy<T>(&self, timeout: T) -> Result<()>
where
T: Into<Duration> + Send,
{
let timeout = timeout.into();
let poll_interval = Duration::from_millis(200);
let mut attempts_remaining = timeout.as_millis() / poll_interval.as_millis();

while self.health().await.is_err() {
if attempts_remaining == 0 {
return Err(Error::client_internal_error(format!(
"timed out waiting for healthy response after {}ms",
timeout.as_millis()
)));
}

attempts_remaining -= 1;
time::sleep(poll_interval).await;
}

Ok(())
}

/// Perform a request against the RPC endpoint
async fn perform<R>(&self, request: R) -> Result<R::Response>
where
Expand Down
Loading