Skip to content

Conversation

@danielpapp-trilitech
Copy link
Contributor

@danielpapp-trilitech danielpapp-trilitech commented Nov 28, 2025

Relates to RV-829

What

  • Replaced MerkleTree::Leaf tuple with a struct
  • Removed the impl_modify_map_collect function
  • Replaced the uses of the mentioned function with a non-recursive direct implementation.

Why

We need to store data in the internal nodes of Merkle-like trees. This PR is part of that effort.

How

Remove impl_modify_map_collect and replace it with something more flexible. Extract the leaf data from the MerkleTree so that it's easier to operate on it.

Manually Testing

make all

Regressions

Tasks for the Author

  • Link all Linear issues related to this MR using magic words (e.g. part of, relates to, closes).
  • Eliminate dead code and other spurious artefacts introduced in your changes.
  • Document new public functions, methods and types.
  • Make sure the documentation for updated functions, methods, and types is correct.
  • Add tests for bugs that have been fixed.
  • Explain changes to regression test captures when applicable.
  • Write commit messages in agreement with our guidelines.
  • Self-review your changes to ensure they are high-quality.
  • Complete all of the above before assigning this MR to reviewers.

@github-actions
Copy link

github-actions bot commented Nov 28, 2025

Benchmark results for revision c49c6d6:

Metric Duration TPS
Mean 1.524282325s 26.242
Worst 1.532877724s 26.095
Best 1.517162313s 26.365
Standard Deviation ±4.317972ms ±0.074
Full results
Run Transfers Duration TPS
1 40 1.520223217s 26.312
2 40 1.530782283s 26.130
3 40 1.531324488s 26.121
4 40 1.523912704s 26.248
5 40 1.532877724s 26.095
6 40 1.519768839s 26.320
7 40 1.531002224s 26.127
8 40 1.522088255s 26.280
9 40 1.521846244s 26.284
10 40 1.52468562s 26.235
11 40 1.519036537s 26.332
12 40 1.526433449s 26.205
13 40 1.52476934s 26.233
14 40 1.523579881s 26.254
15 40 1.521673924s 26.287
16 40 1.522643817s 26.270
17 40 1.517162313s 26.365
18 40 1.520431143s 26.308
19 40 1.526750908s 26.199
20 40 1.524653582s 26.235

Compare the results above with those for the default branch.

@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

❌ Patch coverage is 98.84393% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 91.26%. Comparing base (792789c) to head (693f480).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
data/src/merkle_proof/proof_tree.rs 98.66% 1 Missing ⚠️
...iscv/lib/src/state_backend/proof_backend/merkle.rs 98.71% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #535      +/-   ##
==========================================
- Coverage   91.26%   91.26%   -0.01%     
==========================================
  Files         110      108       -2     
  Lines       20197    20233      +36     
  Branches    20197    20233      +36     
==========================================
+ Hits        18433    18465      +32     
- Misses       1388     1392       +4     
  Partials      376      376              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@danielpapp-trilitech danielpapp-trilitech force-pushed the dpapp/rv-829/part-1 branch 2 times, most recently from d41c000 to 02848d5 Compare November 28, 2025 15:37
@danielpapp-trilitech
Copy link
Contributor Author

I went through the diff. I added docs to everything new that I created with public visibility or what I moved and kept the public visibility. Let me know if I've missed anything!

Copy link
Collaborator

@vapourismo vapourismo left a comment

Choose a reason for hiding this comment

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

The commit message makes it appear like it should be 3 commits.

@vapourismo
Copy link
Collaborator

I noticed this PR hasn't received updates in a bit and currently can't land due to the merge conflicts. I'm marking this as draft for now.

@vapourismo vapourismo marked this pull request as draft December 8, 2025 10:23
@danielpapp-trilitech danielpapp-trilitech force-pushed the dpapp/rv-829/part-1 branch 2 times, most recently from 841cce4 to eba7d33 Compare January 12, 2026 17:09
@danielpapp-trilitech danielpapp-trilitech marked this pull request as ready for review January 12, 2026 17:10
Copy link
Contributor

@kurtisc kurtisc left a comment

Choose a reason for hiding this comment

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

The commit message title isn't clear, I don't want understanding the most prominent part of a public commit depend on having access to the private Linear tickets. The title should explain what applying this commit does, see https://github.com/tezos/riscv-pvm/blob/main/docs/contributing/commit-messages.md.

I don't think the (data) scope in the title is correct or necessary, which means you'd have more space. Ideally the title is <= 50 characters but this isn't consistently followed in this repo.

Finally, the tense used for the body of the git commit should be present, as it's what the patch is 'doing'. The body lists three things, one of which is a replacement for removing another. That makes me think this should have been two commits, one for changing to use a struct and the other for replacing impl_modify_map_collect.

Copy link
Contributor Author

Ok. I tried to address your comments regarding the commit message. As for splitting the change into two commits. I prefer to keep it as is.

@kurtisc
Copy link
Contributor

kurtisc commented Jan 13, 2026

Ok. I tried to address your comments regarding the commit message.

It's almost there but I'd change it to

refactor: Enable the node variant of Merkle tree to contain data
- Removes MerkleTree::Leaf tuple with a struct
- Removes the impl_modify_map_collect function
- Replaces the uses of the mentioned function
  with a non-recursive direct implementation.

While the title should be imperative, the body can still be present tense, active voice.

As for splitting the change into two commits. I prefer to keep it as is.

Sure. I think splitting it in this PR is more effort than it's worth but it's easier to review future PRs that keep them separate.

Copy link
Contributor Author

Updated the commit message. Thanks for the review!

Copy link
Contributor

@emturner emturner left a comment

Choose a reason for hiding this comment

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

some initial comments

@danielpapp-trilitech danielpapp-trilitech force-pushed the dpapp/rv-829/part-1 branch 3 times, most recently from df56110 to 8821f63 Compare January 19, 2026 11:55
@danielpapp-trilitech danielpapp-trilitech force-pushed the dpapp/rv-829/part-1 branch 3 times, most recently from 2ab6063 to ff33af1 Compare January 19, 2026 18:08
- Removes MerkleTree::Leaf tuple with a struct
- Removes the impl_modify_map_collect function
- Replaces the uses of the mentioned function
  with a non-recursive direct implementation.
@danielpapp-trilitech danielpapp-trilitech added this pull request to the merge queue Jan 21, 2026
Merged via the queue into main with commit 29ee36d Jan 21, 2026
8 checks passed
@danielpapp-trilitech danielpapp-trilitech deleted the dpapp/rv-829/part-1 branch January 21, 2026 11:59
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.

6 participants