Coder Social home page Coder Social logo

Algorithm improvement about polygon-dash HOT 3 CLOSED

ichorid avatar ichorid commented on September 17, 2024
Algorithm improvement

from polygon-dash.

Comments (3)

grimadas avatar grimadas commented on September 17, 2024

Updates on the algorithm design.

We have two metrics that we can measure each having different confidence level.

Given the total number of transactions finalised by the miner/validator - NT

  1. Violations. For that we need to record and report the total number of violations (NV). Relative violations (RV) = NV/ NT.
  2. Outliers. Specifically we are interested only in extremely fast transactions, which are in top quantile compared to all other transactions. Calculate number of such outliers - NO. We can use RO = NO / NT.

Finally, the miner/validator who has produced many blocks and finalised many transactions should have higher score than miners/validators who only create few blocks.
For that we introduce miner productivity coefficient comparing. This coefficient shows how the miner compares against the top finalising miner.

$c_i = \frac{NT_i}{max_{j \in N}(NT_j)}$ - the relative number of transaction processed by the miner against the maximum.

We use this coefficient with a sigmoid function to introduce a decay to the miner $i$:

$d_i\ =\ \frac{1}{1+e^{-12\left(c_i-0.4\right)}}$

image

Two metrics on outliers and violations can/should be reported in the dashboard: RO + NO, RV + NV.

Finally, the miner score is calculated as:

$score_i = (0.8 * RO_i + 0.2 * RV_i) * d_i$

Time aspect

Taking into account only last $k$ blocks will introduce a natural time decay if required. A miner who had violations in the past will be thus redeemed.

from polygon-dash.

ichorid avatar ichorid commented on September 17, 2024

Seems like a reasonable alternative that is relatively easy to understand and explain. Though, we should dig into the literature for fraud-resistant reputation function more in the future.

from polygon-dash.

ichorid avatar ichorid commented on September 17, 2024

Done

from polygon-dash.

Related Issues (16)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.