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

tests that Vec<CrdsValue> (de)serialization round trips #3710

Conversation

behzadnouri
Copy link

Problem

#3575 reworks CrdsValue (de)serialization.
Need to verify that the serialization does not change and round trips.

Summary of Changes

  • added a round trip test for Vec<CrdsValue> (de)serialization.
  • also verifying serialized bytes against a hard-coded hash.

@behzadnouri behzadnouri force-pushed the gossip-test-crds-value-serialize-round-trip branch from 5829ddc to 45fc3ca Compare November 19, 2024 22:27
@behzadnouri behzadnouri force-pushed the gossip-test-crds-value-serialize-round-trip branch from 45fc3ca to 4ddaefd Compare November 19, 2024 22:31
@behzadnouri behzadnouri changed the title adds a round trip test for Vec<CrdsValue> (de)serialization tests that Vec<CrdsValue> (de)serialization round trips Nov 19, 2024
num_cpus = { workspace = true }
rand0-7 = { workspace = true }
rand_chacha0-2 = { workspace = true }

Choose a reason for hiding this comment

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

why do we need rand_cha_cha v2 here? Can we not get away with v3?

Copy link
Author

Choose a reason for hiding this comment

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

This code will not compile unless I use older versions for both rand and rand_chacha because Keypair::generate requires a rand 0.7 CryptoRng and rand_chacha 0.3 implements rand 0.8 CryptoRng which is not the same as 0.7 version.

Choose a reason for hiding this comment

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

love dependency hell lol. sounds good!

@behzadnouri behzadnouri merged commit fe7d37a into anza-xyz:master Nov 20, 2024
52 checks passed
@behzadnouri behzadnouri deleted the gossip-test-crds-value-serialize-round-trip branch November 20, 2024 02:07
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