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

Review 'reserved' field in header.rs for improved compatibility #137

Open
herr-seppia opened this issue Mar 7, 2024 · 1 comment · May be fixed by #144
Open

Review 'reserved' field in header.rs for improved compatibility #137

herr-seppia opened this issue Mar 7, 2024 · 1 comment · May be fixed by #144
Labels

Comments

@herr-seppia
Copy link
Member

Summary

The current Header.rs implementation includes a 'reserved' data field with 2 bytes reserved for future use. While reserving space for future use is acceptable, concerns have been raised regarding the following aspects:

  1. The uncommon size of 2 bytes, which may not be sufficient for potential informational fields in the future.
  2. Lack of a protocol version field, which could lead to conflicts and decreased network sustainability during future upgrades.

Possible solution design or implementation

The initial rationale behind the 2-byte reservation was to provide flexibility for users to parse the second byte based on changes to the first byte. However, valid concerns have been raised about potential parsing issues for new messages in old versions. To address this, we propose the following solution:

  • Reduce the 'reserved' field to 1 byte.
  • Utilize the value of this byte to specify the length of the next N bytes to parse (where N is specified in the first byte).

Additional context

This adjustment aims to maintain compatibility during upgrades, ensuring that even older versions can parse the header without fully understanding the content of reserved fields.

@herr-seppia
Copy link
Member Author

To be compatibile with previous library, the reserved field length need to be a 2 bytes len

herr-seppia added a commit that referenced this issue Apr 2, 2024
herr-seppia added a commit that referenced this issue Apr 2, 2024
@herr-seppia herr-seppia linked a pull request Apr 2, 2024 that will close this issue
herr-seppia added a commit that referenced this issue Apr 9, 2024
herr-seppia added a commit that referenced this issue Apr 9, 2024
herr-seppia added a commit that referenced this issue Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant