Skip to content

Commit

Permalink
Use batch prover from miden-base (#659)
Browse files Browse the repository at this point in the history
* feat: Add tx-batch prover crate as dependency

* feat: Implement Batch Inputs retrieval from store

* feat: Replace `TransactionBatch` in tests with `ProvenBatch`

* chore: Rebuild proto files

* chore: Add changelog entry

* chore: Import proto types as `proto::`

* chore: Modify changelog entry

* feat: Remove outdated `GetNoteAuthenticationInfoRequest`

* feat: Handle errors in `get_batch_inputs`

* feat: Handle errors during batch building

* chore: Update usages of `AccountFile`

* chore: More updates of `AccountFile`

* feat: Use latest block num method on `InnerState`

* chore: Pin to miden-base current next branch
  • Loading branch information
PhilippGackstatter authored Feb 4, 2025
1 parent 4215341 commit 87b4a70
Show file tree
Hide file tree
Showing 39 changed files with 752 additions and 860 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
- [BREAKING] Updated minimum Rust version to 1.84.
- [BREAKING] `Endpoint` configuration simplified to a single string (#654).

### Enhancements

- Prove transaction batches using Rust batch prover reference implementation (#659).

## v0.7.2 (2025-01-29)

### Fixes
Expand Down
98 changes: 54 additions & 44 deletions Cargo.lock

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

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,18 @@ version = "0.8.0"
assert_matches = { version = "1.5" }
itertools = { version = "0.14" }
miden-air = { version = "0.12" }
miden-lib = { version = "0.7" }
miden-lib = { git = "https://github.com/0xPolygonMiden/miden-base.git", rev = "e82dee03de7589ef3fb12b7fd901cef25ae5535d" }
miden-node-block-producer = { path = "crates/block-producer", version = "0.8" }
miden-node-proto = { path = "crates/proto", version = "0.8" }
miden-node-rpc = { path = "crates/rpc", version = "0.8" }
miden-node-store = { path = "crates/store", version = "0.8" }
miden-node-test-macro = { path = "crates/test-macro" }
miden-node-utils = { path = "crates/utils", version = "0.8" }
miden-objects = { version = "0.7" }
miden-objects = { git = "https://github.com/0xPolygonMiden/miden-base.git", rev = "e82dee03de7589ef3fb12b7fd901cef25ae5535d" }
miden-processor = { version = "0.12" }
miden-stdlib = { version = "0.12", default-features = false }
miden-tx = { version = "0.7" }
miden-tx = { git = "https://github.com/0xPolygonMiden/miden-base.git", rev = "e82dee03de7589ef3fb12b7fd901cef25ae5535d" }
miden-tx-batch-prover = { git = "https://github.com/0xPolygonMiden/miden-base.git", rev = "e82dee03de7589ef3fb12b7fd901cef25ae5535d" }
prost = { version = "0.13" }
rand = { version = "0.8" }
thiserror = { version = "2.0", default-features = false }
Expand Down
4 changes: 2 additions & 2 deletions bin/faucet/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use miden_node_proto::generated::{
rpc::api_client::ApiClient,
};
use miden_objects::{
account::{Account, AccountData, AccountId, AuthSecretKey},
account::{Account, AccountFile, AccountId, AuthSecretKey},
asset::FungibleAsset,
block::{BlockHeader, BlockNumber},
crypto::{
Expand Down Expand Up @@ -61,7 +61,7 @@ impl FaucetClient {
let (mut rpc_api, root_block_header, root_chain_mmr) =
initialize_faucet_client(config).await?;

let faucet_account_data = AccountData::read(&config.faucet_account_path)
let faucet_account_data = AccountFile::read(&config.faucet_account_path)
.context("Failed to load faucet account from file")?;

let id = faucet_account_data.account.id();
Expand Down
4 changes: 2 additions & 2 deletions bin/faucet/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use http::HeaderValue;
use miden_lib::{account::faucets::create_basic_fungible_faucet, AuthScheme};
use miden_node_utils::{config::load_config, crypto::get_rpo_random_coin, version::LongVersion};
use miden_objects::{
account::{AccountData, AccountStorageMode, AuthSecretKey},
account::{AccountFile, AccountStorageMode, AuthSecretKey},
asset::TokenSymbol,
crypto::dsa::rpo_falcon512::SecretKey,
Felt,
Expand Down Expand Up @@ -169,7 +169,7 @@ async fn main() -> anyhow::Result<()> {
.context("Failed to create basic fungible faucet account")?;

let account_data =
AccountData::new(account, Some(account_seed), AuthSecretKey::RpoFalcon512(secret));
AccountFile::new(account, Some(account_seed), AuthSecretKey::RpoFalcon512(secret));

let output_path = current_dir.join(output_path);
account_data
Expand Down
8 changes: 4 additions & 4 deletions bin/node/src/commands/genesis/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use miden_lib::{account::faucets::create_basic_fungible_faucet, AuthScheme};
use miden_node_store::genesis::GenesisState;
use miden_node_utils::{config::load_config, crypto::get_rpo_random_coin};
use miden_objects::{
account::{Account, AccountData, AccountIdAnchor, AuthSecretKey},
account::{Account, AccountFile, AccountIdAnchor, AuthSecretKey},
asset::TokenSymbol,
crypto::{dsa::rpo_falcon512::SecretKey, utils::Serializable},
Felt, ONE,
Expand Down Expand Up @@ -134,7 +134,7 @@ fn create_accounts(
);
faucet_count += 1;

(AccountData::new(account, Some(account_seed), auth_secret_key), name)
(AccountFile::new(account, Some(account_seed), auth_secret_key), name)
},
};

Expand Down Expand Up @@ -182,7 +182,7 @@ mod tests {

use figment::Jail;
use miden_node_store::genesis::GenesisState;
use miden_objects::{account::AccountData, utils::serde::Deserializable};
use miden_objects::{account::AccountFile, utils::serde::Deserializable};

use crate::DEFAULT_GENESIS_FILE_PATH;

Expand Down Expand Up @@ -220,7 +220,7 @@ mod tests {
assert!(a0_file_path.exists());

// deserialize account and genesis_state
let a0 = AccountData::read(a0_file_path).unwrap();
let a0 = AccountFile::read(a0_file_path).unwrap();

// assert that the account has the corresponding storage mode
assert!(a0.account.is_public());
Expand Down
Loading

0 comments on commit 87b4a70

Please sign in to comment.