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: Add incentivization PoC with dummy request-response protocol #2816

Merged
merged 3 commits into from
Jul 2, 2024

Conversation

s-tikhomirov
Copy link
Contributor

@s-tikhomirov s-tikhomirov commented Jun 17, 2024

Description

This is a proof-of-concept implementation of a dummy request-response protocol that illustrates how eligibility proofs and eligibility statuses (see spec 73) can be used in the context of light protocols. The PoC code is only called from within tests. In the tests, a client creates a dummy request with an eligibility proof attached, and sends it to the server. The server checks the validity of the eligibility proof, and returns a response formed accordingly.

The eligibility proof is a transaction ID. For testing purposes, a random confirmed transaction on Sepolia testnet is used. The server only checks that a transaction with the corresponding txid (i.e., hash) exists. If so, the proof is considered valid.

Changes

  • add incentivization directory with a dummy client-server protocol;
  • add tests that illustrate the usage of eligibility structures in the context of light protocols.

How to test

  1. ./env.sh bash
  2. nim c -r ./tests/incentivization/test_all.nim

Issue

Related to #1961, although this PoS is unrelated to Store protocol per se.

Copy link

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2816-rln-v2

Built from a56efe6

Copy link

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2816-rln-v1

Built from a56efe6

@s-tikhomirov s-tikhomirov changed the title Add incentivization PoC with dummy request-response protocol feat: Add incentivization PoC with dummy request-response protocol Jun 17, 2024
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.

I think we're overcomplicating this POC. For one, we shouldn't add test-only code to master outside of the test suites. But I also don't see the need to introduce a fully specified dummy protocol. We simply need to mimic request-response interactions with eligibility proof and status checks embedded, but this can be done within a single unit test without introducing any extensive protocol scaffolding. In other words, we show the generic flow of req-resp protocol with eligibility checks:
Within a single test module:

  1. sendRequestWithEligibilityProof
  2. checkEligibility
  3. sendResponseWithEligibilityStatus

(1) and (3) would in reality send only the raw encoded eligibility RPCs. Within the test setup code you may have to introduce a dummy protocol ID, but this should be minimal.
(2) is the main focus of the POC and should show that we can lookup a raw tx_id to "check" that payment has been made. It may introduce some basic helper functions in waku/incentivization that will be reusable in future.

This POC simply illustrates our thinking around incentivisation so should be kept simple.

@s-tikhomirov s-tikhomirov changed the base branch from master to feat/incentivization-poc June 25, 2024 11:11
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.

After discussion with @s-tikhomirov, I suggest that we keep the Dummy protocol, but move this feature only to an experimental feature branch and cut the scope of the POC significantly. Created a new issue to explain reduced scope here: #2847
Happy to approve merging this to a feature branch.

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 merge to feature branch. See #2847

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.

LGTM! Thanks!

Copy link

github-actions bot commented Jun 27, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2816

Built from 1eebbdc

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 think this should close the initial POC for now on merge. We can revisit once we add more complex incentivization logic, reputation, etc.

waku/incentivization/txid_proof.nim Outdated Show resolved Hide resolved
waku/incentivization/txid_proof.nim Outdated Show resolved Hide resolved
@s-tikhomirov s-tikhomirov merged commit 45eccef into feat/incentivization-poc Jul 2, 2024
8 of 10 checks passed
@s-tikhomirov s-tikhomirov deleted the feat-add-incentivization-poc branch July 2, 2024 17:59
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