Maximum validator count for PoS #288
-
If it's not already in the works, it would really valuable to have a node-set maximum validator count for PoS To be more specific, define
Probably some missing logic here, but that's the general idea. I would go further to say it's a required feature for a permission-less PoS network. The reasoning is it allows there to be some implicit minimum in the staking amount to become a validator (they have to have more staked than the lowest staked validator), otherwise even someone with a small amount of tokens could be elected to become a validator, which could result in DoS. It provides teams with control at the beginning to slowly expand their validator count as they become more comfortable with running the chain. Examples for public PoS chains: Matic: 100 |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 4 replies
-
Hey @mrwillis, Thank you for opening up a discussion regarding this 🙏 I can try to answer some of these suggestions.
Suggestion 1 is something that already happens on the Smart Contract for our staking implementation (check out the repo here).
Suggestion 2 is covered by the PoS implementation in code in the Polygon SDK - nodes only update their validator sets during epoch blocks (which you can set even now). I like the idea of having a configurable minimum required staking balance. Right now it's 1ETH per address, if I remember correctly. Adding a maximum number of validators is also possible, and wouldn't be to much of a hassle to implement PSDK wise (since adding it to the Smart Contract is easy). What do you think @lazartravica @Kourin1996 ? |
Beta Was this translation helpful? Give feedback.
-
I would note that a maximum validator count with that logic does implicitly
imply a minimum (the min of all the staked amounts) but this is also
probably a good feature in conjuction.
…On Tue., Dec. 14, 2021, 7:20 a.m. Miloš Živković, ***@***.***> wrote:
Hey @mrwillis <https://github.com/mrwillis>,
Thank you for opening up a discussion regarding this 🙏
I can try to answer some of these suggestions.
Not elect anyone to be a validator if their staked amount was below s and
the amount of validators was equal to n
Suggestion #1 <#1> is
something that already happens on the Smart Contract for our staking
implementation (check out the repo here
<https://github.com/0xPolygon/staking-contracts>).
Automatically drop validators from the set after the epoch if they are
below s
Suggestion #2 <#2> is
covered by the PoS implementation in code in the Polygon SDK - nodes only
update their validator sets during epoch blocks (which you can set even
now).
I like the idea of having a configurable minimum required staking balance.
Right now it's 1ETH per address, if I remember correctly.
Adding a maximum number of validators is also possible, and wouldn't be to
much of a hassle to implement PSDK wise (since adding it to the Smart
Contract is easy).
What do you think @lazartravica <https://github.com/lazartravica>
@Kourin1996 <https://github.com/Kourin1996> ?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#288 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAUHUCZV7PGMYZMHGOGOTOTUQ4Y67ANCNFSM5J6SSZMA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Beta Was this translation helpful? Give feedback.
-
Hey @mrwillis, Just to update you here, we've started looking into these PoS feature requests extensively this week, and will update you as soon as we have a clear picture on what will be implemented first, along with a general timeline 🚀 |
Beta Was this translation helpful? Give feedback.
-
@mrwillis Thank you for opening the suggestion! Let me clarify this. Currently, there is only one threshold, which is 1 Ether as default and the contract doesn't have a limit of validators. It means any account that staked the threshold will be a validator. Please note validator set in contract updates immediately, but node updates own validator set at the beginning of the next epoch. Dynamic threshold sounds good. With this, only the top
I think (4) needs to loop, it takes much gas. We need to find better solution. In addition, let's say we're reducing |
Beta Was this translation helpful? Give feedback.
-
@zivkovicmilos @Kourin1996 have you guys decided what to do on this front? If the min/max number of validators and minimum staking amounts can't be changed on the fly, can they be implemented in the SC? Regarding changing them on the fly yea seems tricky. @Kourin1996 argued and I agree with that these parameters are mostly changed by votes. I think that might be tricky as per the case where you're voting down (i.e., current validators < new maximum validator count). |
Beta Was this translation helpful? Give feedback.
-
@mrwillis You might have seen them but @ptitluca opened new PR for min/max validator limits. This adds min/max limitation and prevent account from joining/leaving from validator set. If the number of validator change to out of the range, the transaction will fail. Doesn't consider staked amount right now. |
Beta Was this translation helpful? Give feedback.
@mrwillis You might have seen them but @ptitluca opened new PR for min/max validator limits.
0xPolygon/staking-contracts#10
#397
This adds min/max limitation and prevent account from joining/leaving from validator set. If the number of validator change to out of the range, the transaction will fail. Doesn't consider staked amount right now.