Filter empty values in Smt::with_entries
#383
Merged
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.
Describe your changes
The
partial_smt_root_mismatch_on_empty_values
test passes key-value pairs toSmt::with_entries
where some of the values areEMPTY_WORD
. This causes a panic in the concurrent subtree computation of theSmt
on currentnext
, e.g.: https://github.com/0xPolygonMiden/crypto/actions/runs/13387187735/job/37386455081#step:4:500.One fix is to make the test not pass empty values, which is actually unnecessary, since it's the default value. However, I think
with_entries
shouldn't panic when empty values are passed, so I fixed that instead by filtering them out early in the process.Checklist before requesting a review
next
according to naming convention.