Skip to content

Commit

Permalink
tonic update (#78)
Browse files Browse the repository at this point in the history
* Update prost
* Update proto-version
* Fix workspace resolver
* Stop using deprecated secp256k1 method
* Update tonic and prost in conformance-sdk
* Fix buf dependency
* Use latest tokio in conformance-sdk
  • Loading branch information
richardpringle authored Oct 20, 2023
1 parent b97d4f6 commit b1202c1
Show file tree
Hide file tree
Showing 20 changed files with 2,823 additions and 2,727 deletions.
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ members = [
]
# by default, only document and build key library crates
default-members = ["crates/avalanche-types", "crates/avalanche-consensus"]

workspace.resolver = "2"
resolver = "2"

[workspace.package]
version = "0.1.1"
Expand Down
8 changes: 4 additions & 4 deletions avalanchego-conformance-sdk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ repository = "https://github.com/ava-labs/avalanchego-conformance-sdk"

[dependencies]
log = "0.4.20"
prost = "0.11.9"
tokio = { version = "1.32.0", features = ["fs", "rt-multi-thread"] } # https://github.com/tokio-rs/tokio/releases
prost = "0.12.1"
tokio = { version = "1.33.0", features = ["fs", "rt-multi-thread", "macros"] }
tokio-stream = { version = "0.1.14", features = ["net"] }
tonic = "0.9.2"
tonic = "0.10.2"

[build-dependencies]
# ref. https://github.com/hyperium/tonic/tags
# ref. https://github.com/hyperium/tonic/tree/master/tonic-build
tonic-build = "0.9.2"
tonic-build = "0.10.2"

[dev-dependencies]
env_logger = "0.10.0"
3 changes: 2 additions & 1 deletion avalanchego-conformance/buf.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ deps:
- remote: buf.build
owner: googleapis
repository: googleapis
commit: f3590c56d388417ebbedefae77ac12bf
commit: 28151c0d0a1641bf938a7672c500e01d
digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de
8 changes: 4 additions & 4 deletions crates/avalanche-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ jsonrpc-core = { version = "18.0.0", optional = true }
jsonrpc-http-server = { version = "18.0.0", optional = true }
num-derive = { version = "0.3.3", optional = true }
num-traits = { version = "0.2.15", optional = true }
prost = { version = "0.11.9", optional = true } # prost-build requires "cmake", https://github.com/tokio-rs/prost/releases
prost = { version = "0.12.1", optional = true } # prost-build requires "cmake", https://github.com/tokio-rs/prost/releases
semver = { version = "1.0.17", optional = true }
tokio-stream = { version = "0.1.14", features = ["net"], optional = true }
tonic = { version = "0.9.2", features = ["gzip"], optional = true } # https://github.com/hyperium/tonic/tags
tonic-health = { version = "0.9.2", optional = true } # https://github.com/hyperium/tonic/blob/v0.9.0/tonic-health/src/lib.rs
tonic-reflection = { version = "0.9.2", optional = true }
tonic = { version = "0.10.2", features = ["gzip"], optional = true } # https://github.com/hyperium/tonic/tags
tonic-health = { version = "0.10.2", optional = true } # https://github.com/hyperium/tonic/blob/v0.9.0/tonic-health/src/lib.rs
tonic-reflection = { version = "0.10.2", optional = true }
tower-service = { version = "0.3.2", optional = true }

# [OPTIONAL] for "subnet_metrics"
Expand Down
2 changes: 1 addition & 1 deletion crates/avalanche-types/scripts/protobuf_codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# protocol version is the version of the gRPC proto definitions
# as defined by the avalanchego rpcchainvm.
# ref. https://github.com/ava-labs/avalanchego/blob/v1.9.11/version/constants.go#L15-L17
PROTOCOL_VERSION='28'
PROTOCOL_VERSION='29'

if ! [[ "$0" =~ scripts/protobuf_codegen.sh ]]; then
echo "must be run from repository root"
Expand Down
2 changes: 1 addition & 1 deletion crates/avalanche-types/src/key/secp256k1/libsecp256k1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ impl PrivateKey {
assert_eq!(digest.len(), hash::SHA256_OUTPUT_LEN);

let secp = libsecp256k1::Secp256k1::new();
let m = libsecp256k1::Message::from_slice(digest).map_err(|e| Error::Other {
let m = libsecp256k1::Message::from_digest_slice(digest).map_err(|e| Error::Other {
message: format!("failed libsecp256k1::Message::from_slice {}", e),
retryable: false,
})?;
Expand Down
1 change: 1 addition & 0 deletions crates/avalanche-types/src/message/chits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ impl Default for Message {
request_id: 0,
preferred_id: Bytes::new(),
accepted_id: Bytes::new(),
preferred_id_at_height: Bytes::new(),
},
gzip_compress: false,
}
Expand Down
1 change: 1 addition & 0 deletions crates/avalanche-types/src/message/pull_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ impl Default for Message {
deadline: 0,
container_id: prost::bytes::Bytes::new(),
engine_type: p2p::EngineType::Unspecified.into(),
requested_height: 0,
},
gzip_compress: false,
}
Expand Down
1 change: 1 addition & 0 deletions crates/avalanche-types/src/message/push_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ impl Default for Message {
deadline: 0,
container: prost::bytes::Bytes::new(),
engine_type: p2p::EngineType::Unspecified.into(),
requested_height: 0,
},
gzip_compress: false,
}
Expand Down
10 changes: 5 additions & 5 deletions crates/avalanche-types/src/proto/pb/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Message {
#[prost(oneof = "message::Message", tags = "1")]
#[prost(oneof="message::Message", tags="1")]
pub message: ::core::option::Option<message::Message>,
}
/// Nested message and enum types in `Message`.
pub mod message {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Message {
#[prost(message, tag = "1")]
#[prost(message, tag="1")]
Tx(super::Tx),
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Tx {
/// The byte representation of this transaction.
#[prost(bytes = "bytes", tag = "1")]
#[prost(bytes="bytes", tag="1")]
pub tx: ::prost::bytes::Bytes,
}
/// Encoded file descriptor set for the `message` package
Expand Down Expand Up @@ -53,4 +53,4 @@ pub const FILE_DESCRIPTOR_SET: &[u8] = &[
0x05, 0x04, 0x01, 0x02, 0x00, 0x03, 0x12, 0x03, 0x0e, 0x0d, 0x0e, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
];
// @@protoc_insertion_point(module)
// @@protoc_insertion_point(module)
5 changes: 5 additions & 0 deletions crates/avalanche-types/src/proto/pb/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,11 @@ pub mod rpcdb {
include!("rpcdb.rs");
// @@protoc_insertion_point(rpcdb)
}
// @@protoc_insertion_point(attribute:sdk)
pub mod sdk {
include!("sdk.rs");
// @@protoc_insertion_point(sdk)
}
// @@protoc_insertion_point(attribute:sharedmemory)
pub mod sharedmemory {
include!("sharedmemory.rs");
Expand Down
Loading

0 comments on commit b1202c1

Please sign in to comment.