Skip to content

Migrate to the client v0.14#37

Open
greenhat wants to merge 13 commits intomainfrom
migrate-clien-v014
Open

Migrate to the client v0.14#37
greenhat wants to merge 13 commits intomainfrom
migrate-clien-v014

Conversation

@greenhat
Copy link
Copy Markdown
Contributor

@greenhat greenhat commented Mar 30, 2026

TODO:

  • switch to the released cargo-miden and move git tag;
  • migrate agent skills;
  • switch to the published miden-client v0.14;
  • move the v0.10 git tag;

Copy link
Copy Markdown
Collaborator

@Keinberger Keinberger left a comment

Choose a reason for hiding this comment

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

Hey @greenhat, nice work on this migration!

The skill file changes conflict with my PR #36 (Miden Day feedback corrections). I think the cleanest path is:

  1. I'll get #36 merged first (it's smaller and focused on content corrections, once you approve of course)
  2. Then you rebase #37 on top, which should auto-merge the testing-patterns file and leave 2 manual conflicts (patterns + pitfalls)

For the conflict resolution, I think we want to keep your v0.14 API updates and also preserve the still-valid Miden Day pitfalls (Felt::new Result, NoteType construction, note-to-component boundaries, note input immutability) with updated terminology.

I also let my AI agent run through the skill file changes to catch potential inaccuracies. It flagged 3 things in the inline comments below. Let me know if any of those are off.

Thanks!

// CORRECT for business logic — compare as integers
if balance.as_u64() > threshold.as_u64() { ... }
if balance.as_canonical_u64() > threshold.as_canonical_u64() { ... }
- [ ] `Recipient::compute(...)` replaced with `note::build_recipient(...)`
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.

Looks like a stray checklist item from editing. The Recipient::compute replacement is correctly documented in P8 below. This line should be remove

| `StorageValue<T>` | Single typed slot (flags, counters, IDs) | `.get() -> T` | `.set(T) -> T` |
| `StorageMap<K, V>` | Typed key-value mapping (balances, records) | `.get(K) -> V` | `.set(K, V) -> V` |

**Storage keys** are always `Word` (4 Felts). Use `Word::from_u64_unchecked(a, b, c, d)` or `Word::from([f0, f1, f2, f3])`.
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 think Word::from_u64_unchecked(a, b, c, d) doesn't exist on the Word type (checked miden-field v0.23.0 source). The code examples below correctly use Word::new([felt!(0), ...]) and Word::try_from([0_u64, ...]). I think this paragraph should be updated to match. (It's also stale in the compiler's own doc comments in output_note.rs, so might be worth a follow-up fix there too.)

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.

My PR #36 adds pitfalls P8-P14 covering Miden Day findings (Felt::new returning Result, NoteType variant construction, note-to-component call boundaries, note input immutability). Some of these are still valid in v0.14 and should be preserved during the rebase. Happy to help with the conflict resolution if needed.

@greenhat
Copy link
Copy Markdown
Contributor Author

Thank you! Fixed.

@greenhat greenhat requested a review from Keinberger April 14, 2026 08:31
@greenhat greenhat force-pushed the migrate-clien-v014 branch from c3a8256 to 290fbed Compare April 15, 2026 11:01
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