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

Improve MessagePack model #618

Merged
merged 8 commits into from
Jul 14, 2024
Merged

Improve MessagePack model #618

merged 8 commits into from
Jul 14, 2024

Conversation

jarmuszz
Copy link
Contributor

@jarmuszz jarmuszz commented Jul 7, 2024

Current implementation of the MessagePack model allows for creation of malformed objects as the ByteVector class (which underlays most of the types in the model) has a maximum length of Long.MaxValue bytes which is bigger than the specification defines for some types.

This PR proposes following changes:

  • Float32(ByteVector) -> Float32(Float)
  • Float64(ByteVector) -> Float64(Double)
  • Timestamp32(ByteVector) -> Timestamp64(Int)
  • Timestamp64(ByteVector, ByteVector) -> Timestamp64(Long) with nanoseconds and seconds fields
  • Timestamp96(ByteVector, ByteVector) -> Timestamp96(Int, Long)

Ref. #603

@jarmuszz jarmuszz requested a review from a team as a code owner July 7, 2024 14:32
@jarmuszz
Copy link
Contributor Author

jarmuszz commented Jul 7, 2024

I have currently held back from changing the integer types. UnsignedInt would have to hold a BigInt in order to keep a sign which is not quite performant. We could also bit cast it into a Long but I think it would be confusing for users.

Copy link
Member

@satabin satabin left a comment

Choose a reason for hiding this comment

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

Looks good to me, let's see if @ybasket has some comments.

@ybasket
Copy link
Collaborator

ybasket commented Jul 14, 2024

Looks good to me, let's see if @ybasket has some comments.

No, was only waiting for the small fix you had requested. LGTM

@ybasket ybasket merged commit fef8818 into gnieh:main Jul 14, 2024
14 checks passed
@satabin satabin added this to the 1.12.0 milestone Jul 28, 2024
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.

3 participants