Skip to content

Commit

Permalink
chore: Use upstream next
Browse files Browse the repository at this point in the history
  • Loading branch information
igamigo committed Feb 12, 2025
1 parent f4d3688 commit a6e3041
Show file tree
Hide file tree
Showing 15 changed files with 85 additions and 69 deletions.
25 changes: 10 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ repository = "https://github.com/0xPolygonMiden/miden-client"

[workspace.dependencies]
async-trait = "0.1"
miden-lib = { version = "0.7", default-features = false }
miden-objects = { version = "0.7", default-features = false }
miden-tx = { version = "0.7", default-features = false, features = ["async"] }
miden-proving-service-client = { version = "0.7", default-features = false, features = ["tx-prover"] }
miden-lib = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next", default-features = false }
miden-objects = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next", default-features = false }
miden-tx = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next", default-features = false, features = ["async"] }
miden-proving-service-client = { git = "https://github.com/0xPolygonMiden/miden-base", branch = "next", default-features = false, features = ["tx-prover"] }
miette = { version = "7.2", features = ["fancy"] }
rand = { version = "0.8" }
serde = { version = "1.0", features = ["derive"] }
Expand Down
4 changes: 2 additions & 2 deletions bin/miden-cli/src/commands/export.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::{fs::File, io::Write, path::PathBuf};

use miden_client::{
account::AccountData, crypto::FeltRng, store::NoteExportType, utils::Serializable, Client,
account::AccountFile, crypto::FeltRng, store::NoteExportType, utils::Serializable, Client,
};
use tracing::info;

Expand Down Expand Up @@ -84,7 +84,7 @@ async fn export_account<R: FeltRng>(
.await?
.ok_or(CliError::Export(format!("Account with ID {account_id} not found")))?;

let account_data = AccountData::new(account.into(), account_seed, auth);
let account_data = AccountFile::new(account.into(), account_seed, auth);

let file_path = if let Some(filename) = filename {
filename
Expand Down
4 changes: 2 additions & 2 deletions bin/miden-cli/src/commands/import.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{
};

use miden_client::{
account::{AccountData, AccountId},
account::{AccountFile, AccountId},
crypto::FeltRng,
note::NoteFile,
utils::Deserializable,
Expand Down Expand Up @@ -68,7 +68,7 @@ async fn import_account(
account_data_file_contents: &[u8],
overwrite: bool,
) -> Result<AccountId, CliError> {
let account_data = AccountData::read_from_bytes(account_data_file_contents)
let account_data = AccountFile::read_from_bytes(account_data_file_contents)
.map_err(ClientError::DataDeserializationError)?;
let account_id = account_data.account.id();

Expand Down
2 changes: 1 addition & 1 deletion bin/miden-cli/src/commands/new_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use miden_client::{
},
Client,
};
use miden_proving_service_client::RemoteTransactionProver;
use miden_proving_service_client::tx_prover::RemoteTransactionProver;
use tracing::info;

use crate::{
Expand Down
2 changes: 1 addition & 1 deletion crates/rust-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ uuid = { version = "1.10", features = ["serde", "v4"] }
web-sys = { version = "0.3", features = ["console"]}

[build-dependencies]
miden-rpc-proto = { version = "0.7" }
miden-rpc-proto = { git = "https://github.com/0xPolygonMiden/miden-node", branch = "next" }
miden-lib = { workspace = true }
miette = { workspace = true }
prost = { version = "0.13", default-features = false, features = ["derive"] }
Expand Down
10 changes: 5 additions & 5 deletions crates/rust-client/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
use alloc::vec::Vec;

pub use miden_objects::account::{
Account, AccountBuilder, AccountCode, AccountData, AccountHeader, AccountId, AccountStorage,
Account, AccountBuilder, AccountCode, AccountFile, AccountHeader, AccountId, AccountStorage,
AccountStorageMode, AccountType, StorageSlot,
};
use miden_objects::{account::AuthSecretKey, crypto::rand::FeltRng, Word};
Expand Down Expand Up @@ -262,7 +262,7 @@ pub mod tests {

use miden_lib::transaction::TransactionKernel;
use miden_objects::{
account::{Account, AccountData, AuthSecretKey},
account::{Account, AccountFile, AuthSecretKey},
crypto::dsa::rpo_falcon512::SecretKey,
testing::account_id::{
ACCOUNT_ID_FUNGIBLE_FAUCET_OFF_CHAIN, ACCOUNT_ID_FUNGIBLE_FAUCET_ON_CHAIN,
Expand All @@ -272,18 +272,18 @@ pub mod tests {

use crate::mock::create_test_client;

fn create_account_data(account_id: u128) -> AccountData {
fn create_account_data(account_id: u128) -> AccountFile {
let account =
Account::mock(account_id, Felt::new(2), TransactionKernel::testing_assembler());

AccountData::new(
AccountFile::new(
account.clone(),
Some(Word::default()),
AuthSecretKey::RpoFalcon512(SecretKey::new()),
)
}

pub fn create_initial_accounts_data() -> Vec<AccountData> {
pub fn create_initial_accounts_data() -> Vec<AccountFile> {
let account = create_account_data(ACCOUNT_ID_FUNGIBLE_FAUCET_OFF_CHAIN);

let faucet_account = create_account_data(ACCOUNT_ID_FUNGIBLE_FAUCET_ON_CHAIN);
Expand Down
17 changes: 10 additions & 7 deletions crates/rust-client/src/rpc/generated/nostd/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ pub struct GetBlockInputsRequest {
#[prost(message, repeated, tag = "3")]
pub unauthenticated_notes: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
/// Returns the inputs for a transaction batch.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBatchInputsRequest {
/// List of unauthenticated notes to be queried from the database.
#[prost(message, repeated, tag = "1")]
pub note_ids: ::prost::alloc::vec::Vec<super::digest::Digest>,
/// Set of block numbers referenced by transactions.
#[prost(fixed32, repeated, tag = "2")]
pub reference_blocks: ::prost::alloc::vec::Vec<u32>,
}
/// Returns data required to validate a new transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTransactionInputsRequest {
Expand Down Expand Up @@ -123,13 +133,6 @@ pub struct GetNotesByIdRequest {
#[prost(message, repeated, tag = "1")]
pub note_ids: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
/// Returns a list of Note inclusion proofs for the specified Note IDs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNoteAuthenticationInfoRequest {
/// List of notes to be queried from the database.
#[prost(message, repeated, tag = "1")]
pub note_ids: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
/// Returns the latest state of an account with the specified ID.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAccountDetailsRequest {
Expand Down
22 changes: 15 additions & 7 deletions crates/rust-client/src/rpc/generated/nostd/responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,21 @@ pub struct GetBlockInputsResponse {
super::note::NoteAuthenticationInfo,
>,
}
/// Represents the result of getting batch inputs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBatchInputsResponse {
/// The block header that the transaction batch should reference.
#[prost(message, optional, tag = "1")]
pub batch_reference_block_header: ::core::option::Option<super::block::BlockHeader>,
/// Proof of each _found_ unauthenticated note's inclusion in a block.
#[prost(message, repeated, tag = "2")]
pub note_proofs: ::prost::alloc::vec::Vec<super::note::NoteInclusionInBlockProof>,
/// The serialized chain MMR which includes proofs for all blocks referenced by the
/// above note inclusion proofs as well as proofs for inclusion of the blocks referenced
/// by the transactions in the batch.
#[prost(bytes = "vec", tag = "3")]
pub chain_mmr: ::prost::alloc::vec::Vec<u8>,
}
/// An account returned as a response to the `GetTransactionInputs`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountTransactionInputRecord {
Expand Down Expand Up @@ -178,13 +193,6 @@ pub struct GetNotesByIdResponse {
#[prost(message, repeated, tag = "1")]
pub notes: ::prost::alloc::vec::Vec<super::note::Note>,
}
/// Represents the result of getting note authentication info.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNoteAuthenticationInfoResponse {
/// Proofs of note inclusions in blocks and block inclusions in chain.
#[prost(message, optional, tag = "1")]
pub proofs: ::core::option::Option<super::note::NoteAuthenticationInfo>,
}
/// Represents the result of getting account details.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAccountDetailsResponse {
Expand Down
17 changes: 10 additions & 7 deletions crates/rust-client/src/rpc/generated/std/requests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ pub struct GetBlockInputsRequest {
#[prost(message, repeated, tag = "3")]
pub unauthenticated_notes: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
/// Returns the inputs for a transaction batch.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBatchInputsRequest {
/// List of unauthenticated notes to be queried from the database.
#[prost(message, repeated, tag = "1")]
pub note_ids: ::prost::alloc::vec::Vec<super::digest::Digest>,
/// Set of block numbers referenced by transactions.
#[prost(fixed32, repeated, tag = "2")]
pub reference_blocks: ::prost::alloc::vec::Vec<u32>,
}
/// Returns data required to validate a new transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetTransactionInputsRequest {
Expand Down Expand Up @@ -123,13 +133,6 @@ pub struct GetNotesByIdRequest {
#[prost(message, repeated, tag = "1")]
pub note_ids: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
/// Returns a list of Note inclusion proofs for the specified Note IDs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNoteAuthenticationInfoRequest {
/// List of notes to be queried from the database.
#[prost(message, repeated, tag = "1")]
pub note_ids: ::prost::alloc::vec::Vec<super::digest::Digest>,
}
/// Returns the latest state of an account with the specified ID.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAccountDetailsRequest {
Expand Down
22 changes: 15 additions & 7 deletions crates/rust-client/src/rpc/generated/std/responses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,21 @@ pub struct GetBlockInputsResponse {
super::note::NoteAuthenticationInfo,
>,
}
/// Represents the result of getting batch inputs.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBatchInputsResponse {
/// The block header that the transaction batch should reference.
#[prost(message, optional, tag = "1")]
pub batch_reference_block_header: ::core::option::Option<super::block::BlockHeader>,
/// Proof of each _found_ unauthenticated note's inclusion in a block.
#[prost(message, repeated, tag = "2")]
pub note_proofs: ::prost::alloc::vec::Vec<super::note::NoteInclusionInBlockProof>,
/// The serialized chain MMR which includes proofs for all blocks referenced by the
/// above note inclusion proofs as well as proofs for inclusion of the blocks referenced
/// by the transactions in the batch.
#[prost(bytes = "vec", tag = "3")]
pub chain_mmr: ::prost::alloc::vec::Vec<u8>,
}
/// An account returned as a response to the `GetTransactionInputs`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AccountTransactionInputRecord {
Expand Down Expand Up @@ -178,13 +193,6 @@ pub struct GetNotesByIdResponse {
#[prost(message, repeated, tag = "1")]
pub notes: ::prost::alloc::vec::Vec<super::note::Note>,
}
/// Represents the result of getting note authentication info.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNoteAuthenticationInfoResponse {
/// Proofs of note inclusions in blocks and block inclusions in chain.
#[prost(message, optional, tag = "1")]
pub proofs: ::core::option::Option<super::note::NoteAuthenticationInfo>,
}
/// Represents the result of getting account details.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetAccountDetailsResponse {
Expand Down
4 changes: 2 additions & 2 deletions crates/web-client/src/import.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use miden_objects::{account::AccountData, note::NoteFile, utils::Deserializable};
use miden_objects::{account::AccountFile, note::NoteFile, utils::Deserializable};
use serde_wasm_bindgen::from_value;
use wasm_bindgen::prelude::*;

Expand All @@ -9,7 +9,7 @@ impl WebClient {
pub async fn import_account(&mut self, account_bytes: JsValue) -> Result<JsValue, JsValue> {
if let Some(client) = self.get_mut_inner() {
let account_bytes_result: Vec<u8> = from_value(account_bytes).unwrap();
let account_data = AccountData::read_from_bytes(&account_bytes_result)
let account_data = AccountFile::read_from_bytes(&account_bytes_result)
.map_err(|err| err.to_string())?;
let account_id = account_data.account.id().to_string();

Expand Down
2 changes: 1 addition & 1 deletion crates/web-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use miden_client::{
Client,
};
use miden_objects::{crypto::rand::RpoRandomCoin, Felt};
use miden_proving_service_client::RemoteTransactionProver;
use miden_proving_service_client::tx_prover::RemoteTransactionProver;
use rand::{rngs::StdRng, Rng, SeedableRng};
use wasm_bindgen::prelude::*;

Expand Down
2 changes: 1 addition & 1 deletion crates/web-client/src/models/provers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use alloc::sync::Arc;
use miden_client::transaction::{
LocalTransactionProver, TransactionProver as TransactionProverTrait,
};
use miden_proving_service_client::RemoteTransactionProver;
use miden_proving_service_client::tx_prover::RemoteTransactionProver;
use miden_tx::ProvingOptions;
use wasm_bindgen::prelude::*;

Expand Down
13 changes: 6 additions & 7 deletions tests/config/miden-node.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
# Configuration settings for running integration tests.
# Adjust these values to modify how the tests are executed, such as using a remote RPC endpoint instead of a local one.
# This is an example configuration file for the Miden node.

[block_producer]
# port defined as: sum(ord(c)**p for (p, c) in enumerate('miden-block-producer', 1)) % 2**16
endpoint = { host = "localhost", port = 48046 }
endpoint = "http://127.0.0.1:48046"
# enables or disables the verification of transaction proofs before they are accepted into the
# transaction queue.
verify_tx_proofs = true

[rpc]
# port defined as: sum(ord(c)**p for (p, c) in enumerate('miden-rpc', 1)) % 2**16
endpoint = { host = "0.0.0.0", port = 57291 }
endpoint = "http://0.0.0.0:57291"

[store]
# port defined as: sum(ord(c)**p for (p, c) in enumerate('miden-store', 1)) % 2**16
endpoint = { host = "localhost", port = 28943 }
blockstore_dir = "./blocks"
database_filepath = "./miden-store.sqlite3"
genesis_filepath = "./genesis.dat"
blockstore_dir = "./blocks"
endpoint = "http://127.0.0.1:28943"
genesis_filepath = "./genesis.dat"

0 comments on commit a6e3041

Please sign in to comment.