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

Consensus constant for epoch height calculation does not seem correct #832

Open
Cifko opened this issue Dec 11, 2023 · 0 comments
Open

Consensus constant for epoch height calculation does not seem correct #832

Cifko opened this issue Dec 11, 2023 · 0 comments
Assignees

Comments

@Cifko
Copy link
Contributor

Cifko commented Dec 11, 2023

Current epoch is currently computed as the height of the chain divided by the consensus constant

    pub fn block_height_to_epoch(&self, height: u64) -> VnEpoch {
        VnEpoch(height / self.vn_epoch_length)
    }

So if we change the consensus constant vn_epoch_length to something larger, we suddenly can get epoch number from the past
e.g.
if the current height is 1000 and the vn_epoch_length is 10, the current epoch is 100, and from 1001 new consensus constant is set with vn_epoch_length to be 20, and now the epoch is 50 (so the 2nd layer will go back in time, probably breaking itself)

Cifko PR 5749

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant