Skip to content

Commit

Permalink
Update prost and prost-types to version 0.8 (#926)
Browse files Browse the repository at this point in the history
* Update prost to 0.8

* Update `tendermint::time::Time`'s `TryFrom<prost_types::Timestamp>` instance

* Add changelog entry
  • Loading branch information
romac authored Jul 9, 2021
1 parent 7b84781 commit 1efe42c
Show file tree
Hide file tree
Showing 10 changed files with 151 additions and 146 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* `[tendermint]` Fix potential panic on `SystemTime` conversion by upgrading `prost` and `prost-types` to version 0.8.0
([#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 @@ -29,7 +29,7 @@ binary = [ "structopt", "tracing-subscriber" ]
[dependencies]
bytes = "1.0"
eyre = "0.6"
prost = "0.7"
prost = "0.8"
tendermint-proto = { version = "0.20.0", path = "../proto" }
thiserror = "1.0"
tracing = "0.1"
Expand Down
2 changes: 1 addition & 1 deletion p2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ eyre = "0.6"
flume = "0.10.7"
hkdf = "0.10.0"
merlin = "2"
prost = "0.7"
prost = "0.8"
rand_core = { version = "0.5", features = ["std"] }
sha2 = "0.9"
subtle = "2"
Expand Down
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 = "0.7"
prost-types = "0.7"
prost = "0.8"
prost-types = "0.8"
bytes = "1.0"
anomaly = "0.2"
thiserror = "1.0"
Expand Down
42 changes: 21 additions & 21 deletions proto/src/prost/tendermint.crypto.rs
Original file line number Diff line number Diff line change
@@ -1,24 +1,3 @@
/// PublicKey defines the keys available for use with Tendermint Validators
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PublicKey {
#[prost(oneof="public_key::Sum", tags="1, 2")]
pub sum: ::core::option::Option<public_key::Sum>,
}
/// Nested message and enum types in `PublicKey`.
pub mod public_key {
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[serde(tag = "type", content = "value")]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Sum {
#[prost(bytes, tag="1")]
#[serde(rename = "tendermint/PubKeyEd25519", with = "crate::serializers::bytes::base64string")]
Ed25519(::prost::alloc::vec::Vec<u8>),
#[prost(bytes, tag="2")]
#[serde(rename = "tendermint/PubKeySecp256k1", with = "crate::serializers::bytes::base64string")]
Secp256k1(::prost::alloc::vec::Vec<u8>),
}
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Proof {
Expand Down Expand Up @@ -71,3 +50,24 @@ pub struct ProofOps {
#[prost(message, repeated, tag="1")]
pub ops: ::prost::alloc::vec::Vec<ProofOp>,
}
/// PublicKey defines the keys available for use with Tendermint Validators
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PublicKey {
#[prost(oneof="public_key::Sum", tags="1, 2")]
pub sum: ::core::option::Option<public_key::Sum>,
}
/// Nested message and enum types in `PublicKey`.
pub mod public_key {
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[serde(tag = "type", content = "value")]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Sum {
#[prost(bytes, tag="1")]
#[serde(rename = "tendermint/PubKeyEd25519", with = "crate::serializers::bytes::base64string")]
Ed25519(::prost::alloc::vec::Vec<u8>),
#[prost(bytes, tag="2")]
#[serde(rename = "tendermint/PubKeySecp256k1", with = "crate::serializers::bytes::base64string")]
Secp256k1(::prost::alloc::vec::Vec<u8>),
}
}
46 changes: 23 additions & 23 deletions proto/src/prost/tendermint.p2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,29 +43,6 @@ pub struct DefaultNodeInfoOther {
pub rpc_address: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PexRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PexAddrs {
#[prost(message, repeated, tag="1")]
pub addrs: ::prost::alloc::vec::Vec<NetAddress>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Message {
#[prost(oneof="message::Sum", tags="1, 2")]
pub sum: ::core::option::Option<message::Sum>,
}
/// Nested message and enum types in `Message`.
pub mod message {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Sum {
#[prost(message, tag="1")]
PexRequest(super::PexRequest),
#[prost(message, tag="2")]
PexAddrs(super::PexAddrs),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PacketPing {
}
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down Expand Up @@ -104,3 +81,26 @@ pub struct AuthSigMessage {
#[prost(bytes="vec", tag="2")]
pub sig: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PexRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PexAddrs {
#[prost(message, repeated, tag="1")]
pub addrs: ::prost::alloc::vec::Vec<NetAddress>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Message {
#[prost(oneof="message::Sum", tags="1, 2")]
pub sum: ::core::option::Option<message::Sum>,
}
/// Nested message and enum types in `Message`.
pub mod message {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Sum {
#[prost(message, tag="1")]
PexRequest(super::PexRequest),
#[prost(message, tag="2")]
PexAddrs(super::PexAddrs),
}
}
112 changes: 56 additions & 56 deletions proto/src/prost/tendermint.types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -276,62 +276,6 @@ pub enum SignedMsgType {
/// Proposals
Proposal = 32,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CanonicalBlockId {
#[prost(bytes="vec", tag="1")]
pub hash: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag="2")]
#[serde(alias = "parts")]
pub part_set_header: ::core::option::Option<CanonicalPartSetHeader>,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CanonicalPartSetHeader {
#[prost(uint32, tag="1")]
pub total: u32,
#[prost(bytes="vec", tag="2")]
pub hash: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CanonicalProposal {
/// type alias for byte
#[prost(enumeration="SignedMsgType", tag="1")]
pub r#type: i32,
/// canonicalization requires fixed size encoding here
#[prost(sfixed64, tag="2")]
pub height: i64,
/// canonicalization requires fixed size encoding here
#[prost(sfixed64, tag="3")]
pub round: i64,
#[prost(int64, tag="4")]
pub pol_round: i64,
#[prost(message, optional, tag="5")]
pub block_id: ::core::option::Option<CanonicalBlockId>,
#[prost(message, optional, tag="6")]
pub timestamp: ::core::option::Option<super::super::google::protobuf::Timestamp>,
#[prost(string, tag="7")]
pub chain_id: ::prost::alloc::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CanonicalVote {
/// type alias for byte
#[prost(enumeration="SignedMsgType", tag="1")]
pub r#type: i32,
/// canonicalization requires fixed size encoding here
#[prost(sfixed64, tag="2")]
pub height: i64,
/// canonicalization requires fixed size encoding here
#[prost(sfixed64, tag="3")]
pub round: i64,
#[prost(message, optional, tag="4")]
pub block_id: ::core::option::Option<CanonicalBlockId>,
#[prost(message, optional, tag="5")]
pub timestamp: ::core::option::Option<super::super::google::protobuf::Timestamp>,
#[prost(string, tag="6")]
pub chain_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventDataRoundState {
#[prost(int64, tag="1")]
Expand Down Expand Up @@ -480,6 +424,62 @@ pub struct EvidenceList {
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CanonicalBlockId {
#[prost(bytes="vec", tag="1")]
pub hash: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag="2")]
#[serde(alias = "parts")]
pub part_set_header: ::core::option::Option<CanonicalPartSetHeader>,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CanonicalPartSetHeader {
#[prost(uint32, tag="1")]
pub total: u32,
#[prost(bytes="vec", tag="2")]
pub hash: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CanonicalProposal {
/// type alias for byte
#[prost(enumeration="SignedMsgType", tag="1")]
pub r#type: i32,
/// canonicalization requires fixed size encoding here
#[prost(sfixed64, tag="2")]
pub height: i64,
/// canonicalization requires fixed size encoding here
#[prost(sfixed64, tag="3")]
pub round: i64,
#[prost(int64, tag="4")]
pub pol_round: i64,
#[prost(message, optional, tag="5")]
pub block_id: ::core::option::Option<CanonicalBlockId>,
#[prost(message, optional, tag="6")]
pub timestamp: ::core::option::Option<super::super::google::protobuf::Timestamp>,
#[prost(string, tag="7")]
pub chain_id: ::prost::alloc::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CanonicalVote {
/// type alias for byte
#[prost(enumeration="SignedMsgType", tag="1")]
pub r#type: i32,
/// canonicalization requires fixed size encoding here
#[prost(sfixed64, tag="2")]
pub height: i64,
/// canonicalization requires fixed size encoding here
#[prost(sfixed64, tag="3")]
pub round: i64,
#[prost(message, optional, tag="4")]
pub block_id: ::core::option::Option<CanonicalBlockId>,
#[prost(message, optional, tag="5")]
pub timestamp: ::core::option::Option<super::super::google::protobuf::Timestamp>,
#[prost(string, tag="6")]
pub chain_id: ::prost::alloc::string::String,
}
#[derive(::serde::Deserialize, ::serde::Serialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Block {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<Header>,
Expand Down
64 changes: 32 additions & 32 deletions proto/src/tendermint.rs
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
//! Tendermint-proto auto-generated sub-modules for Tendermint
pub mod consensus {
include!("prost/tendermint.consensus.rs");
pub mod statesync {
include!("prost/tendermint.statesync.rs");
}

pub mod types {
include!("prost/tendermint.types.rs");
pub mod abci {
include!("prost/tendermint.abci.rs");
}

pub mod mempool {
include!("prost/tendermint.mempool.rs");
pub mod store {
include!("prost/tendermint.store.rs");
}

pub mod rpc {
pub mod grpc {
include!("prost/tendermint.rpc.grpc.rs");
}
pub mod version {
include!("prost/tendermint.version.rs");
}

pub mod blockchain {
include!("prost/tendermint.blockchain.rs");
pub mod types {
include!("prost/tendermint.types.rs");
}

pub mod libs {
pub mod bits {
include!("prost/tendermint.libs.bits.rs");
}
pub mod consensus {
include!("prost/tendermint.consensus.rs");
}

pub mod state {
include!("prost/tendermint.state.rs");
pub mod p2p {
include!("prost/tendermint.p2p.rs");
}

pub mod version {
include!("prost/tendermint.version.rs");
pub mod privval {
include!("prost/tendermint.privval.rs");
}

pub mod store {
include!("prost/tendermint.store.rs");
pub mod blockchain {
include!("prost/tendermint.blockchain.rs");
}

pub mod privval {
include!("prost/tendermint.privval.rs");
pub mod crypto {
include!("prost/tendermint.crypto.rs");
}

pub mod statesync {
include!("prost/tendermint.statesync.rs");
pub mod mempool {
include!("prost/tendermint.mempool.rs");
}

pub mod p2p {
include!("prost/tendermint.p2p.rs");
pub mod state {
include!("prost/tendermint.state.rs");
}

pub mod abci {
include!("prost/tendermint.abci.rs");
pub mod libs {
pub mod bits {
include!("prost/tendermint.libs.bits.rs");
}
}

pub mod crypto {
include!("prost/tendermint.crypto.rs");
pub mod rpc {
pub mod grpc {
include!("prost/tendermint.rpc.grpc.rs");
}
}

pub mod meta {
Expand Down
4 changes: 2 additions & 2 deletions tendermint/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ ed25519-dalek = { version = "1", features = ["serde"] }
futures = "0.3"
num-traits = "0.2"
once_cell = "1.3"
prost = "0.7"
prost-types = "0.7"
prost = "0.8"
prost-types = "0.8"
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_bytes = "0.11"
Expand Down
Loading

0 comments on commit 1efe42c

Please sign in to comment.