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

chore: enhance libwaku store protocol and more #3223

Merged
merged 8 commits into from
Jan 3, 2025

Conversation

Ivansete-status
Copy link
Collaborator

Description

This PR was initially meant for enhancing how store protocol worked but it ended up collecting other enhancements

Changes

  • % not needed in library/events/json_message_event.nim because we want the messageHash be returned as a sequence, .e.g [121, 9, ..., 98].
  • libwaku.nim: avoid passing WakuRelayHandler(onReceivedMessage(ctx)), in waku_relay_publish because it doesn't make sense.
  • simple refactor in store_request.nim.
  • waku_thread.nim: addition of reqReceivedSignal to make sure every request is received (not processed) by The Waku Thread before the next request is sent to The Waku Thread.

How to test

Can be tested by using the toy-chat app. See waku-org/waku-rust-bindings#105

Impacted Issue

@Ivansete-status Ivansete-status marked this pull request as ready for review December 20, 2024 10:28
Copy link

github-actions bot commented Dec 20, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3223

Built from 21bf68e

Comment on lines +31 to +39
if jsonContent.contains("message_hashes"):
for hashJsonObj in jsonContent["message_hashes"].getElems():
var hash: WakuMessageHash
var count: int = 0
for byteValue in hashJsonObj.getElems():
hash[count] = byteValue.getInt().byte
count.inc()

hash
hash
Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same question as waku-org/waku-rust-bindings#105 (comment)

Yes good point! The reason for that is to make it work in the same way as relay:

let msgHash = computeMessageHash(pubSubTopic, msg)

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, thank you!

@Ivansete-status Ivansete-status merged commit 22ce9ee into master Jan 3, 2025
9 of 11 checks passed
@Ivansete-status Ivansete-status deleted the enhance-libwaku-store-new branch January 3, 2025 11:26
@Ivansete-status Ivansete-status restored the enhance-libwaku-store-new branch January 3, 2025 18:00
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.

3 participants