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

chore: increase meta size to 64 bytes + tests #1629

Merged
merged 1 commit into from
Mar 30, 2023
Merged

Conversation

alrevuelta
Copy link
Contributor

@alrevuelta alrevuelta commented Mar 29, 2023

Related vacp2p/rfc#589

  • Increases the maximum size if the meta field from 32 to 64 bytes.
  • Adds a test vector the the 64 bytes case, since it has a very specific use case.
  • Adds a test to ensure the message can't be decoded if meta field is over the limit.

@alrevuelta alrevuelta marked this pull request as ready for review March 29, 2023 11:24
Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@LNSD LNSD left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +67 to +70
byteutils.toHex(pubsubTopic.toBytes()) == "2f77616b752f322f64656661756c742d77616b752f70726f746f"
byteutils.toHex(message.contentTopic.toBytes()) == "2f77616b752f322f64656661756c742d636f6e74656e742f70726f746f"
byteutils.toHex(message.payload) == "010203045445535405060708"
byteutils.toHex(message.meta) == "73757065722d736563726574"
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is necessary. It adds more work in case we want to update the test case 🤷🏼

@alrevuelta alrevuelta merged commit 1f79375 into master Mar 30, 2023
12 checks passed
@alrevuelta alrevuelta deleted the increase-meta-field branch March 30, 2023 08:38
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.

None yet

3 participants