Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permit child MastNodeIds to exceed the MastNodeIds of their parents #1542

Open
wants to merge 1 commit into
base: next
Choose a base branch
from

Conversation

PhilippGackstatter
Copy link

Describe your changes

Permit child MastNodeIds to exceed the MastNodeIds 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 like

[Join(1, 2), Block(foo), Block(bar)]

However, we still want forests like this to fail during deserialization:

[Block(foo), Join(0, 2)]

And the added constructor handles these scenarios and both are tested.

Checklist before requesting a review

  • Repo forked and branch created from next according to naming convention.
  • Commit messages and codestyle follow conventions.
  • Relevant issues are linked in the PR description.
  • Tests added for new functionality.
  • Documentation/comments updated according to changes.

@PhilippGackstatter PhilippGackstatter changed the base branch from main to next October 22, 2024 08:07
@bobbinth
Copy link
Contributor

I'm wondering if we should try the approach I described in #1534 (comment) before going with this direction.

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.

2 participants