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

chore: update crate dependencies #509

Merged
merged 5 commits into from
Sep 5, 2024
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ miden-tx = { version = "0.5", default-features = false }
rand = { version = "0.8" }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["raw_value"] }
tokio = { version = "1.38", features = ["rt-multi-thread", "net", "macros"] }
tokio = { version = "1.40", features = ["rt-multi-thread", "net", "macros"] }
tracing = { version = "0.1" }
4 changes: 2 additions & 2 deletions bin/miden-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ required-features = ["testing", "concurrent"]

[dev-dependencies]
assert_cmd = { version = "2.0" }
uuid = { version = "1.6", features = ["serde", "v4"] }
uuid = { version = "1.10", features = ["serde", "v4"] }

[dependencies]
clap = { version = "4.5", features = ["derive"] }
Expand All @@ -39,7 +39,7 @@ rand = { workspace = true }
serde = { version = "1.0", features = ["derive"] }
serde_json = { version = "1.0", features = ["raw_value"] }
tokio = { workspace = true }
tonic = { version = "0.11" }
tonic = { version = "0.12" }
toml = { version = "0.8" }
tracing = { workspace = true }
tracing-subscriber = { version = "0.3" }
24 changes: 11 additions & 13 deletions crates/rust-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async = ["miden-tx/async"]
concurrent = ["miden-lib/concurrent", "miden-objects/concurrent", "miden-tx/concurrent", "std"]
default = ["std"]
idxdb = ["async", "dep:base64", "dep:serde-wasm-bindgen", "dep:wasm-bindgen", "dep:wasm-bindgen-futures"]
sqlite = ["dep:rusqlite", "dep:rusqlite_migration", "dep:lazy_static", "std"]
sqlite = ["dep:rusqlite", "std"]
std = ["miden-objects/std"]
testing = ["miden-objects/testing", "miden-lib/testing"]
tonic = ["dep:hex", "dep:prost", "dep:tonic", "std", "tonic/transport"]
Expand All @@ -31,21 +31,19 @@ base64 = { version = "0.22", optional = true }
chrono = { version = "0.4", optional = false }
getrandom = { version = "0.2", features = ["js"], optional = true }
hex = { version = "0.4" , optional = true}
lazy_static = { version = "1.5", optional = true }
miden-lib = { workspace = true }
miden-objects = { workspace = true }
miden-tx = { workspace = true }
prost = { version = "0.12", optional = true, default-features = false, features = ["derive"] }
prost = { version = "0.13", optional = true, default-features = false, features = ["derive"] }
rand = { workspace = true }
rusqlite = { version = "0.31", features = ["vtab", "array", "bundled"], optional = true }
rusqlite_migration = { version = "1.0", optional = true }
rusqlite = { version = "0.32", features = ["vtab", "array", "bundled"], optional = true }
serde = { workspace = true }
serde_json = { workspace = true }
serde-wasm-bindgen = { version = "0.6", optional = true }
thiserror = { version = "1.0", optional = true }
tokio = { workspace = true , optional = true }
tonic = { version = "0.11", default-features = false, optional = true, features = ["prost", "codegen"] }
tonic-web-wasm-client = { version = "0.5", optional = true, default-features = false }
tonic = { version = "0.12", default-features = false, optional = true, features = ["prost", "codegen"] }
tonic-web-wasm-client = { version = "0.6", optional = true, default-features = false }
tracing = { workspace = true }
wasm-bindgen = { version = "0.2", features = ["serde-serialize"], optional = true }
wasm-bindgen-futures = { version = "0.4", optional = true }
Expand All @@ -55,12 +53,12 @@ winter-maybe-async = "0.10"
miden-client = { path = ".", features = ["testing", "concurrent", "sqlite", "tonic", "tokio"]}
miden-lib = { workspace = true, features = ["testing"] }
miden-objects = { workspace = true, default-features = false, features = ["serde", "testing"] }
uuid = { version = "1.9", features = ["serde", "v4"] }
uuid = { version = "1.10", features = ["serde", "v4"] }

[build-dependencies]
miden-rpc-proto = { version = "0.5" }
miden-rpc-proto = { git = "https://github.com/0xPolygonMiden/miden-node", branch = "next" }
miette = { version = "7.2", features = ["fancy"] }
prost = { version = "0.12", default-features = false, features = ["derive"] }
prost-build = { version = "0.12", default-features = false }
protox = { version = "0.6" }
tonic-build = { version = "0.11" }
prost = { version = "0.13", default-features = false, features = ["derive"] }
prost-build = { version = "0.13", default-features = false }
protox = { version = "0.7" }
tonic-build = { version = "0.12" }
4 changes: 3 additions & 1 deletion crates/rust-client/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ fn compile_tonic_client_proto(proto_dir: &Path) -> miette::Result<()> {
fn replace_no_std_types() {
let path = WEB_TONIC_CLIENT_PROTO_OUT_DIR.to_string() + "/rpc.rs";
let file_str = fs::read_to_string(&path).unwrap();
let new_file_str = file_str.replace("std::result", "core::result");
let new_file_str = file_str
.replace("std::result", "core::result")
.replace("std::marker", "core::marker");

let mut f = std::fs::OpenOptions::new().write(true).open(path).unwrap();
f.write_all(new_file_str.as_bytes()).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion crates/rust-client/src/rpc/domain/blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl TryFrom<&block::BlockHeader> for BlockHeader {
type Error = RpcConversionError;

fn try_from(value: &block::BlockHeader) -> Result<Self, Self::Error> {
value.clone().try_into()
(*value).try_into()
}
}

Expand Down
4 changes: 2 additions & 2 deletions crates/rust-client/src/rpc/domain/digest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,14 +127,14 @@ impl TryFrom<&digest::Digest> for [Felt; 4] {
type Error = RpcConversionError;

fn try_from(value: &digest::Digest) -> Result<Self, Self::Error> {
value.clone().try_into()
(*value).try_into()
}
}

impl TryFrom<&digest::Digest> for Digest {
type Error = RpcConversionError;

fn try_from(value: &digest::Digest) -> Result<Self, Self::Error> {
value.clone().try_into()
(*value).try_into()
}
}
7 changes: 2 additions & 5 deletions crates/rust-client/src/rpc/tonic_client/generated/account.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[prost(skip_debug)]
pub struct AccountId {
/// A miden account is defined with a little bit of proof-of-work, the id itself is defined as
Expand All @@ -9,8 +8,7 @@ pub struct AccountId {
#[prost(fixed64, tag = "1")]
pub id: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct AccountSummary {
#[prost(message, optional, tag = "1")]
pub account_id: ::core::option::Option<AccountId>,
Expand All @@ -19,7 +17,6 @@ pub struct AccountSummary {
#[prost(uint32, tag = "3")]
pub block_num: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountInfo {
#[prost(message, optional, tag = "1")]
Expand Down
4 changes: 1 addition & 3 deletions crates/rust-client/src/rpc/tonic_client/generated/block.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct BlockHeader {
/// specifies the version of the protocol.
#[prost(uint32, tag = "1")]
Expand Down Expand Up @@ -33,7 +32,6 @@ pub struct BlockHeader {
#[prost(fixed32, tag = "10")]
pub timestamp: u32,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BlockInclusionProof {
#[prost(message, optional, tag = "1")]
Expand Down
3 changes: 1 addition & 2 deletions crates/rust-client/src/rpc/tonic_client/generated/digest.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file is @generated by prost-build.
/// A hash digest, the result of a hash function.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[prost(skip_debug)]
pub struct Digest {
#[prost(fixed64, tag = "1")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MerklePath {
#[prost(message, repeated, tag = "1")]
Expand Down
1 change: 0 additions & 1 deletion crates/rust-client/src/rpc/tonic_client/generated/mmr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MmrDelta {
#[prost(uint64, tag = "1")]
Expand Down
7 changes: 1 addition & 6 deletions crates/rust-client/src/rpc/tonic_client/generated/note.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct NoteMetadata {
#[prost(message, optional, tag = "1")]
pub sender: ::core::option::Option<super::account::AccountId>,
Expand All @@ -13,7 +12,6 @@ pub struct NoteMetadata {
#[prost(fixed64, tag = "5")]
pub aux: u64,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Note {
#[prost(fixed32, tag = "1")]
Expand All @@ -31,7 +29,6 @@ pub struct Note {
#[prost(bytes = "vec", optional, tag = "6")]
pub details: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NoteInclusionInBlockProof {
#[prost(message, optional, tag = "1")]
Expand All @@ -43,7 +40,6 @@ pub struct NoteInclusionInBlockProof {
#[prost(message, optional, tag = "4")]
pub merkle_path: ::core::option::Option<super::merkle::MerklePath>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NoteSyncRecord {
#[prost(uint32, tag = "1")]
Expand All @@ -55,7 +51,6 @@ pub struct NoteSyncRecord {
#[prost(message, optional, tag = "4")]
pub merkle_path: ::core::option::Option<super::merkle::MerklePath>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NoteAuthenticationInfo {
/// Proof of each note's inclusion in a block.
Expand Down
31 changes: 7 additions & 24 deletions crates/rust-client/src/rpc/tonic_client/generated/requests.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
// This file is @generated by prost-build.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ApplyBlockRequest {
#[prost(bytes = "vec", tag = "1")]
pub block: ::prost::alloc::vec::Vec<u8>,
}
/// Returns a list of nullifiers that match the specified prefixes and are recorded in the node.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckNullifiersByPrefixRequest {
/// Number of bits used for nullifier prefix. Currently the only supported value is 16.
Expand All @@ -17,7 +15,6 @@ pub struct CheckNullifiersByPrefixRequest {
#[prost(uint32, repeated, tag = "2")]
pub nullifiers: ::prost::alloc::vec::Vec<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CheckNullifiersRequest {
#[prost(message, repeated, tag = "1")]
Expand All @@ -27,8 +24,7 @@ pub struct CheckNullifiersRequest {
/// path and current forest which validate the block's inclusion in the chain.
///
/// The Merkle path is an MMR proof for the block's leaf, based on the current chain length.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetBlockHeaderByNumberRequest {
/// The block number of the target block.
///
Expand All @@ -44,7 +40,6 @@ pub struct GetBlockHeaderByNumberRequest {
/// Specifies state updates the client is intersted in. The server will return the first block which
/// contains a note matching `note_tags` or the chain tip. And the corresponding updates to
/// `nullifiers` and `account_ids` for that block range.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SyncStateRequest {
/// Last block known by the client. The response will contain data starting from the next block,
Expand All @@ -71,7 +66,6 @@ pub struct SyncStateRequest {
///
/// Specifies note tags that client is intersted in. The server will return the first block which
/// contains a note matching `note_tags` or the chain tip.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SyncNoteRequest {
/// Last block known by the client. The response will contain data starting from the next block,
Expand All @@ -82,7 +76,6 @@ pub struct SyncNoteRequest {
#[prost(fixed32, repeated, tag = "2")]
pub note_tags: ::prost::alloc::vec::Vec<u32>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBlockInputsRequest {
/// ID of the account against which a transaction is executed.
Expand All @@ -95,7 +88,6 @@ pub struct GetBlockInputsRequest {
#[prost(message, repeated, tag = "3")]
pub unauthenticated_notes: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTransactionInputsRequest {
#[prost(message, optional, tag = "1")]
Expand All @@ -105,55 +97,46 @@ pub struct GetTransactionInputsRequest {
#[prost(message, repeated, tag = "3")]
pub unauthenticated_notes: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SubmitProvenTransactionRequest {
/// Transaction encoded using miden's native format
#[prost(bytes = "vec", tag = "1")]
pub transaction: ::prost::alloc::vec::Vec<u8>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNotesByIdRequest {
/// List of NoteId's to be queried from the database
#[prost(message, repeated, tag = "1")]
pub note_ids: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNoteAuthenticationInfoRequest {
/// List of NoteId's to be queried from the database
#[prost(message, repeated, tag = "1")]
pub note_ids: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ListNullifiersRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ListAccountsRequest {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ListNotesRequest {}
/// Returns the latest state of an account with the specified ID.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetAccountDetailsRequest {
/// Account ID to get details.
#[prost(message, optional, tag = "1")]
pub account_id: ::core::option::Option<super::account::AccountId>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetBlockByNumberRequest {
/// The block number of the target block.
#[prost(fixed32, tag = "1")]
pub block_num: u32,
}
/// Returns delta of the account states in the range from `from_block_num` (exclusive) to
/// `to_block_num` (inclusive).
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetAccountStateDeltaRequest {
/// ID of the account for which the delta is requested.
#[prost(message, optional, tag = "1")]
Expand Down
Loading