Skip to content

protocol: VM v0.22.1 compatibility fixes#2742

Merged
bobbinth merged 2 commits into0xMiden:mainfrom
walnuthq:main
Apr 7, 2026
Merged

protocol: VM v0.22.1 compatibility fixes#2742
bobbinth merged 2 commits into0xMiden:mainfrom
walnuthq:main

Conversation

@djolertrk
Copy link
Copy Markdown
Contributor

@djolertrk djolertrk commented Apr 7, 2026

Update miden-protocol and miden-standards for VM v0.22.1 compatibility:

  • Assembler::assemble_library() now returns Arc — unwrap with Arc::unwrap_or_clone() where owned Library is needed
  • PackageManifest::new() now returns Result
  • Package.version changed from Option to Version
  • Replace removed MastArtifact/PackageKind re-exports with TargetType
  • Access package.mast (Arc) directly instead of matching on MastArtifact
    enum

@djolertrk djolertrk marked this pull request as draft April 7, 2026 10:27
@djolertrk djolertrk force-pushed the main branch 2 times, most recently from 097e895 to f6fb407 Compare April 7, 2026 10:39
@djolertrk
Copy link
Copy Markdown
Contributor Author

cc @bitwalker @greenhat -- but It looks like we have some problems with new licences from dependencies.

@bitwalker
Copy link
Copy Markdown
Collaborator

We can definitely allow MPL-2.0 as a license, it just wasn't explicitly added as a supported license before.

@djolertrk djolertrk marked this pull request as ready for review April 7, 2026 11:33
@bobbinth
Copy link
Copy Markdown
Contributor

bobbinth commented Apr 7, 2026

We can definitely allow MPL-2.0 as a license, it just wasn't explicitly added as a supported license before.

What are the implications of this? Can a project that has a dependency with an MLP license be licensed under MIT? Or do we need to change licenses here somehow?

@bobbinth
Copy link
Copy Markdown
Contributor

bobbinth commented Apr 7, 2026

Also, I somehow missed that miden-vm v0.22.1 has API-level breaking changes. cc @igamigo in case this becomes an issue for the client (we may want to hold off on releasing the client before I release miden-protocol v0.14.3).

@djolertrk
Copy link
Copy Markdown
Contributor Author

Also, I somehow missed that miden-vm v0.22.1 has API-level breaking changes. cc @igamigo in case this becomes an issue for the client (we may want to hold off on releasing the client before I release miden-protocol v0.14.3).

I would still want this 0xMiden/miden-client#1959 to be integrated into the miden-client release, since it is the last piece to enable real transaction debugging with our debugger. (cc @bitwalker)

@bobbinth
Copy link
Copy Markdown
Contributor

bobbinth commented Apr 7, 2026

I would still want this 0xMiden/miden-client#1959 to be integrated into the miden-client release, since it is the last piece to enable real transaction debugging with our debugger. (cc @bitwalker)

I'm going to try to make a PR in miden-vm that will convert this to a non-breaking change. If this works, I'll yank v0.22.1 and will release v0.22.2 which should be functionally the same but non-breaking.

@bobbinth bobbinth requested review from bobbinth, huitseeker, igamigo and mmagician and removed request for bobbinth April 7, 2026 16:36
Copy link
Copy Markdown
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you! I wasn't able to find a way to patch v0.22.1 such that it contains non-breaking changes. So, we'll need to proceed with this PR and yank all v0.22.0 VM and protocol/node crates that rely on it.

I also left a comment for the future - but that's more relevant for the miden-vm repo.

Comment on lines 252 to 263
let package_with_metadata = Package {
name: "test_package".to_string(),
mast: MastArtifact::Library(Arc::new(library.clone())),
manifest: PackageManifest::new(None),
kind: PackageKind::AccountComponent,
name: "test_package".into(),
mast: library.clone(),
manifest: PackageManifest::new(core::iter::empty()).unwrap(),
kind: TargetType::AccountComponent,
sections: vec![Section::new(
SectionId::ACCOUNT_COMPONENT_METADATA,
metadata_bytes.clone(),
)],
version: Default::default(),
version: Version::new(0, 0, 0),
description: None,
};
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.

Not for this PR, but looking at this now, I think we may want to make all fields in the Package private and expose them via accessors - otherwise, it may be too easy to construct invalid packages.

Also, renaming from PackageKind to TargetType feels a bit off. So, we should probably consider renaming it back. cc @bitwalker.

Copy link
Copy Markdown
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

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

LGTM overall (low context on protocol — so low confidence on semantics, but the rust changes do seem minimally invasive).
Checked MPL change, which LGTM (minimal, file-level copyleft). Checked node does not use MastArtifact/PackageKind and does not build TargetType::Executable packages (or packages of any kind).
Left inline note on versioning.

ProcedureExport,
Section,
SectionId,
TargetType,
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.

This looks like a source-breaking API change for the current 0.14.x line. Technically, downstream code importing MastArtifact or PackageKind from miden_protocol::vm will stop compiling here unless we release at a major version.

@bobbinth bobbinth merged commit 957330e into 0xMiden:main Apr 7, 2026
15 checks passed
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.

4 participants