Skip to content

refactor: simplify MockChainNote to always hold full note details#2829

Closed
AlgofootPrint wants to merge 7 commits into0xMiden:nextfrom
AlgofootPrint:refactor-mock-chain-note
Closed

refactor: simplify MockChainNote to always hold full note details#2829
AlgofootPrint wants to merge 7 commits into0xMiden:nextfrom
AlgofootPrint:refactor-mock-chain-note

Conversation

@AlgofootPrint
Copy link
Copy Markdown

Summary

Closes #2307

  • Replaces the Public(Note, NoteInclusionProof) / Private(NoteId, NoteMetadata, NoteInclusionProof) enum with a
    plain struct holding note: Note and inclusion_proof: NoteInclusionProof
  • Removes the post-genesis "upgrade Private→Public" workaround in from_genesis_block; private genesis notes are now
    inserted directly using inclusion proofs computed from the genesis block
  • TryFrom<MockChainNote> for InputNote becomes From (no longer fallible) since the full note is always present
  • Serialization drops the discriminant byte — the struct writes note then proof directly

Test plan

  • Existing mock_chain_serialization, private_account_state_update, and other MockChain tests pass
  • No callers of MockChainNote outside of miden-testing (confirmed by grep)

mmagician and others added 7 commits April 9, 2026 14:27
* fix: must padw before loading SERIAL_NUM

* changelog
Co-authored-by: Claude (Opus) <noreply@anthropic.com>
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
)

Add benchmarks for CLAIM note (L1/L2 bridge-in) and B2AGG note
(bridge-out) consumption alongside existing P2ID benchmarks.

- Move shared test vector types and lazy-parsed vectors into
  miden_agglayer::testing module for reuse across tests and benchmarks
- Add benchmark setup functions for CLAIM and B2AGG transactions
- Add cycle count assertions for CLAIM note processing (max 64k cycles)

Co-authored-by: Claude (Opus) <noreply@anthropic.com>
Co-authored-by: partylikeits1983 <partylikeits1983@users.noreply.github.com>
Co-authored-by: Bobbin Threadbare <43513081+bobbinth@users.noreply.github.com>
…en#2822)

* refactor: make all notes be libs, update CodeBuilder::compile_note_script

* refactor: compile and store note script libs instead of scripts themselves

* chore: fix comment format

* chore: increment crate versions to v0.14.5

---------

Co-authored-by: Bobbin Threadbare <bobbinth@protonmail.com>
Replaces the Public/Private enum variants with a single struct containing a
Note and NoteInclusionProof. The note's privacy is carried by the Note itself,
so the wrapper no longer needs to distinguish variants. Removes the post-genesis
upgrade hack in from_genesis_block and simplifies serialization.

Closes 0xMiden#2307
@bobbinth
Copy link
Copy Markdown
Contributor

Closing as duplicate of #2764.

@bobbinth bobbinth closed this Apr 26, 2026
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.

Refactor MockChainNote to always hold the full note details

5 participants