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

Refactor gossipsub message-id #2039

Closed
blacktemplar opened this issue Sep 7, 2020 · 3 comments · Fixed by #2044
Closed

Refactor gossipsub message-id #2039

blacktemplar opened this issue Sep 7, 2020 · 3 comments · Fixed by #2044

Comments

@blacktemplar
Copy link
Contributor

Currently the gossipsub message-id is specified as:

message-id: base64(SHA256(message.data))

The base64 is there since in the earlier gossispub spec versions message-id had to be a string but this changed a while ago (see libp2p/specs@8e5da40#diff-b6f4ac67de1a41957e8f97f5728669b7), so now message-ids can be arbitrary bytes. I therefore propose changing the message-id to simply:

message-id: SHA256(message.data)

This will save us valuable bandwith (especially for IHAVE and IWANT messages that contain mostly only message ids). Furthermore, it is in my opinion cleaner than using the byte representation of a base64 string.

As we recently found out, until now Prysm used a different message id than defined in the spec (see prysmaticlabs/prysm#7177) which was not really a problem for Medalla. We only found out about the inconsistency during testing gossipsub peer scoring. In fact if no peer scoring is active the only problem with inconsistent message id functions is that there will be more gossipping happening (since message ids in IHAVE will not coincide with the computed message ids of the received messages).

So I propose to do this change before most of the clients activate gossipsub scoring which would penalize inconsistent message id functions and would make it harder to switch.

@AgeManning
Copy link
Contributor

Agree! I think all the clients can implement it asynchronously.

@raulk
Copy link
Contributor

raulk commented Sep 8, 2020

SGTM!

@prestonvanloon
Copy link
Contributor

prestonvanloon commented Sep 8, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants