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: incentivization PoC: client-side reputation system basics #3293

Merged
merged 9 commits into from
Feb 20, 2025

Conversation

s-tikhomirov
Copy link
Contributor

@s-tikhomirov s-tikhomirov commented Feb 12, 2025

Description

This PR implements parts of a simple client-side reputation system that don't require modifications in the Lightpush protocol.

This is a countinuaton of #3166 and #3264 with associated deliverable waku-org/pm#245.

The goal of this PR is to merge parts of the reputation system that don't require integration into any real protocol (Lightpush or otherwise). This functionality aims to encompass common functions that all reputation-enhanced protocols will use (Lightpush will be the first but probably not the only protocol to do so).

In a reputation-enhanced protocol, clients remember the results of their interactions with servers and update the servers' reputation scores accordingly. If a server sends a bad request (for some definition of response quality implemented in the respective response evaluation functionality), that server's reputation is set to "bad".

Note that reputation indicators have no relation to gossipsub peer scores. It is possible that reputation indicators from client-server protocols will play a role in peer scoring as an application-specific component (cf. p_5 in the peer score formula). This idea is left for future work.

Changes

List of detailed changes

  • implement a reputation manager that maintains a mapping from peer IDs to reputation indicators (good, bad, unknown)
  • add functions to set, get and set reputation indicators
  • add a function to evaluate a (Lightpush) response (a response is "good" if its isSuccess field is true)
  • update reputation indicators based on response quality.

The next steps will imply integrating the eligibility- and reputation-related functionality in the Lightpush protocol (behind a feature flag) that involve amending the relevant protobuf structures and peer selection mechanism. In particular, a client will avoid selecting bad servers for all its future requests. Also, response quality evaluation will involve making a Store request to ensure a given message has indeed been published.

@s-tikhomirov s-tikhomirov self-assigned this Feb 12, 2025
@s-tikhomirov s-tikhomirov changed the title [WIP] feat: incentivization PoC: client-side reputation system feat: incentivization PoC: client-side reputation system Feb 12, 2025
Copy link

github-actions bot commented Feb 12, 2025

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3293

Built from 425506b

@s-tikhomirov s-tikhomirov force-pushed the feat/incentivization-poc-reputation branch from fce0795 to 2cd7d30 Compare February 19, 2025 15:53
@s-tikhomirov s-tikhomirov changed the title feat: incentivization PoC: client-side reputation system feat: incentivization PoC: client-side reputation system basics Feb 19, 2025
@s-tikhomirov s-tikhomirov marked this pull request as ready for review February 19, 2025 16:13
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

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

LGTM, minor suggestion below. Feel free to merge without rerequesting review. :)

waku/incentivization/reputation_manager.nim Outdated Show resolved Hide resolved
@s-tikhomirov s-tikhomirov force-pushed the feat/incentivization-poc-reputation branch from 2cd7d30 to ecf94f6 Compare February 20, 2025 12:58
@s-tikhomirov s-tikhomirov merged commit a4e92a3 into master Feb 20, 2025
12 checks passed
@s-tikhomirov s-tikhomirov deleted the feat/incentivization-poc-reputation branch February 20, 2025 15:07
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