Skip to content

Commit c39bf55

Browse files
authored
chore: update base & node deps (0xMiden#1454)
1 parent e37bcab commit c39bf55

File tree

61 files changed

+732
-448
lines changed

Some content is hidden

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

61 files changed

+732
-448
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ authors = ["miden contributors"]
2020
edition = "2024"
2121
license = "MIT"
2222
repository = "https://github.com/0xMiden/miden-client"
23-
rust-version = "1.89"
23+
rust-version = "1.90"
2424
version = "0.12.0"
2525

2626
[profile.test-dev]
@@ -29,10 +29,10 @@ opt-level = 1
2929

3030
[workspace.dependencies]
3131
# Miden base/protocol dependencies
32-
miden-lib = { branch = "next", default-features = false, git = "https://github.com/0xMiden/miden-base" }
33-
miden-objects = { branch = "next", default-features = false, git = "https://github.com/0xMiden/miden-base" }
34-
miden-testing = { branch = "next", default-features = false, git = "https://github.com/0xMiden/miden-base" }
35-
miden-tx = { branch = "next", default-features = false, git = "https://github.com/0xMiden/miden-base" }
32+
miden-lib = { default-features = false, version = "0.12" }
33+
miden-objects = { default-features = false, version = "0.12" }
34+
miden-testing = { default-features = false, version = "0.12" }
35+
miden-tx = { default-features = false, version = "0.12" }
3636

3737
# Miden node dependencies
3838
miden-node-block-producer = { branch = "next", git = "https://github.com/0xMiden/miden-node" }
@@ -41,7 +41,7 @@ miden-node-proto-build = { branch = "next", default-features = false, git = "htt
4141
miden-node-rpc = { branch = "next", git = "https://github.com/0xMiden/miden-node" }
4242
miden-node-store = { branch = "next", git = "https://github.com/0xMiden/miden-node" }
4343
miden-node-utils = { branch = "next", git = "https://github.com/0xMiden/miden-node" }
44-
miden-note-transport-proto-build = { default-features = false, git = "https://github.com/0xMiden/miden-note-transport" }
44+
miden-note-transport-proto-build = { branch = "tomasarrachea-update-deps", default-features = false, git = "https://github.com/lambdaclass/miden-note-transport" }
4545
miden-remote-prover = { branch = "next", features = ["concurrent"], git = "https://github.com/0xMiden/miden-node" }
4646
miden-remote-prover-client = { branch = "next", default-features = false, features = [
4747
"tx-prover",

bin/integration-tests/src/asm/custom_p2id.masm

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Custom P2ID note script
22
#
3-
# This note script asserts that the note args are exactly the same as passed
3+
# This note script asserts that the note args are exactly the same as passed
44
# (currently defined as {expected_note_arg_1} and {expected_note_arg_2}).
5-
# Since the args are too big to fit in a single note arg, we provide them via advice inputs and
5+
# Since the args are too big to fit in a single note arg, we provide them via advice inputs and
66
# address them via their commitment (noted as NOTE_ARG)
7-
# This note script is based off of the P2ID note script because notes currently need to have
8-
# assets, otherwise it could have been boiled down to the assert.
7+
# This note script is based off of the P2ID note script because notes currently need to have
8+
# assets, otherwise it could have been boiled down to the assert.
99

10-
use.miden::account
10+
use.miden::native_account
1111
use.miden::active_note
1212
use.miden::contracts::wallets::basic->wallet
1313
use.std::mem
@@ -27,20 +27,20 @@ begin
2727
# => [target_mem_addr']
2828
dropw
2929
# => []
30-
30+
3131
# read first word
3232
push.{mem_address}
3333
# => [data_mem_address]
34-
mem_loadw
34+
mem_loadw_be
3535
# => [NOTE_ARG_1]
36-
36+
3737
push.{expected_note_arg_1} assert_eqw.err="First note argument didn't match expected"
3838
# => []
3939

4040
# read second word
4141
push.{mem_address_2}
4242
# => [data_mem_address_2]
43-
mem_loadw
43+
mem_loadw_be
4444
# => [NOTE_ARG_2]
4545

4646
push.{expected_note_arg_2} assert_eqw.err="Second note argument didn't match expected"
@@ -58,7 +58,7 @@ begin
5858
mem_load
5959
# => [target_account_id_prefix]
6060

61-
exec.account::get_id swap drop
61+
exec.native_account::get_id swap drop
6262
# => [account_id_prefix, target_account_id_prefix, ...]
6363

6464
# ensure account_id = target_account_id, fails otherwise

bin/integration-tests/src/tests/client.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1185,16 +1185,16 @@ pub async fn test_unused_rpc_api(client_config: ClientConfig) -> Result<()> {
11851185

11861186
// Define the account code for the custom library
11871187
let custom_code = "
1188-
use.miden::account
1188+
use.miden::native_account
11891189
11901190
export.update_map
11911191
push.1.2.3.4
11921192
# => [VALUE]
11931193
push.0.0.0.0
11941194
# => [KEY, VALUE]
1195-
push.1
1195+
push.0
11961196
# => [index, KEY, VALUE]
1197-
exec.account::set_map_item
1197+
exec.native_account::set_map_item
11981198
dropw dropw dropw dropw
11991199
end
12001200
";
@@ -1205,7 +1205,7 @@ pub async fn test_unused_rpc_api(client_config: ClientConfig) -> Result<()> {
12051205
[Felt::new(0), Felt::new(0), Felt::new(0), Felt::new(1)].into(),
12061206
)?;
12071207

1208-
let storage_slots = vec![StorageSlot::empty_map(), StorageSlot::Map(storage_map)];
1208+
let storage_slots = vec![StorageSlot::Map(storage_map)];
12091209
let (account_with_map_item, _) = insert_account_with_custom_component(
12101210
&mut client,
12111211
custom_code,

bin/integration-tests/src/tests/custom_transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ pub async fn test_merkle_store(client_config: ClientConfig) -> Result<()> {
197197
push.{num_leaves} push.4000 mem_store
198198
199199
# merkle root -> mem[4004]
200-
push.{} push.4004 mem_storew dropw
200+
push.{} push.4004 mem_storew_be dropw
201201
",
202202
merkle_root.to_hex()
203203
);

bin/integration-tests/src/tests/fpi.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ pub async fn test_fpi_execute_program(client_config: ClientConfig) -> Result<()>
5353
push.{map_key}
5454
# item index
5555
push.0
56-
exec.::miden::account::get_map_item
56+
exec.::miden::active_account::get_map_item
5757
swapw dropw
5858
end",
5959
map_key = Word::from(MAP_KEY)
@@ -64,7 +64,6 @@ pub async fn test_fpi_execute_program(client_config: ClientConfig) -> Result<()>
6464
let code = format!(
6565
"
6666
use.miden::tx
67-
use.miden::account
6867
begin
6968
# push the root of the `get_fpi_item` account procedure
7069
push.{proc_root}
@@ -132,7 +131,7 @@ pub async fn test_nested_fpi_calls(client_config: ClientConfig) -> Result<()> {
132131
push.{map_key}
133132
# item index
134133
push.0
135-
exec.::miden::account::get_map_item
134+
exec.::miden::active_account::get_map_item
136135
swapw dropw
137136
end",
138137
map_key = Word::from(MAP_KEY)
@@ -250,7 +249,7 @@ async fn standard_fpi(storage_mode: AccountStorageMode, client_config: ClientCon
250249
push.{map_key}
251250
# item index
252251
push.0
253-
exec.::miden::account::get_map_item
252+
exec.::miden::active_account::get_map_item
254253
swapw dropw
255254
end",
256255
map_key = Word::from(MAP_KEY)
@@ -424,5 +423,9 @@ async fn deploy_foreign_account(
424423
.await?;
425424
wait_for_tx(client, tx_id).await?;
426425

426+
// NOTE: We get the new account state here since the first transaction updates the nonce from
427+
// to 1
428+
let foreign_account: Account = client.get_account(foreign_account_id).await?.unwrap().into();
429+
427430
Ok((foreign_account, proc_root))
428431
}

bin/integration-tests/src/tests/network_transaction.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,36 +32,37 @@ use crate::tests::config::ClientConfig;
3232
// ================================================================================================
3333

3434
const COUNTER_CONTRACT: &str = "
35-
use.miden::account
35+
use.miden::active_account
36+
use.miden::native_account
3637
use.std::sys
3738
3839
# => []
3940
export.get_count
4041
push.0
41-
exec.account::get_item
42+
exec.active_account::get_item
4243
exec.sys::truncate_stack
4344
end
4445
4546
# => []
4647
export.increment_count
4748
push.0
4849
# => [index]
49-
exec.account::get_item
50+
exec.active_account::get_item
5051
# => [count]
5152
push.1 add
5253
# => [count+1]
5354
push.0
5455
# [index, count+1]
55-
exec.account::set_item
56+
exec.native_account::set_item
5657
# => []
5758
exec.sys::truncate_stack
5859
# => []
5960
end";
6061

6162
const INCR_NONCE_AUTH_CODE: &str = "
62-
use.miden::account
63+
use.miden::native_account
6364
export.auth__basic
64-
exec.account::incr_nonce
65+
exec.native_account::incr_nonce
6566
drop
6667
end
6768
";

bin/integration-tests/src/tests/transport.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
use std::sync::Arc;
22

33
use anyhow::{Context, Result};
4-
use miden_client::account::{AccountIdAddress, AccountStorageMode, Address, AddressInterface};
4+
use miden_client::account::AccountStorageMode;
5+
use miden_client::address::{Address, AddressInterface, RoutingParameters};
56
use miden_client::asset::FungibleAsset;
67
use miden_client::keystore::FilesystemKeyStore;
78
use miden_client::note::NoteType;
@@ -139,10 +140,9 @@ async fn run_flow(
139140
.context("failed to insert faucet in sender")?;
140141

141142
// Build recipient address
142-
let recipient_address = Address::AccountId(AccountIdAddress::new(
143-
recipient_account.id(),
144-
AddressInterface::BasicWallet,
145-
));
143+
let recipient_address = Address::new(recipient_account.id())
144+
.with_routing_parameters(RoutingParameters::new(AddressInterface::BasicWallet))
145+
.context("failed to build recipient address")?;
146146

147147
// Ensure recipient has no input notes
148148
recipient.sync_state().await.context("recipient initial sync")?;

bin/miden-cli/src/commands/account.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use clap::Parser;
22
use comfy_table::{Cell, ContentArrangement, presets};
33
use miden_client::account::{Account, AccountId, AccountType, StorageSlot};
4-
use miden_client::address::{AccountIdAddress, Address, AddressInterface};
4+
use miden_client::address::{Address, AddressInterface, RoutingParameters};
55
use miden_client::asset::Asset;
66
use miden_client::rpc::{GrpcClient, NodeRpcClient};
77
use miden_client::transaction::{AccountComponentInterface, AccountInterface};
@@ -317,16 +317,19 @@ async fn account_bech_32<AUTH>(
317317

318318
let account_interface: AccountInterface = account_record.account().into();
319319

320-
let interface = if account_interface
320+
let mut address = Address::new(account_id);
321+
if account_interface
321322
.components()
322323
.iter()
323324
.any(|c| matches!(c, AccountComponentInterface::BasicWallet))
324325
{
325-
AddressInterface::BasicWallet
326-
} else {
327-
AddressInterface::Unspecified
328-
};
326+
address = address
327+
.with_routing_parameters(RoutingParameters::new(AddressInterface::BasicWallet))
328+
.map_err(|err| {
329+
CliError::Address(err, "Failed to set routing parameters".to_string())
330+
})?;
331+
}
329332

330-
let address = AccountIdAddress::new(account_id, interface);
331-
Ok(Address::from(address).to_bech32(cli_config.rpc.endpoint.0.to_network_id()))
333+
let encoded = address.encode(cli_config.rpc.endpoint.0.to_network_id());
334+
Ok(encoded)
332335
}

bin/miden-cli/src/commands/address.rs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
use std::str::FromStr;
22

33
use miden_client::Client;
4-
use miden_client::account::AccountIdAddress;
5-
use miden_client::address::{Address, AddressInterface, NetworkId};
6-
use miden_client::note::NoteExecutionMode;
4+
use miden_client::address::{Address, AddressInterface, NetworkId, RoutingParameters};
5+
use miden_client::note::{NoteExecutionMode, NoteTag};
76

87
use crate::errors::CliError;
98
use crate::utils::parse_account_id;
@@ -12,7 +11,6 @@ use crate::{Parser, Subcommand, create_dynamic_table, load_config_file};
1211
#[derive(Debug, Clone)]
1312
pub enum CliAddressInterface {
1413
BasicWallet,
15-
Unspecified,
1614
}
1715

1816
impl FromStr for CliAddressInterface {
@@ -21,7 +19,6 @@ impl FromStr for CliAddressInterface {
2119
fn from_str(value: &str) -> Result<Self, Self::Err> {
2220
match value {
2321
"BasicWallet" => Ok(CliAddressInterface::BasicWallet),
24-
"Unspecified" => Ok(CliAddressInterface::Unspecified),
2522
other => Err(format!(
2623
"Invalid interface: {other}. Valid values are: BasicWallet, Unspecified",
2724
)),
@@ -33,7 +30,6 @@ impl From<CliAddressInterface> for AddressInterface {
3330
fn from(value: CliAddressInterface) -> Self {
3431
match value {
3532
CliAddressInterface::BasicWallet => AddressInterface::BasicWallet,
36-
CliAddressInterface::Unspecified => AddressInterface::Unspecified,
3733
}
3834
}
3935
}
@@ -99,8 +95,11 @@ fn print_account_addresses(account_id: &String, addresses: &Vec<Address>, networ
9995
println!("Addresses for AccountId {account_id}:");
10096
let mut table = create_dynamic_table(&["Address", "Interface"]);
10197
for address in addresses {
102-
let address_bech32 = address.to_bech32(network_id.clone());
103-
let interface = address.interface().to_string();
98+
let address_bech32 = address.encode(network_id.clone());
99+
let interface = match address.interface() {
100+
Some(interface) => interface.to_string(),
101+
None => "Unspecified".to_string(),
102+
};
104103
table.add_row(vec![address_bech32, interface]);
105104
}
106105

@@ -152,18 +151,22 @@ async fn add_address<AUTH>(
152151
) -> Result<(), CliError> {
153152
let account_id = parse_account_id(&client, &account_id).await?;
154153
let interface = interface.into();
155-
let account_id_address = match tag_len {
156-
Some(tag_len) => AccountIdAddress::new(account_id, interface)
157-
.with_tag_len(tag_len)
154+
let routing_params = match tag_len {
155+
Some(tag_len) => RoutingParameters::new(interface)
156+
.with_note_tag_len(tag_len)
158157
.map_err(|e| CliError::Address(e, String::new()))?,
159-
None => AccountIdAddress::new(account_id, interface),
158+
None => RoutingParameters::new(interface),
160159
};
160+
let address = Address::new(account_id)
161+
.with_routing_parameters(routing_params)
162+
.map_err(|err| CliError::Address(err, "Failed to set routing params".to_string()))?;
161163

162-
let execution_mode = match account_id_address.to_note_tag().execution_mode() {
164+
let note_tag = NoteTag::from_account_id(account_id);
165+
let execution_mode = match note_tag.execution_mode() {
163166
NoteExecutionMode::Local => "Local",
164167
NoteExecutionMode::Network => "Network",
165168
};
166-
client.add_address(account_id_address.into(), account_id).await?;
169+
client.add_address(address, account_id).await?;
167170

168171
println!("Address added: Account Id {account_id} - Execution mode: {execution_mode}");
169172
Ok(())
@@ -175,7 +178,7 @@ async fn remove_address<AUTH>(
175178
address: String,
176179
) -> Result<(), CliError> {
177180
let account_id = parse_account_id(&client, &account_id).await?;
178-
let (_, address) = Address::from_bech32(&address).map_err(|e| CliError::Address(e, address))?;
181+
let (_, address) = Address::decode(&address).map_err(|e| CliError::Address(e, address))?;
179182
let execution_mode = match address.to_note_tag().execution_mode() {
180183
NoteExecutionMode::Local => "Local",
181184
NoteExecutionMode::Network => "Network",

0 commit comments

Comments
 (0)