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

First draft of leader election details. #25

Merged
merged 3 commits into from
Sep 16, 2024
Merged

Conversation

happi
Copy link
Collaborator

@happi happi commented Sep 16, 2024

Please comment on the whole approach as well as all the names:
MINIMUM_STAKE
register
top_up
withdraw
tokens_at_stake

(Sorry, I also did some general cleanup. New stuff lines 509-538)

@ThomasArts
Copy link
Contributor

ThomasArts commented Sep 16, 2024

I see an unsolved issue with extracting stake directly after leader elects the schedule.
At the start of an epoch we decide the schedule of the complete epoch based on the stake. If that schedule is set, the stakeholders could in principle walk away with the stake.
Do we allow this or are there measures in place to somehow block the stake during the epoch?

@hanssv hanssv requested review from nikita-fuchs and removed request for CedrikNikita September 16, 2024 11:26
@happi
Copy link
Collaborator Author

happi commented Sep 16, 2024

I see an unsolved issue with extracting stake directly after leader elects the schedule. At the start of an epoch we decide the schedule of the complete epoch based on the stake. If that schedule is set, the stakeholders could in principle walk away with the stake. Do we allow this or are there measures in place to somehow block the stake during the epoch?

Blocks should only be accepted if the stake is still there in the staking contract. Not only at the beginning of the epoch.

I thought this was clear enough:

During the block production epoch, blocks are considered valid only if they are produced by validators who have at least the tokens_at_stake in (their deposit in the election contract + their token balance in the staking contract).

But clarifications are welcome.

@happi
Copy link
Collaborator Author

happi commented Sep 16, 2024

The MINIMUM_STAKE should "be at stake" you should not be allowed to withdraw that if your tokens_at_stake is > 0.
But I think it is ok to walk away with the other stake (at least in version 1.0) but then you can not validate.

@hanssv
Copy link
Member

hanssv commented Sep 16, 2024

Looks solid to me, perhaps deposit instead of top_up?

@happi happi merged commit d10eb66 into master Sep 16, 2024
1 check passed
@happi happi deleted the leader_election_detail branch September 16, 2024 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants