zerokit
zerokit copied to clipboard
Review necessity of serialization utility functions
The utility functions in rln/src/utils.rs
are used across various serialization functions, and tests for them exist in rln/tests/protocol.rs
. However, it’s unclear whether all of these functions are actually necessary.
Tasks:
- Analyze the usage of each function in
utils.rs
to determine if they are all needed. - Check if any functionality is redundant or can be optimized.
- Consider simplifying or removing unused functions if possible.
Possible but maybe doesn't make sense
- Benchmark different serialization approaches to compare performance.
- Check with other team members to see what serialization methods they are using and whether these functions align with them.
Suggested changes
- Update this function regarding current version of RLN. https://github.com/vacp2p/zerokit/blob/1930ca1610b85d59909fbbb6936ca042b6ebf1b8/rln/src/protocol.rs#L353
Example: https://github.com/vacp2p/zerokit/blob/1930ca1610b85d59909fbbb6936ca042b6ebf1b8/rln/src/public_api_tests.rs#L696-L706
- Use this function inside test to avoid problem with serialisation https://github.com/vacp2p/zerokit/blob/1930ca1610b85d59909fbbb6936ca042b6ebf1b8/rln/src/protocol.rs#L371
One of place where need to replace: https://github.com/vacp2p/zerokit/blob/1930ca1610b85d59909fbbb6936ca042b6ebf1b8/rln/src/public_api_tests.rs#L724-L730
Related issue: https://github.com/vacp2p/zerokit/issues/21