Skip to content

ADR 001: Trustless Fisherman system #7

@DragonDmoney

Description

@DragonDmoney

ADR 001: Trustless Fisherman system

Context

Currently, the planned fisherman V1 model only supports fishermen selected by the DAO, making them trusted actors. This is not desirable for a number of reasons, centralization, few points of failure, and doxing the fisherman becomes easier. The most desirable, decentralized, scalable, and secure system would be a system where anybody can be a fisherman.

Proposed Solution

This outlines a new system for fisherman session selection and a new incentive model that will economically force fishermen to be as accurate as possible.

Session Selection

There are two systems possible for Fisherman session selection:

  1. Continuous random sessions initiated by fishermen
  2. A fisherman session tied to a service node session initiated by the protocol

Continuous random sessions initiated by fishermen

After a new block has been created, and after FishermanSessionDelay has elapsed, a Fisherman will generate a random list of other node addresses (including itself) with a VRF.

type FishermanSession struct {
    Fishermen []Fisherman
    Initiatior Fisherman
    Seed int
}

The fisherman will propagate this information to the other fisherman, and this marks the beginning of the TestingPeriod. The TestingPeriod is a measure of time defined by TestingPeriodLength. Samples outside the timeframe of the TestingPeriod will not be accepted, and will not impact the fisherman's reputation.

The fisherman will begin sampling. The fisherman has no requirements for sampling other than sampling during the TestingPeriod, and sending more samples than MinimumTestingSamples.

Fisherman can stake their own applications or can receive ephemeral keys from applications. Applications can find the fisherman in their session by querying a fisherman RPC.

Pros:

  • There are lots of moving parts, which makes identifying fishermen and blocking them very difficult (from the ServiceNode perspective)
  • Allows for a larger group of fishermen to monitor ServiceNodes increasing accuracy.

Cons:

  • There will be more chain bloat, as the more fisherman sessions the more TestScores fisherman need to submit
  • It is harder for the applications to identify which Fisherman are monitoring their sessions in a trustless manner.

Note: After further review, this system does not fully abolish vulnerabilities in the Sampling Protocol, and the algorithm listed below is the proposed method for this ADR

Protocol Fisherman Sessions

This system works very similarly to the current session generation session, however, another fisherman session will be generated in parallel to a ServiceNode session. This means for the entirety of the session, the same fisherman will be monitoring the ServiceNodes.

Pros:

  • It is easy for applications to identify fishermen monitoring their session
  • The session generation is on the protocol level

Cons:

  • It is easier to identify and dox fisherman

TestScore Reports

After a fisherman session has concluded, all the fisherman will submit their Testscores to the network. These Testscores are the same as defined in the previous spec, only with the addition of their SessionID, which is a hash that corresponds to their Fisherman session.

As brought up by Luis, some fishermen may wait to see other fisherman's test scores in the mempool, and then submit a test score as close to the other fishermen to maximize their rewards. To prevent this, there must be a "encode and reveal scheme" for all TestScore transactions. In the first transaction, the fisherman will submit a hash of all the data on the transaction, and the fisherman will reveal the data in the next transaction.

Grading Period

After the Testscores have been submitted to the network, the grading process begins. All fishermen begin with a reputation score of 0.00, this reputation score corresponds to how many rewards they get (as defined in the Rewarding Period). Fisherman's reputation is affected by how similar their results are to the rest of the fishermen. The protocol will aggregate all the reports from the same Fisherman session. For every ServiceNode in that session, it will aggregate all the fisherman's results for that ServiceNode and run them through an algorithm to determine the consensus average (run all the test-scores through an algorithm to find the most accurate score for ServiceNode in a particular session). This algorithm has not yet been defined, but as a placeholder, we can use median. The median of the fisherman's results will go on the ServiceNode's report card.

Fisherman Grading

The accuracy of a fisherman on a particular ServiceNode is defined as 1 - abs(median / ServiceNodeResults). The average of all of these individual accuracies is the fisherman's SessionAccuracy. The fisherman's reputation is the average of a trailing list of Session Accuracies of length NumRollingAverageScoringSessions (similar to a ServiceNode's report card).

PauseTxs

If a ServiceNode does not respond, a Fisherman can submit a PauseTx to pause the ServiceNodes from participating in sessions. A PauseTx is successful of the majority of fishermen submit a PauseTx as well. If a fisherman is incorrectly submits/doesn't submit a PauseTx they are punished as well. Their SessionAccuracy is reduced by NumOfInaccuratePauseTxs * InaccuratePauseTxReduction.

Fisherman Rewarding

Fishermen are rewarded in a similar manner to ServiceNodes, there is a TotalVolumeUsage that is evenly divided into buckets per Fisherman that are above ReputationCliff. This value is the MaxFishermanSalary. The fisherman's reputation is put into a network variable function called ReputationToSalary. This function would look something like this:

image

The salary of the Fisherman is the ReputationToSalary multiplied by MaxFishermanSalary (note: if the value is negative, the Fisherman is burned).

Status

In-progress

Author

Pierre

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions