Closed PhilippGackstatter closed 2 weeks ago
I'm wondering if we should try the approach I described in https://github.com/0xPolygonMiden/miden-vm/pull/1534#discussion_r1811370694 before going with this direction.
@plafer @bitwalker Do you want to go ahead with this PR? I just rebased and it's ready from my side.
Describe your changes
Permit child
MastNodeId
s to exceed theMastNodeId
s of their parents during deserialization. This came up in the context of #1534 (see this comment chain for details).Deserialization seems to be the only place where we had a requirement on the mentioned property, judging by the uses of
MastNodeId::from_u32_safe
.A new constructor for
MastNodeId
was introduced that is similar to the existing one, except that it checks against a total expected node count of the forest instead of the current node count of the forest. This allows child IDs to exceed their parent's IDs, such as in a forest likeHowever, we still want forests like this to fail during deserialization:
And the added constructor handles these scenarios and both are tested.
Checklist before requesting a review
next
according to naming convention.