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

staking: curate consensus set at epoch boundary #3875

Merged
merged 4 commits into from
Feb 26, 2024

Conversation

erwanor
Copy link
Member

@erwanor erwanor commented Feb 23, 2024

Close #3854 - the idea here is to eliminate concerns about validator manipulating state transitions to hop out of the consensus set, and escape end-epoch processing.

The way we achieve this is by forcing every validator identity in the index to be processed at least once before being removed.

@erwanor erwanor added A-staking Area: Design and implementation of staking and delegation consensus-breaking breaking change to execution of on-chain data labels Feb 23, 2024
@erwanor erwanor force-pushed the erwan/3854_consensus_set_epoch branch from 980aede to b5e41c0 Compare February 23, 2024 14:45
Copy link
Contributor

@cratelyn cratelyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small logging question below..

crates/core/component/stake/src/component/stake.rs Outdated Show resolved Hide resolved
@hdevalence
Copy link
Member

hdevalence commented Feb 23, 2024

I'm not totally sure I follow the logic here.

My understanding of the original issue was that not that a validator could "escape" end_epoch processing but that they could toggle their validator on and off to trigger additional epoch changes.

Wouldn't making it so that disabled validators have to wait to turn back on prevent that problem, in a more simplified and isolated way?

EDIT: ah, maybe i am confused and thinking of a different issue...

@erwanor
Copy link
Member Author

erwanor commented Feb 23, 2024

That's a different issue, and I'm not sure I follow what the suggested fix is for:

Wouldn't making it so that disabled validators have to wait to turn back on prevent that problem, in a more simplified and isolated way?

The problem this PR solves is that the set of validators we need to process and the set of validators we index can diverge. This happens because we made the state machine implementation manage indexing/deindexing directly. Instead of having to carefully arrange the entire staking component to make sure that we do this correctly, it is actually much simpler to have the end-epoch processor decide if an identity can be deindexed.

@hdevalence
Copy link
Member

Yes, I got issues confused, that is not a fix for this issue, sorry for the noise.

@erwanor
Copy link
Member Author

erwanor commented Feb 23, 2024

Ok I also misread your proposed fix, I think I see what you mean - yes that's the plan, every validator, regardless of state waits the unbonding epoch in block time

On second read, I realize the fix is for another issue altogether: it's about adding a cooldown to reactivate a disabled validator to increase the marginal cost of performing #3738

@erwanor erwanor force-pushed the erwan/3854_consensus_set_epoch branch from 3f9d2aa to b7ec91a Compare February 26, 2024 13:42
@erwanor erwanor merged commit f6e131f into main Feb 26, 2024
6 checks passed
@erwanor erwanor deleted the erwan/3854_consensus_set_epoch branch February 26, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-staking Area: Design and implementation of staking and delegation consensus-breaking breaking change to execution of on-chain data
Projects
None yet
Development

Successfully merging this pull request may close these issues.

staking: modify consensus set index in epoch handler
3 participants