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

fix: return message id on waku_relay_publish #2485

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

richard-ramos
Copy link
Member

Description

As defined in the bindings, waku_relay_publish returns a message id on success

Copy link

github-actions bot commented Feb 28, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2485

Built from bb57b8c

Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

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

LGTM, thanks so much!

Copy link
Contributor

@SionoiS SionoiS left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

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

Great! Thanks for it!

@Ivansete-status
Copy link
Collaborator

Hey @richard-ramos ! Sorry for confusion but right after approving the PR I thought that it may be more convenient to use the same mechanism that we have to generate the msd_id within GossipSub:

proc defaultMessageIdProvider*(message: messages.Message): Result[MessageID, ValidationResult] =
let hash = sha256.digest(message.data)
ok(@(hash.data))

@richard-ramos
Copy link
Member Author

I thought that it may be more convenient to use the same mechanism that we have to generate the msd_id within GossipSub

Actually, it is the messageHash we need! so that makes me think that i have to rename the messageId field in https://rfc.vac.dev/spec/36/#jsonmessageevent-type to messageHash. WDYT? I can do that change in this PR

@Ivansete-status
Copy link
Collaborator

I thought that it may be more convenient to use the same mechanism that we have to generate the msd_id within GossipSub

Actually, it is the messageHash we need! so that makes me think that i have to rename the messageId field in https://rfc.vac.dev/spec/36/#jsonmessageevent-type to messageHash. WDYT? I can do that change in this PR

Ok cool! I think messageHash sounds better but no need to rush for that change

@richard-ramos
Copy link
Member Author

Implemented the change in last commit :)

@richard-ramos richard-ramos merged commit 045091a into master Mar 1, 2024
8 of 10 checks passed
@richard-ramos richard-ramos deleted the fix/msg-id-publish branch March 1, 2024 00:58
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.

4 participants