Skip to content

chore: bump miden-protocol dependencies to 0.17.0-rc.4 - #2617

Draft
sofiazcoaga wants to merge 1 commit into
nextfrom
chore/bump-miden-protocol-0.17.0-rc.4
Draft

chore: bump miden-protocol dependencies to 0.17.0-rc.4#2617
sofiazcoaga wants to merge 1 commit into
nextfrom
chore/bump-miden-protocol-0.17.0-rc.4

Conversation

@sofiazcoaga

@sofiazcoaga sofiazcoaga commented Sep 11, 2026

Copy link
Copy Markdown

Summary

Upgrade to miden-protocol 0.17.0-rc.4. Needed to integrate the same version in the client.

Main changes:

  • Bump the seven miden-protocol crates from 0.17.0-rc.3 to 0.17.0-rc.4.
  • Replace every canonical TryFrom<proto> conversion with decode_fields() plus an explicit verify(), verify_with(context) or build_unchecked().
  • Add verify_field, verify_value, verify_optional and the verify! macro.

Changelog

changelog = "none"
reason    = "Internal change only."

@Mirko-von-Leipzig Mirko-von-Leipzig left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

As mentioned in one of the comments, we should be using the actual miden-protobuf traits to replace all of our own TryFrom implementations.

Its unclear how much extra work that entails, so I'm okay with merging this as an intermediate form to unblock the client.

Comment on lines +285 to +287
.context("Failed to decode block header")?
.build_unchecked()
.context("Failed to build block header")?;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.context("Failed to decode block header")?
.build_unchecked()
.context("Failed to build block header")?;
.context("failed to decode block header")?
.build_unchecked()
.context("failed to build block header")?;

Comment on lines +820 to +822
.context("Failed to decode block header")?
.build_unchecked()
.context("Failed to build block header")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
.context("Failed to decode block header")?
.build_unchecked()
.context("Failed to build block header")
.context("failed to decode block header")?
.build_unchecked()
.context("failed to build block header")

Comment on lines +1189 to +1195
let value: Word = match slot.content {
Some(SlotContent::Value(value)) => value.try_into().context("invalid slot value")?,
Some(SlotContent::MapRoot(_)) => {
anyhow::bail!("storage map slots are not supported for this account")
},
None => anyhow::bail!("missing slot value"),
};

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems to be a common pattern; perhaps something we should make easier? e.g. .as_value() -> Result<&Value> so one can write

        let value: Word = slot.content
                .as_value()
                .and_then(TryInto::try_into)
                .context("not a storage slot value")?;

Comment on lines +241 to +244
.decode_fields()
.context("failed to decode the funding note")?
.verify()
.context("failed to verify the funding note")?;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We should perhaps also make this easier. @kkovaacs perhaps we can add more extension traits that enable decode_and_verify() etc?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We shouldn't need these helpers. Instead we should be implementing the traits exposed by the miden-protobuf crate, same way the miden-objects crate does.

However, we can do that in a follow-up PR instead, which would let us merge quicker.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This would also include making our proto schema more precise so perhaps this is ok.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'll add the changes as a PR stack on top of this one.

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.

2 participants