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

feat: lightpush new protobuf proposal #20

Merged
merged 10 commits into from
Jun 28, 2024

Conversation

NagyZoltanPeter
Copy link
Contributor

@NagyZoltanPeter NagyZoltanPeter commented May 29, 2024

Based on waku-org/pm#93 this new version of lightpush protobuf protocol definition is proposed.

  • More specific fail case definition in response
    • error status description is now optional rather than hold the factual error cause.
    • error codes are more-or-less matching HTTP error code means
  • Response contains the number of successful relay peers.
  • Placeholder for request type - for future enhancements

As this is a breaking change compared to the original definition, we may consider to version the protocol allow clients to get adapted to new protocol format.

Open discussion topic: Can't we make pubsub_topic optional for lightpush protocol, indicating to handle message as auto-sharded routing? Currently we require from clients to know about how to compute proper shard from content-topic and make light push request properly with that computed shard topic. Although this can be simple handled on the service side. WDYT?

standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
Copy link

@alrevuelta alrevuelta left a comment

Choose a reason for hiding this comment

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

thanks, left some comments.

standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

Thanks! A couple of comments below, but direction lgtm

standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
Copy link
Contributor

@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.

Thanks for it! 🥳
Just added some comments so far that I hope you find useful

standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
@NagyZoltanPeter
Copy link
Contributor Author

#20 (comment)
@Ivansete-status: I think its better idea to put less such logic into the service side. I feel it more client side one. IMHO we might embed it into SDK rather than to the raw protocol.
Because what does LOW_NUMBER_OF_PEERS implies? Is it a fixed number by configuration which the client side might not know about or depends on other factors like due to bandwidth restriction we might decide to unsubscribe from some of the heavy load shards?
Counting with DOS protection, following bandwidth management and other features may come (e.g. light push request type: push to store) that will impose other considerations.

@Ivansete-status
Copy link
Contributor

#20 (comment) @Ivansete-status: I think its better idea to put less such logic into the service side. I feel it more client side one. IMHO we might embed it into SDK rather than to the raw protocol.

hahah yes I've noticed that :) The following comment is related to that and why I consider we should have fewer assumptions in light-node side and more on the full-node side: waku-org/nwaku#1004 (comment)


Because what does LOW_NUMBER_OF_PEERS implies? Is it a fixed number by configuration which the client side might not know about or depends on other factors like due to bandwidth restriction we might decide to unsubscribe from some of the heavy load shards?

<<Is it a fixed number by configuration which the client side might not know about>> --> Yes exactly. In that case, the light node may decide to try again to the same full-node in the near future or try to use another full-node.


Counting with DOS protection, following bandwidth management and other features may come (e.g. light push request type: push to store) that will impose other considerations.

Sorry, but I can't quite follow that statement.

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 except topic see my comment

Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

Approving as I will be AFK for a couple of days and don't want to be a bottleneck. A couple of comments below. :)

standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
Copy link
Contributor

@weboko weboko left a comment

Choose a reason for hiding this comment

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

looks good and added some comments

@NagyZoltanPeter
Copy link
Contributor Author

@weboko , @SionoiS, @Ivansete-status : Please take a last look if acceptable. I'm heading to merge this PR. It's time to make some coding soon. :-)

@NagyZoltanPeter
Copy link
Contributor Author

I changed my mind as was thinking of comments from @jm-clius and @weboko... #20 (comment)

I removed SERVICE_UNAVAILABLE and replaced with NO_PEERS_TO_RELAY as in this particular application for lightpush it means exactly that.

Copy link
Contributor

@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.

LGTM! Thanks so much for it and the patience 🙌 !
I'm just leaving a couple of minor comments.
From my PoV we need to make it a bit clearer the meaning of relay_peer_count.

standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
Co-authored-by: Ivan FB <128452529+Ivansete-status@users.noreply.github.com>
@NagyZoltanPeter
Copy link
Contributor Author

@Ivansete-status yes you are right, I will lately extent explanation of relay peer count as it may not matching mesh node count.

@NagyZoltanPeter NagyZoltanPeter dismissed SionoiS’s stale review June 21, 2024 23:32

The ref. comment is answered after others opinions are taken into account. I see not other request up front.

@NagyZoltanPeter
Copy link
Contributor Author

@SionoiS: Please take a look and approve if it is now in acceptable form. Thank you.

Copy link
Contributor

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

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

Thanks! I have added some minor comments, but lgtm now. :)

standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
standards/core/lightpush.md Outdated Show resolved Hide resolved
NagyZoltanPeter and others added 2 commits June 28, 2024 02:56
Co-authored-by: Hanno Cornelius <68783915+jm-clius@users.noreply.github.com>
@NagyZoltanPeter NagyZoltanPeter merged commit ffc9d3a into master Jun 28, 2024
0 of 2 checks passed

## Motivation and Goals

Light nodes with short connection windows and limited bandwidth wish to push messages to other nodes in the Waku network to request message services.<br>

Choose a reason for hiding this comment

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

instead of <br> (<br /> seems to be the correct tag), just put an empty new line next.

Additionally, there is sometimes a need for confirmation that a message has been received "by the network"
(here, at least one node).

`WAKU-LIGHTPUSH` is a request/response protocol for this.

Choose a reason for hiding this comment

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

Are we officially moving from WAKU2 @jm-clius ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Since this spec is not numbered yet (a.k.a. it's not a Vac RFC), the title is not critical.
For this to be promoted to Vac RFC, I suggest we keep using WAKU2 in the official title (also for consistency with other protocols, including the new Store). We can drop the "v2" from the name though - this is simply Waku Lightpush.

The title will be:
XX/WAKU2-LIGHTPUSH

where XX is the Vac-assigned RFC number.

standards/core/lightpush.md Show resolved Hide resolved
standards/core/lightpush.md Show resolved Hide resolved

If the node is unable to perform the request for some reason, it SHOULD return an error code in `LightPushResponse`.<br>

Once the relay is successful, the `relay_peer_count` will indicate the number of peers that the node has managed to relay the message to. It's important to note that this number may vary depending on the node subscriptions and support for the requested pubsub_topic. The client can use this information to either consider the relay as successful or take further action, such as switching to a lightpush service peer with better connectivity.<br>

Choose a reason for hiding this comment

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

sembr


> The list of error codes is not complete and can be extended in the future.

## Security Considerations

Choose a reason for hiding this comment

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

I would add that the content of the response node does not provide guarantees that the messages was relayed and that the requesting node should mitigate appropriately.


- Add support attaching RLN proof for the message requested to be relayed.
- Add support for other request types.
- Incentivization of the service

Choose a reason for hiding this comment

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

Definition of strategy to improve reliable usage of this service

@NagyZoltanPeter
Copy link
Contributor Author

@fryorcraken thank you for the comments, let's continue tracking those here: #29

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.

9 participants