Skip to content

Commit b785bde

Browse files
committed
chore: migrate to protocol release/v0.14.0-beta
Update all miden-protocol dependencies from 0.14.0-alpha.1 to 0.14.0-beta.1 (crates.io). Update miden-crypto from 0.19.7 to 0.22. Bump node workspace version to 0.14.0-beta.1. Key migration changes: - Serialization traits moved to utils::serde submodule - Felt::as_int() -> Felt::as_canonical_u64() - falcon512_rpo -> falcon512_poseidon2 - ProvenTransactionBuilder removed, use ProvenTransaction::new() - OutputNote variants: Full -> Public, Header -> Private - Asset is now key-value (two words instead of one) - MmrProof fields are now methods - account_id_to_smt_key -> AccountIdKey::from() - miden-air removed (replaced by miden-core 0.21) - SmtStorage trait methods now take &mut self - Various other API changes in miden-crypto 0.22
1 parent a287a5a commit b785bde

File tree

87 files changed

+1228
-744
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+1228
-744
lines changed

Cargo.lock

Lines changed: 505 additions & 203 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ license = "MIT"
3131
readme = "README.md"
3232
repository = "https://github.com/0xMiden/node"
3333
rust-version = "1.91"
34-
version = "0.14.0-alpha.5"
34+
version = "0.14.0-beta.1"
3535

3636
# Optimize the cryptography for faster tests involving account creation.
3737
[profile.test.package.miden-crypto]
@@ -46,35 +46,33 @@ debug = true
4646

4747
[workspace.dependencies]
4848
# Workspace crates.
49-
miden-large-smt-backend-rocksdb = { path = "crates/large-smt-backend-rocksdb", version = "=0.14.0-alpha.5" }
50-
miden-node-block-producer = { path = "crates/block-producer", version = "=0.14.0-alpha.5" }
51-
miden-node-db = { path = "crates/db", version = "=0.14.0-alpha.5" }
52-
miden-node-grpc-error-macro = { path = "crates/grpc-error-macro", version = "=0.14.0-alpha.5" }
53-
miden-node-ntx-builder = { path = "crates/ntx-builder", version = "=0.14.0-alpha.5" }
54-
miden-node-proto = { path = "crates/proto", version = "=0.14.0-alpha.5" }
55-
miden-node-proto-build = { path = "proto", version = "=0.14.0-alpha.5" }
56-
miden-node-rpc = { path = "crates/rpc", version = "=0.14.0-alpha.5" }
57-
miden-node-store = { path = "crates/store", version = "=0.14.0-alpha.5" }
49+
miden-large-smt-backend-rocksdb = { path = "crates/large-smt-backend-rocksdb", version = "=0.14.0-beta.1" }
50+
miden-node-block-producer = { path = "crates/block-producer", version = "=0.14.0-beta.1" }
51+
miden-node-db = { path = "crates/db", version = "=0.14.0-beta.1" }
52+
miden-node-grpc-error-macro = { path = "crates/grpc-error-macro", version = "=0.14.0-beta.1" }
53+
miden-node-ntx-builder = { path = "crates/ntx-builder", version = "=0.14.0-beta.1" }
54+
miden-node-proto = { path = "crates/proto", version = "=0.14.0-beta.1" }
55+
miden-node-proto-build = { path = "proto", version = "=0.14.0-beta.1" }
56+
miden-node-rpc = { path = "crates/rpc", version = "=0.14.0-beta.1" }
57+
miden-node-store = { path = "crates/store", version = "=0.14.0-beta.1" }
5858
miden-node-test-macro = { path = "crates/test-macro" }
59-
miden-node-utils = { path = "crates/utils", version = "=0.14.0-alpha.5" }
60-
miden-node-validator = { path = "crates/validator", version = "=0.14.0-alpha.5" }
61-
miden-remote-prover-client = { path = "crates/remote-prover-client", version = "=0.14.0-alpha.5" }
59+
miden-node-utils = { path = "crates/utils", version = "=0.14.0-beta.1" }
60+
miden-node-validator = { path = "crates/validator", version = "=0.14.0-beta.1" }
61+
miden-remote-prover-client = { path = "crates/remote-prover-client", version = "=0.14.0-beta.1" }
6262
# Temporary workaround until <https://github.com/rust-rocksdb/rust-rocksdb/pull/1029>
6363
# is part of `rocksdb-rust` release
64-
miden-node-rocksdb-cxx-linkage-fix = { path = "crates/rocksdb-cxx-linkage-fix", version = "=0.14.0-alpha.5" }
64+
miden-node-rocksdb-cxx-linkage-fix = { path = "crates/rocksdb-cxx-linkage-fix", version = "=0.14.0-beta.1" }
6565

6666
# miden-base aka protocol dependencies. These should be updated in sync.
67-
miden-block-prover = { version = "=0.14.0-alpha.1" }
68-
miden-protocol = { default-features = false, version = "=0.14.0-alpha.1" }
69-
miden-standards = { version = "=0.14.0-alpha.1" }
70-
miden-testing = { version = "=0.14.0-alpha.1" }
71-
miden-tx = { default-features = false, version = "=0.14.0-alpha.1" }
72-
miden-tx-batch-prover = { version = "=0.14.0-alpha.1" }
67+
miden-block-prover = { version = "=0.14.0-beta.1" }
68+
miden-protocol = { default-features = false, version = "=0.14.0-beta.1" }
69+
miden-standards = { version = "=0.14.0-beta.1" }
70+
miden-testing = { version = "=0.14.0-beta.1" }
71+
miden-tx = { default-features = false, version = "=0.14.0-beta.1" }
72+
miden-tx-batch-prover = { version = "=0.14.0-beta.1" }
7373

7474
# Other miden dependencies. These should align with those expected by miden-base.
75-
miden-air = { features = ["std", "testing"], version = "0.20" }
76-
77-
miden-crypto = { version = "0.19.7" }
75+
miden-crypto = { version = "0.22" }
7876

7977
# External dependencies
8078
anyhow = { version = "1.0" }

bin/network-monitor/src/counter.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use miden_protocol::account::auth::AuthSecretKey;
1616
use miden_protocol::account::{Account, AccountFile, AccountHeader, AccountId};
1717
use miden_protocol::assembly::Library;
1818
use miden_protocol::block::{BlockHeader, BlockNumber};
19-
use miden_protocol::crypto::dsa::falcon512_rpo::SecretKey;
19+
use miden_protocol::crypto::dsa::falcon512_poseidon2::SecretKey;
2020
use miden_protocol::note::{
2121
Note,
2222
NoteAssets,
@@ -28,13 +28,13 @@ use miden_protocol::note::{
2828
NoteType,
2929
};
3030
use miden_protocol::transaction::{InputNotes, PartialBlockchain, TransactionArgs};
31-
use miden_protocol::utils::Deserializable;
31+
use miden_protocol::utils::serde::Deserializable;
3232
use miden_protocol::{Felt, Word};
3333
use miden_standards::account::interface::{AccountInterface, AccountInterfaceExt};
3434
use miden_standards::code_builder::CodeBuilder;
3535
use miden_standards::note::{NetworkAccountTarget, NoteExecutionHint};
3636
use miden_tx::auth::BasicAuthenticator;
37-
use miden_tx::utils::Serializable;
37+
use miden_tx::utils::serde::Serializable;
3838
use miden_tx::{LocalTransactionProver, TransactionExecutor};
3939
use rand::{Rng, SeedableRng};
4040
use rand_chacha::ChaCha20Rng;
@@ -130,7 +130,7 @@ async fn fetch_counter_value(
130130
.try_into()
131131
.context("failed to convert slot value to word")?;
132132

133-
let value = slot_value.as_elements().last().expect("Word has 4 elements").as_int();
133+
let value = slot_value.as_elements().last().expect("Word has 4 elements").as_canonical_u64();
134134

135135
Ok(Some(value))
136136
}
@@ -321,7 +321,7 @@ async fn setup_increment_task(
321321
.await?
322322
.unwrap_or(wallet_account_file.account.clone());
323323

324-
let AuthSecretKey::Falcon512Rpo(secret_key) = wallet_account_file
324+
let AuthSecretKey::Falcon512Poseidon2(secret_key) = wallet_account_file
325325
.auth_secret_keys
326326
.first()
327327
.expect("wallet account file should have one auth secret key")
@@ -821,7 +821,8 @@ async fn create_and_submit_network_note(
821821
rng: &mut ChaCha20Rng,
822822
) -> Result<(String, AccountHeader, BlockNumber)> {
823823
// Create authenticator for transaction signing
824-
let authenticator = BasicAuthenticator::new(&[AuthSecretKey::Falcon512Rpo(secret_key.clone())]);
824+
let authenticator =
825+
BasicAuthenticator::new(&[AuthSecretKey::Falcon512Poseidon2(secret_key.clone())]);
825826

826827
let account_interface = AccountInterface::from_account(wallet_account);
827828

@@ -851,7 +852,7 @@ async fn create_and_submit_network_note(
851852

852853
// Prove the transaction
853854
let prover = LocalTransactionProver::default();
854-
let proven_tx = prover.prove(executed_tx).context("Failed to prove transaction")?;
855+
let proven_tx = prover.prove(executed_tx).await.context("Failed to prove transaction")?;
855856

856857
// Submit the proven transaction
857858
let request = ProvenTransaction {

bin/network-monitor/src/deploy/counter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use miden_protocol::account::{
1616
StorageSlotName,
1717
};
1818
use miden_protocol::utils::sync::LazyLock;
19-
use miden_protocol::{Felt, FieldElement, Word};
19+
use miden_protocol::{Felt, Word};
2020
use miden_standards::code_builder::CodeBuilder;
2121
use miden_standards::testing::account_component::IncrNonceAuthComponent;
2222
use tracing::instrument;
@@ -54,7 +54,7 @@ pub fn create_counter_account(owner_account_id: AccountId) -> Result<Account> {
5454
let component_code =
5555
CodeBuilder::default().compile_component_code("counter::program", script)?;
5656

57-
let metadata = AccountComponentMetadata::new("counter::program").with_supports_all_types();
57+
let metadata = AccountComponentMetadata::new("counter::program", AccountType::all());
5858
let account_code =
5959
AccountComponent::new(component_code, vec![counter_slot, owner_id_slot], metadata)?;
6060

bin/network-monitor/src/deploy/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use miden_protocol::transaction::{
3232
};
3333
use miden_protocol::{MastForest, Word};
3434
use miden_tx::auth::BasicAuthenticator;
35-
use miden_tx::utils::Serializable;
35+
use miden_tx::utils::serde::Serializable;
3636
use miden_tx::{
3737
DataStore,
3838
DataStoreError,
@@ -203,7 +203,7 @@ pub async fn deploy_counter_account(counter_account: &Account, rpc_url: &Url) ->
203203

204204
let prover = LocalTransactionProver::default();
205205

206-
let proven_tx = prover.prove(executed_tx).context("Failed to prove transaction")?;
206+
let proven_tx = prover.prove(executed_tx).await.context("Failed to prove transaction")?;
207207

208208
let request = ProvenTransaction {
209209
transaction: proven_tx.to_bytes(),

bin/network-monitor/src/deploy/wallet.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use anyhow::Result;
66
use miden_node_utils::crypto::get_rpo_random_coin;
77
use miden_protocol::account::auth::{AuthScheme, AuthSecretKey};
88
use miden_protocol::account::{Account, AccountFile, AccountStorageMode, AccountType};
9-
use miden_protocol::crypto::dsa::falcon512_rpo::SecretKey;
9+
use miden_protocol::crypto::dsa::falcon512_poseidon2::SecretKey;
1010
use miden_standards::AuthMethod;
1111
use miden_standards::account::wallets::create_basic_wallet;
1212
use rand::{Rng, SeedableRng};
@@ -23,7 +23,7 @@ pub fn create_wallet_account() -> Result<(Account, SecretKey)> {
2323
let mut rng = ChaCha20Rng::from_seed(rand::random());
2424
let secret_key = SecretKey::with_rng(&mut get_rpo_random_coin(&mut rng));
2525
let auth = AuthMethod::SingleSig {
26-
approver: (secret_key.public_key().into(), AuthScheme::Falcon512Rpo),
26+
approver: (secret_key.public_key().into(), AuthScheme::Falcon512Poseidon2),
2727
};
2828
let init_seed: [u8; 32] = rng.random();
2929

@@ -43,7 +43,7 @@ pub fn save_wallet_account(
4343
secret_key: &SecretKey,
4444
file_path: &Path,
4545
) -> Result<()> {
46-
let auth_secret_key = AuthSecretKey::Falcon512Rpo(secret_key.clone());
46+
let auth_secret_key = AuthSecretKey::Falcon512Poseidon2(secret_key.clone());
4747
let account_file = AccountFile::new(account.clone(), vec![auth_secret_key]);
4848
account_file.write(file_path)?;
4949
Ok(())

bin/network-monitor/src/remote_prover.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use miden_protocol::note::NoteType;
1414
use miden_protocol::testing::account_id::{ACCOUNT_ID_PUBLIC_FUNGIBLE_FAUCET, ACCOUNT_ID_SENDER};
1515
use miden_protocol::transaction::TransactionInputs;
1616
use miden_testing::{Auth, MockChainBuilder};
17-
use miden_tx::utils::Serializable;
17+
use miden_tx::utils::serde::Serializable;
1818
use serde::{Deserialize, Serialize};
1919
use tokio::sync::watch;
2020
use tokio::time::MissedTickBehavior;
@@ -278,7 +278,9 @@ pub async fn generate_mock_transaction() -> anyhow::Result<TransactionInputs> {
278278

279279
// Create an account with basic authentication
280280
let account = mock_chain_builder
281-
.add_existing_wallet(Auth::BasicAuth { auth_scheme: AuthScheme::Falcon512Rpo })
281+
.add_existing_wallet(Auth::BasicAuth {
282+
auth_scheme: AuthScheme::Falcon512Poseidon2,
283+
})
282284
.context("Failed to add wallet to mock chain")?;
283285

284286
// Create a fungible asset

bin/node/src/commands/bundled.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use miden_node_utils::clap::GrpcOptionsExternal;
99
use miden_node_utils::grpc::UrlExt;
1010
use miden_node_validator::{Validator, ValidatorSigner};
1111
use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey;
12-
use miden_protocol::utils::Deserializable;
12+
use miden_protocol::utils::serde::Deserializable;
1313
use tokio::net::TcpListener;
1414
use tokio::task::JoinSet;
1515
use url::Url;

bin/node/src/commands/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use miden_node_block_producer::{
1313
use miden_node_utils::clap::duration_to_human_readable_string;
1414
use miden_node_validator::ValidatorSigner;
1515
use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey;
16-
use miden_protocol::utils::Deserializable;
16+
use miden_protocol::utils::serde::Deserializable;
1717
use tokio::net::TcpListener;
1818
use url::Url;
1919

bin/node/src/commands/validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use miden_node_utils::clap::GrpcOptionsInternal;
66
use miden_node_utils::grpc::UrlExt;
77
use miden_node_validator::{Validator, ValidatorSigner};
88
use miden_protocol::crypto::dsa::ecdsa_k256_keccak::SecretKey;
9-
use miden_protocol::utils::Deserializable;
9+
use miden_protocol::utils::serde::Deserializable;
1010
use url::Url;
1111

1212
use crate::commands::{

0 commit comments

Comments
 (0)