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: protocol implementations in @waku/core should be as unopinionated as possible #1886

Closed
3 tasks done
danisharora099 opened this issue Mar 5, 2024 · 0 comments
Closed
3 tasks done

Comments

@danisharora099
Copy link
Collaborator

danisharora099 commented Mar 5, 2024

This is a change request

Problem

Our protocol implementations exist is @waku/core, and offer opinions on the usage such as:

  • using multiple peers
  • message dedeplication (for filter)

These opinions are assumptions we have made, and they sit close with the code for the protocol's purest implementation.
Problems with having a general SDK-like functionalities with protocol implementation:

  • increases complexity by trying to have a great API while being bound by protocol definition
  • mixed abstraction level. Protocol implementation is one level. Using protocols in a ways that increase reliability, reduces bandwidth usage etc are one level above
  • makes the code less forkable and readable: 99% developers are not expected to ever touch core protocol implementation. But 80/20 rules says 20% of developers will fork or inspires themselves from general SDK to do their own custom usage of the protocols.
  • finally, the protocol implementation should be simple and straightforward for readability and comparisons with the specs. Sebago avoid mixing abstraction levels.

Proposed Solutions

It would be a better approach to decouple opinions as much as possible from the protocol implementation, thus keeping it as close to pure, while introducing opinions within @waku/sdk.

This also allows us flexibility in terms of the different APIs we can provide for each protocol.

Acceptance Criteria

Notes

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

No branches or pull requests

2 participants