-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Add StakeInstruction::DeactivateDelinquent #23932
Conversation
627b151
to
3ddb9db
Compare
3ddb9db
to
589f816
Compare
Big 👍 on this - jailing has been working very well on Cosmos networks. However, jailing on Cosmos works slightly differently - you don't lose the delegations, but your node just gets marked as "jailed" and all stakes gets slashed a small % (optionally). You can then unjail yourself once the issue is resolved without losing the delegations. Actually deactivating stake is in some ways a harsher punishment since you won't easily get those delegations back.
What's the current threshold for a successful censorship attempt? Unless it's very low, we could even go a much more aggressive threshold, like 2-3 epochs - this is still plenty of time. It's a good way to further incentivize higher-quality validator operations. Did we previously use the deliquency status for anything critical? Related issue: |
I feel the threshold would be pretty high, but only have intuition. To prevent a validator from voting at least once in multiple epochs seems like it would require a large percentage of the stake to reject all vote transactions and all blocks containing vote transactions from the victim. To be fully effective, I think 2/3rds of the stake would need be participating at which point it doesn't matter anyway.
Beyond obviously computing epoch rewards, no. |
39f4c5f
to
b4091a3
Compare
b4091a3
to
a536ad3
Compare
4c646ee
to
f5fff3e
Compare
Codecov Report
@@ Coverage Diff @@
## master #23932 +/- ##
=========================================
- Coverage 81.8% 81.7% -0.1%
=========================================
Files 581 585 +4
Lines 158312 159583 +1271
=========================================
+ Hits 129518 130431 +913
- Misses 28794 29152 +358 |
I think this is ready for review, but no rush as I’m OOO for the next week or so. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cursory look at the logic looks good. i think we can improve the error reporting so clients can be more helpful with failures
f5fff3e
to
3bb0ae2
Compare
Added some additional |
Shoot, I forgot to review while you were gone. Will look a little later this afternoon! |
06717e0
to
733eaae
Compare
CI is now happy here other than the unrelated downstream-projects timeout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple nitty comments on the runtime side of things. Looking at cli now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking good. great test coverage!
seems like the cli command that we really want is one that takes the delinquent and reference vote accounts, then looks up the delinquent voter's stake accounts and deactivates them all.
Yeah you're right. I figured that could be bashed though since hopefully this isn't a feature that's used regularly |
733eaae
to
3b30bff
Compare
✅ Review feedback applied |
3b30bff
to
ff23ca8
Compare
ff23ca8
to
9a0ce8f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
are you good here as well @t-nelson? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
There's no mechanism to cleanup stake delegated to abandoned vote accounts. As a motivating example, 9% of the devnet stake has now been abandoned for almost 100 epochs. Currently the only path to remove that 9% dead weight is by a network restart.
This PR proposes a new stake program instruction that permits anybody to deactivate stake delegated to a vote account that has not landed a vote in the last 5 (
10) epochs. There's no reward for performing this common good so there should be no motivation to bot this instruction as soon as a stake account becomes eligible for public destaking.The benefit of this approach over some form of automatic destaking by the runtime is the lack of complexity. The stake program changes here are very minimal and thus easy to inspect and get comfortable with (or not!).
TODO:
10) epochs be provided to the instruction. This second vote account acts as proof to the stake program that the chain has been active over the last 5 (10) epoch, and prevents a very unlikely vector where a stake account could be destaked if the attacker is able to warp the chain ahead by 5 (10) epochs (perhaps on a mainnet restart somehow). This might be overkill. Update: Added