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

Penalty is too high for delegators and stakers #13

Open
MKong opened this issue Jan 30, 2020 · 4 comments
Open

Penalty is too high for delegators and stakers #13

MKong opened this issue Jan 30, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@MKong
Copy link
Member

MKong commented Jan 30, 2020

Currently, if a staker is labelled as a cheater, then the staker and delegators (if any) lose all their staked or delegated tokens respectively:

        if (isCheater == false) {
            from.transfer(delegatedAmount);
        } else {
            penalty = delegatedAmount;
        }
      if (isCheater == false) {
            staker.transfer(stake);
        } else {
            penalty = stake;
        }

The penalty is too high.

Perhaps 20% for stakers, and 10% for delegators, is more reasonable.

@MKong MKong changed the title Penality is too high for delegators and stakers Penalty is too high for delegators and stakers Jan 30, 2020
@ghost
Copy link

ghost commented Jan 30, 2020

I think Polkadot has an interesting approach to slashing, the penalties vary on how severe an attack is:

image

image

See here for more context: https://polkadot.network/polkadot-consensus-part-4-security/

In Polkadot delegators (called "nominators") share the slashing penalty with the validators. Which actually makes sense, because those are the people giving their vote and power to a certain validator. If the penalty for delegators is too low, they probably won't delegate as mindful as they would do if they are in the same boat as the validators.

I agree that 100% penalty in ANY scenario is brutal and therefore I think Polkadot's approach is very interesting. Coordinated attacks (by multiple validators) are penalized way more, than if only a single validator is failing/acting maliciously (might be because of an incorrect network setup, etc. ...).

@ghost
Copy link

ghost commented Feb 6, 2020

Perhaps 20% for stakers, and 10% for delegators, is more reasonable.

If the penalty for delegators is too low, they probably won't delegate as mindful as they would do if they are in the same boat as the validators.

As @rekt0x already mentioned, penalty rules must be the same for validators and delegators, since delegators increase validator's weight in consensus algorithm. If delegator's penalty were lower than validator's, then validator would delegate to himself (except minimum validator stake) to minimize the possible penalty

the penalties vary on how severe an attack is

Sure, from my point of view it makes perfect sense. But of course it has to be discussed first.

The curve which Polkadot mentions may not be as secure as 100% penalty. It gives 100% penalty only on 33% of Byzantine nodes. If 1/3W are already Byzantine, then it's too late for penalties already, as the attack had a chance to succeed. So probably we could give 100% penalty if 1/4W of validators were Byzantine "at once". "at once" could mean that cheaters were confirmed in the same window of 5 epochs.

If we implement it as a piecewise linear function, then we can use the curve with following dots:

0.0 0.02
0.05 0.03
0.15 0.1
0.18 0.151
0.2 0.25
0.23 0.59
0.25 1.0
1.0 1.0

I've got those dots as not-a-knot spline interpolation of those dots:

0.0 0.02
0.05 0.03
0.15 0.1
0.2 0.25
0.25 1.0

Also it might make sense to use not a piecewise linear function, but rather a direct short formula (it would be simpler to implement). As an example, this function is very close to dots above: min(0.02 + (0.2 + x * 3.187)^6, 1.0)

This curved penalty will have economical consequences for delegators. Delegators will have a trade-off between delegating to validators who have smaller total stake (hence lower possible penalty) and delegating to validators with greater self-funding (hence those validators are more trustworthy)

@ghost
Copy link

ghost commented Feb 6, 2020

So probably we could give 100% penalty if 1/4W of validators were Byzantine "at once". "at once" could mean that cheaters were confirmed in the same window of 5 epochs.

Might be a good trade-off.

This curved penalty will have economical consequences for delegators. Delegators will have a trade-off between delegating to validators who have smaller total stake (hence lower possible penalty) and delegating to validators with greater self-funding (hence those validators are more trustworthy)

Which probably is more favourable as delegators should delegate to validators with more self-stake and with this implementation there is also an economic reason to do so.

@ghost ghost added the enhancement New feature or request label Feb 12, 2020
@quan8
Copy link
Contributor

quan8 commented Feb 20, 2020

@rekt0x Thanks for the above valuable suggestions. We've discussed to find out the most suitable option. Ideally, all stakes of a cheater(s) and his delegators will be burnt once a cheating is detected. The cheater will be excluded from the next epoch and the delegated stakes to him/her won't be counted. Details are being considered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants