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

Add Stake Table for first 2 epochs #2552

Open
ss-es opened this issue Feb 6, 2025 · 0 comments
Open

Add Stake Table for first 2 epochs #2552

ss-es opened this issue Feb 6, 2025 · 0 comments

Comments

@ss-es
Copy link
Contributor

ss-es commented Feb 6, 2025

HotShot will need a stake table for the first few epochs, which should be the continuation of the current stake table. However, the Membership implementation has no way of knowing which epoch number will be the "first" epoch.

We should add a new method to Membership that looks something like set_first_epoch(&mut self, epoch: TYPES::Epoch) -> Result<()>, which HotShot will use to mark the first "real" epoch number by calling set_first_epoch on the current consensus epoch number immediately after the upgrade is decided.

The Membership implementation should insert its initial non-epoch stake table at both the given and next TWO epochs (for a total of 3 epochs). In most cases only 2 will be needed, but in an edge case where the upgrade is decided towards the end of an epoch we may not call add_epoch_root on it.

Since nodes may not decide upgrades at the same point, we should ensure (when deploying) that the contract provides the same stake table as the initial stake table for all 3 of these epochs and is not modified until after the 3rd real epoch.

@ss-es ss-es changed the title Add Stake Table/Epoch roots for first 2 epochs (since they won't have roots decided) Add Stake Table for first 2 epochs Feb 6, 2025
rob-maron pushed a commit that referenced this issue Feb 7, 2025
… from storage (#2552)

* Replace genesis function

* Fix genesis state

* try logging

* remove logging

* Undo justfile change

* Add node in spinning task

* Move start_consensus

* Add clone

* Create node first

* Modify check
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

No branches or pull requests

1 participant