Skip to content

Upgrade VM, crypto, and rand dependencies#3146

Open
huitseeker wants to merge 11 commits into
nextfrom
issue-3064-dependency-upgrade
Open

Upgrade VM, crypto, and rand dependencies#3146
huitseeker wants to merge 11 commits into
nextfrom
issue-3064-dependency-upgrade

Conversation

@huitseeker

@huitseeker huitseeker commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This updates Miden VM to v0.24, Miden Crypto to v0.27, and rand to v0.10.

The VM upgrade moved package debug info out of MastForest. This PR keeps that debug info attached through scripts, account code, and MAST forest stores by carrying PackageDebugInfoin LoadedMastForest.

This also updates MASM imports and build helpers for the new assembly package API.

Closes #3064

@huitseeker huitseeker marked this pull request as ready for review June 25, 2026 19:57
@huitseeker huitseeker marked this pull request as draft June 25, 2026 19:58
@huitseeker huitseeker marked this pull request as ready for review June 25, 2026 21:01
@@ -1 +1,4 @@
#![cfg_attr(not(feature = "concurrent"), no_std)]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to run benchmarks for no_std or why is this needed? I assume this has something to do with all dependencies being made optional as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue is Cargo feature unification. The transaction benchmark uses the concurrent proving path. Since 0xMiden/crypto#1073, miden-lifted-stark/concurrent is part of the default crypto stack. In crypto 0.27, miden-crypto/concurrent enables std. On the protocol side, miden-tx/concurrent and miden-processor/concurrent also require std.

That works for the benchmark, but it must not leak into cargo build --no-default-features --target wasm32-unknown-unknown --workspace --lib. So the feature gate keeps normal benchmark builds as the default through default = ["concurrent"], while the no-default library build does not enable the std only benchmark stack.

/cc @WiktorStarczewski @Nashtare

use miden::core::word
use agglayer::common::utils
use ::miden::protocol::asset::FUNGIBLE_ASSET_MAX_AMOUNT
use {FUNGIBLE_ASSET_MAX_AMOUNT} from ::miden::protocol::asset

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think call sites would be clearer if we could import just the module and then reference items from a module as module::item, e.g. push.asset::FUNGIBLE_ASSET_MAX_AMOUNT. I thought this would be implemented as part of 0xMiden/miden-vm#2643 (comment), but it seems like it wasn't. Is that planned as a follow-up? cc @bitwalker

Main reason I'm asking is because I'm not a big fan of this syntax and that is totally subjective. But if we had the ability to do the above, then there would be no need to use this syntax anywhere.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exact form push.asset::FUNGIBLE_ASSET_MAX_AMOUNT is rejected as an invalid identifier so far. In any case, I would handle the module import style in a later MASM cleanup, once the assembler accepts it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like a large part of the changes are related to packages and the way we assemble MASM. Does this not result in many conflicts with #2896? That workstream currently has 4 open PRs. So it seems it would make sense to do this migration after that issue was resolved, wdyt?

@huitseeker huitseeker Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this PR is already doing part of issue #2896. The VM 0.24 upgrade removes the old shape of several Library and Program APIs, so this PR has to move some code to Package and MastForest. That is visible in account component code, note scripts, transaction scripts, and the build scripts.

The part this PR does not do is the project file migration. It adds no miden-project.toml files, and it does not move protocol or standards assembly to the declarative project layout from #3094 and #3107.

I think this leaves us with an ordering choice. If we want the dependency upgrade now, this PR can land first and the project file PRs can rebase over it. If we want less churn in the package migration work, this PR can wait and I can rebase it after #3094 and #3107.

/cc @TomasArrachea @bitwalker

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade crypto (0.26) and miden-vm (0.24) dependencies

2 participants