-
Notifications
You must be signed in to change notification settings - Fork 60
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
feat: standardize the approach used to identify messages (msgHash or msgId) #2498
Comments
This may not be feasible as Some related issues and docs: |
Thanks @jm-clius! |
We could use IPLD. That way we get globally unique CID for each message and various codecs (cbor, json, etc..). |
I can only talk from my experience of using go-waku, but I think we should keep the handling for message IDs and message hashes as it is implemented right now, and maybe just rename any instance of The reasons why i suggest not doing this change is:
|
Closing this as not needed for now |
Problem
Nowadays we have implemented two different ways to identify a message:
Message Hash (
sha256( pubsubTopic + message )
):https://github.com/waku-org/nwaku/blob/master/waku/waku_core/message/digest.nim#L29-L40
Message ID (
sha256( message )
):https://github.com/waku-org/nwaku/blob/master/waku/waku_relay/message_id.nim#L31-L33
The
message_hash
is extensively used in Waku side to overcome the lack of deterministic hashing in protobuf encoding.Besides, the
message_id
is mostly used withinGossipSub
to drop an already-seen message. https://github.com/status-im/nim-libp2p/blob/349496e40fcae9f225c437662b5bbe3c6b6eb3af/libp2p/protocols/pubsub/gossipsub.nim#L474-L475Suggested solution
This suggests two points:
msgId
ormsgHash
.sha256( pubsubTopic + message )
.Alternatives considered
msgHash
in Waku and only considermsgId
.msgId
within GossipSub and usemsgHash
as we are using in Waku.For both alternatives, the proposed computation should be
sha256( pubsubTopic + message )
.The text was updated successfully, but these errors were encountered: