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

fix: generate correct metadata when overflowing signed short values #1821

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

edusperoni
Copy link
Collaborator

Follow up of #1749

What I initally identified as some kind of circular reference is the children turned out to be the result of a wrong short -> unsigned short translation in the metadata generator.

It's impossible for the metadata generator to generate a nextSiblingId that is smaller than the actual node id. As such, this PR adds a few protections in place:

  1. We fix the combination of 2 unsigned shorts into a single int
  2. If we're ever close to overflowing these shorts, the metadata will error out. We should re-evaluate wheter or not we should use 32 bit numbers for this, as that increases the metadata overall size
  3. When in debug mode (--log trace) we now generate a json with all the contents of the binary file.
  4. If we ever get into this situation again, the runtime will log this error so the user can provide the error combined with the previously mentioned debug json for us to fix.

@edusperoni edusperoni merged commit c9fac4b into main Sep 2, 2024
2 checks passed
@edusperoni edusperoni deleted the fix/metadata-gen-unsigned-short branch September 3, 2024 17:20
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.

1 participant