feat(AggLayer): Solidity compatibility tests for MMR frontier code#2312
Merged
feat(AggLayer): Solidity compatibility tests for MMR frontier code#2312
Conversation
in leaf assertion tests
into leaf<>root<>count paris; and canonical zeros
mmagician
commented
Jan 19, 2026
crates/miden-agglayer/solidity-compat/test/MMRTestVectors.t.sol
Outdated
Show resolved
Hide resolved
crates/miden-agglayer/solidity-compat/test/MMRTestVectors.t.sol
Outdated
Show resolved
Hide resolved
crates/miden-agglayer/solidity-compat/test/MMRTestVectors.t.sol
Outdated
Show resolved
Hide resolved
partylikeits1983
requested changes
Jan 20, 2026
Member
partylikeits1983
left a comment
There was a problem hiding this comment.
Looks great! Only comment is to remove console.log()s from tests & to use foundry cheatcode instead of doing string manipulation in solidity :)
PhilippGackstatter
approved these changes
Jan 20, 2026
Contributor
PhilippGackstatter
left a comment
There was a problem hiding this comment.
Looks good to me! I reviewed the structure and the Rust tests, but can't comment too much on Solidity code.
mmagician
added a commit
that referenced
this pull request
Jan 27, 2026
…2312) * feat: impl fist frontier version, add (yet buggy) test * test: fix the test, fix the bug in algorithm * chore: update changelog * docs: add docs for the MMR frontier in the masm file * refactor: update the doc comments, slightly update code * refactor: update docs and comments, add overflow check, update test * test: add more leaves * test: add zero root test * chore: rename `root` -> `expected_root` in leaf assertion tests * chore: lint * chore: revert to using old dir structure * feat: generate test vectors with foundry * feat: use agglayer submodule instead of copying source files * chore: use generated test vectors in compat tests * chore: remove the human-readable fn * chore: split test vectors into leaf<>root<>count paris; and canonical zeros * chore: remove unnecessary metadata * chore: cleanup readme * changelog * chore: ignore submodule from typos check * chore: exclude submodule from toml fmt * fix: update max leaves constants and comments * chore: regen errors file * refactor: use foundry cheatcode (#2314) * chore: use workspace serde dep * chore: cleanup changelog --------- Co-authored-by: Andrey Khmuro <akhmuro@gmail.com> Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
mmagician
added a commit
that referenced
this pull request
Jan 27, 2026
…2312) * feat: impl fist frontier version, add (yet buggy) test * test: fix the test, fix the bug in algorithm * chore: update changelog * docs: add docs for the MMR frontier in the masm file * refactor: update the doc comments, slightly update code * refactor: update docs and comments, add overflow check, update test * test: add more leaves * test: add zero root test * chore: rename `root` -> `expected_root` in leaf assertion tests * chore: lint * chore: revert to using old dir structure * feat: generate test vectors with foundry * feat: use agglayer submodule instead of copying source files * chore: use generated test vectors in compat tests * chore: remove the human-readable fn * chore: split test vectors into leaf<>root<>count paris; and canonical zeros * chore: remove unnecessary metadata * chore: cleanup readme * changelog * chore: ignore submodule from typos check * chore: exclude submodule from toml fmt * fix: update max leaves constants and comments * chore: regen errors file * refactor: use foundry cheatcode (#2314) * chore: use workspace serde dep * chore: cleanup changelog --------- Co-authored-by: Andrey Khmuro <akhmuro@gmail.com> Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
mmagician
added a commit
that referenced
this pull request
Jan 27, 2026
…2312) * feat: impl fist frontier version, add (yet buggy) test * test: fix the test, fix the bug in algorithm * chore: update changelog * docs: add docs for the MMR frontier in the masm file * refactor: update the doc comments, slightly update code * refactor: update docs and comments, add overflow check, update test * test: add more leaves * test: add zero root test * chore: rename `root` -> `expected_root` in leaf assertion tests * chore: lint * chore: revert to using old dir structure * feat: generate test vectors with foundry * feat: use agglayer submodule instead of copying source files * chore: use generated test vectors in compat tests * chore: remove the human-readable fn * chore: split test vectors into leaf<>root<>count paris; and canonical zeros * chore: remove unnecessary metadata * chore: cleanup readme * changelog * chore: ignore submodule from typos check * chore: exclude submodule from toml fmt * fix: update max leaves constants and comments * chore: regen errors file * refactor: use foundry cheatcode (#2314) * chore: use workspace serde dep * chore: cleanup changelog --------- Co-authored-by: Andrey Khmuro <akhmuro@gmail.com> Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
mmagician
added a commit
that referenced
this pull request
Jan 27, 2026
…2312) * feat: impl fist frontier version, add (yet buggy) test * test: fix the test, fix the bug in algorithm * chore: update changelog * docs: add docs for the MMR frontier in the masm file * refactor: update the doc comments, slightly update code * refactor: update docs and comments, add overflow check, update test * test: add more leaves * test: add zero root test * chore: rename `root` -> `expected_root` in leaf assertion tests * chore: lint * chore: revert to using old dir structure * feat: generate test vectors with foundry * feat: use agglayer submodule instead of copying source files * chore: use generated test vectors in compat tests * chore: remove the human-readable fn * chore: split test vectors into leaf<>root<>count paris; and canonical zeros * chore: remove unnecessary metadata * chore: cleanup readme * changelog * chore: ignore submodule from typos check * chore: exclude submodule from toml fmt * fix: update max leaves constants and comments * chore: regen errors file * refactor: use foundry cheatcode (#2314) * chore: use workspace serde dep * chore: cleanup changelog --------- Co-authored-by: Andrey Khmuro <akhmuro@gmail.com> Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
mmagician
added a commit
that referenced
this pull request
Jan 27, 2026
…2312) * feat: impl fist frontier version, add (yet buggy) test * test: fix the test, fix the bug in algorithm * chore: update changelog * docs: add docs for the MMR frontier in the masm file * refactor: update the doc comments, slightly update code * refactor: update docs and comments, add overflow check, update test * test: add more leaves * test: add zero root test * chore: rename `root` -> `expected_root` in leaf assertion tests * chore: lint * chore: revert to using old dir structure * feat: generate test vectors with foundry * feat: use agglayer submodule instead of copying source files * chore: use generated test vectors in compat tests * chore: remove the human-readable fn * chore: split test vectors into leaf<>root<>count paris; and canonical zeros * chore: remove unnecessary metadata * chore: cleanup readme * changelog * chore: ignore submodule from typos check * chore: exclude submodule from toml fmt * fix: update max leaves constants and comments * chore: regen errors file * refactor: use foundry cheatcode (#2314) * chore: use workspace serde dep * chore: cleanup changelog --------- Co-authored-by: Andrey Khmuro <akhmuro@gmail.com> Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
mmagician
added a commit
that referenced
this pull request
Jan 27, 2026
…2312) * feat: impl fist frontier version, add (yet buggy) test * test: fix the test, fix the bug in algorithm * chore: update changelog * docs: add docs for the MMR frontier in the masm file * refactor: update the doc comments, slightly update code * refactor: update docs and comments, add overflow check, update test * test: add more leaves * test: add zero root test * chore: rename `root` -> `expected_root` in leaf assertion tests * chore: lint * chore: revert to using old dir structure * feat: generate test vectors with foundry * feat: use agglayer submodule instead of copying source files * chore: use generated test vectors in compat tests * chore: remove the human-readable fn * chore: split test vectors into leaf<>root<>count paris; and canonical zeros * chore: remove unnecessary metadata * chore: cleanup readme * changelog * chore: ignore submodule from typos check * chore: exclude submodule from toml fmt * fix: update max leaves constants and comments * chore: regen errors file * refactor: use foundry cheatcode (#2314) * chore: use workspace serde dep * chore: cleanup changelog --------- Co-authored-by: Andrey Khmuro <akhmuro@gmail.com> Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
partylikeits1983
added a commit
that referenced
this pull request
Feb 12, 2026
…2312) * feat: impl fist frontier version, add (yet buggy) test * test: fix the test, fix the bug in algorithm * chore: update changelog * docs: add docs for the MMR frontier in the masm file * refactor: update the doc comments, slightly update code * refactor: update docs and comments, add overflow check, update test * test: add more leaves * test: add zero root test * chore: rename `root` -> `expected_root` in leaf assertion tests * chore: lint * chore: revert to using old dir structure * feat: generate test vectors with foundry * feat: use agglayer submodule instead of copying source files * chore: use generated test vectors in compat tests * chore: remove the human-readable fn * chore: split test vectors into leaf<>root<>count paris; and canonical zeros * chore: remove unnecessary metadata * chore: cleanup readme * changelog * chore: ignore submodule from typos check * chore: exclude submodule from toml fmt * fix: update max leaves constants and comments * chore: regen errors file * refactor: use foundry cheatcode (#2314) * chore: use workspace serde dep * chore: cleanup changelog --------- Co-authored-by: Andrey Khmuro <akhmuro@gmail.com> Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
afa7789
pushed a commit
to afa7789/miden-base
that referenced
this pull request
Mar 9, 2026
…xMiden#2312) * feat: impl fist frontier version, add (yet buggy) test * test: fix the test, fix the bug in algorithm * chore: update changelog * docs: add docs for the MMR frontier in the masm file * refactor: update the doc comments, slightly update code * refactor: update docs and comments, add overflow check, update test * test: add more leaves * test: add zero root test * chore: rename `root` -> `expected_root` in leaf assertion tests * chore: lint * chore: revert to using old dir structure * feat: generate test vectors with foundry * feat: use agglayer submodule instead of copying source files * chore: use generated test vectors in compat tests * chore: remove the human-readable fn * chore: split test vectors into leaf<>root<>count paris; and canonical zeros * chore: remove unnecessary metadata * chore: cleanup readme * changelog * chore: ignore submodule from typos check * chore: exclude submodule from toml fmt * fix: update max leaves constants and comments * chore: regen errors file * refactor: use foundry cheatcode (0xMiden#2314) * chore: use workspace serde dep * chore: cleanup changelog --------- Co-authored-by: Andrey Khmuro <akhmuro@gmail.com> Co-authored-by: Alexander John Lee <77119221+partylikeits1983@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As suggested here, we're getting to a stage with the AggLayer integration where we should check for compatibility with the Solidity implementation.
This PR adds a small foundry project inside the
miden-agglayercrate:forgecommands to generate the test vectors. The vectors are generated by calling the Solidity functions of interest_addLeaf&getRootmake generate-solidity-test-vectorscommand to locally re-generate the test filesKeccakMmrFrontier32(currently we're not comparing with the output of MASM, since we independently already have Rust<>MASM compatibility test, so by extension we have Solidity<>MASM compat)To be done in a follow-up PR:
miden-testing/agglayercode intomiden-agglayercrate. Otherwise, the Rust compat test (located inmiden-testingdepends on the test vectors which are generated in a different crate (miden-agglayer)