Skip to content

Add basic test vectors for the Portal wire protocol #106

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

Merged
merged 2 commits into from
Nov 16, 2021

Conversation

kdeme
Copy link
Collaborator

@kdeme kdeme commented Nov 6, 2021

Adding some basic test vectors to resolve #101

These were generated with the Fluffy implementation (this branch: https://github.com/status-im/nimbus-eth1/tree/use-ssz-union) and the test cases can also be seen/run from this test: https://github.com/status-im/nimbus-eth1/blob/use-ssz-union/fluffy/tests/test_portal_wire_encoding.nim.

That branch should implement the latest Portal wire specification, but there might be mistakes obviously. If something looks odd or is unclear, let me know.

#### Input Parameters
```
connection_id = [0x01, 0x02]
content_keys = [1, 0, 0, 0, 0, 0, 0, 0] # 8 bits bitlist, 0 bit set = byte 0x01
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure if this is clear. How to best represent here a bitlist?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is fine with the bitlist annotation. In JS, I'm mapping this to an actual array of Booleans and evidently there is something wrong with my encoding since your inputs produce 08010206000000ff01 when I serialize it.

@kdeme kdeme merged commit 78cacca into ethereum:master Nov 16, 2021
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.

Test vectors for Portal Wire Protocol messages
2 participants