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

Update to official Prost v0.9 #1011

Merged
merged 5 commits into from
Oct 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/unreleased/breaking-changes/925-upgrade-prost.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- 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))
2 changes: 1 addition & 1 deletion abci/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ std = [

[dependencies]
bytes = { version = "1.0", default-features = false }
prost = { package = "informalsystems-prost", version = "0.8.1", default-features = false }
prost = { version = "0.9", default-features = false }
tendermint-proto = { version = "0.23.0-internal", default-features = false, path = "../proto" }
tracing = { version = "0.1", default-features = false }
flex-error = { version = "0.4.3", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ eyre = { version = "0.6", default-features = false }
flume = { version = "0.10.7", default-features = false }
hkdf = { version = "0.10.0", default-features = false }
merlin = { version = "2", default-features = false }
prost = { package = "informalsystems-prost", version = "0.8.1", default-features = false }
prost = { version = "0.9", default-features = false }
rand_core = { version = "0.5", default-features = false, features = ["std"] }
sha2 = { version = "0.9", default-features = false }
subtle = { version = "2", default-features = false }
Expand All @@ -53,4 +53,4 @@ tendermint-proto = { path = "../proto", version = "0.23.0-internal" }
tendermint-std-ext = { path = "../std-ext", version = "0.23.0-internal" }

# optional dependencies
prost-derive = { package = "informalsystems-prost-derive", version = "0.8.1", optional = true }
prost-derive = { version = "0.9", optional = true }
4 changes: 2 additions & 2 deletions proto/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ description = """
all-features = true

[dependencies]
prost = { package = "informalsystems-prost", version = "0.8.1", default-features = false }
prost-types = { package = "informalsystems-prost-types", version = "0.8.1", default-features = false }
prost = { version = "0.9", default-features = false }
prost-types = { version = "0.9", default-features = false }
bytes = { version = "1.0", default-features = false }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde_bytes = { version = "0.11", default-features = false, features = ["alloc"] }
Expand Down
2 changes: 1 addition & 1 deletion proto/src/prost/google.protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ pub struct MethodDescriptorProto {
// extension number. You can declare multiple options with only one extension
// number by putting them in a sub-message. See the Custom Options section of
// the docs for examples:
// https://developers.google.com/protocol-buffers/docs/proto#options
// <https://developers.google.com/protocol-buffers/docs/proto#options>
// If this turns out to be popular, a web service will be set up
// to automatically assign option numbers.

Expand Down
8 changes: 4 additions & 4 deletions proto/src/prost/tendermint.abci.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file is copied from http://github.com/tendermint/abci
// This file is copied from <http://github.com/tendermint/abci>
// NOTE: When using custom types, mind the warnings.
// https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues
// <https://github.com/gogo/protobuf/blob/master/custom_types.md#warnings-and-issues>

//----------------------------------------
// Request types
Expand Down Expand Up @@ -490,7 +490,7 @@ pub struct Validator {
/// The first 20 bytes of SHA256(public key)
#[prost(bytes="vec", tag="1")]
pub address: ::prost::alloc::vec::Vec<u8>,
/// PubKey pub_key = 2 [(gogoproto.nullable)=false];
/// PubKey pub_key = 2 \[(gogoproto.nullable)=false\];
///
/// The voting power
#[prost(int64, tag="3")]
Expand Down Expand Up @@ -527,7 +527,7 @@ pub struct Evidence {
pub time: ::core::option::Option<super::super::google::protobuf::Timestamp>,
/// Total voting power of the validator set in case the ABCI application does
/// not store historical validators.
/// https://github.com/tendermint/tendermint/issues/4581
/// <https://github.com/tendermint/tendermint/issues/4581>
#[prost(int64, tag="5")]
pub total_voting_power: i64,
}
Expand Down
2 changes: 1 addition & 1 deletion proto/src/prost/tendermint.types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ pub struct EvidenceParams {
///
/// It should correspond with an app's "unbonding period" or other similar
/// mechanism for handling [Nothing-At-Stake
/// attacks](https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed).
/// attacks](<https://github.com/ethereum/wiki/wiki/Proof-of-Stake-FAQ#what-is-the-nothing-at-stake-problem-and-how-can-it-be-fixed>).
#[prost(message, optional, tag="2")]
pub max_age_duration: ::core::option::Option<super::super::google::protobuf::Duration>,
/// This sets the maximum size of total evidence in bytes that can be committed in a single block.
Expand Down
4 changes: 2 additions & 2 deletions tendermint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ ed25519-dalek = { version = "1", default-features = false, features = ["u64_back
futures = { version = "0.3", default-features = false }
num-traits = { version = "0.2", default-features = false }
once_cell = { version = "1.3", default-features = false }
prost = { package = "informalsystems-prost", version = "0.8.1", default-features = false }
prost-types = { package = "informalsystems-prost-types", version = "0.8.1", default-features = false }
prost = { version = "0.9", default-features = false }
prost-types = { version = "0.9", default-features = false }
serde = { version = "1", default-features = false, features = ["derive"] }
serde_json = { version = "1", default-features = false, features = ["alloc"] }
serde_bytes = { version = "0.11", default-features = false }
Expand Down
4 changes: 1 addition & 3 deletions testgen/src/tester.rs
Original file line number Diff line number Diff line change
Expand Up @@ -460,9 +460,7 @@ impl Tester {
let path = format!("{}", entry.path().display());
let rel_path = self.env().unwrap().rel_path(&path).unwrap();
if kind.is_file() || kind.is_symlink() {
if !rel_path.ends_with(".json") {
return;
} else {
if rel_path.ends_with(".json") {
self.run_for_file(&rel_path);
}
} else if kind.is_dir() {
Expand Down
2 changes: 1 addition & 1 deletion tools/proto-compiler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ publish = false

[dependencies]
walkdir = { version = "2.3" }
prost-build = { version = "0.7" }
prost-build = { version = "0.9" }
git2 = { version = "0.13" }
tempfile = { version = "3.2.0" }
subtle-encoding = { version = "0.5" }