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

Assumptions that the genesis slot is zero #1666

Closed
paulhauner opened this issue Sep 25, 2020 · 1 comment
Closed

Assumptions that the genesis slot is zero #1666

paulhauner opened this issue Sep 25, 2020 · 1 comment
Labels
A1 code-quality consensus An issue/PR that touches consensus code, such as state_processing or block verification.

Comments

@paulhauner
Copy link
Member

Description

There are some places in the code where we are either faulty or misleading in the case where the genesis slot is non-zero.

Encountering a non-zero genesis slot in phase 0 seems negligible. However, we can reasonably expect non-zero genesis slots for the shard chains, once they arrive.

In the short term, I think it's acceptable for LH to be faulty for a non-zero genesis slot. But I don't think that's the case in the long term.

Known Issues

"Oldest roots" getters

/// Gets the oldest (earliest slot) state root.
///
/// Spec v0.12.1
pub fn get_oldest_state_root(&self) -> Result<&Hash256, Error> {
let i =
self.get_latest_state_roots_index(self.slot - Slot::from(self.state_roots.len()))?;
Ok(&self.state_roots[i])
}
/// Gets the oldest (earliest slot) block root.
///
/// Spec v0.12.1
pub fn get_oldest_block_root(&self) -> Result<&Hash256, Error> {
let i = self.get_latest_block_roots_index(self.slot - self.block_roots.len() as u64)?;
Ok(&self.block_roots[i])
}

Relative epoch

RelativeEpoch::Previous => base - 1,

@paulhauner paulhauner added code-quality consensus An issue/PR that touches consensus code, such as state_processing or block verification. A1 labels Sep 25, 2020
@paulhauner paulhauner changed the title Assumptions that the genesis slot is zero Assumptions that the genesis slot is zero 🤘 Sep 25, 2020
@paulhauner paulhauner changed the title Assumptions that the genesis slot is zero 🤘 Assumptions that the genesis slot is zero Sep 25, 2020
@paulhauner paulhauner added A1 and removed A1 labels Nov 8, 2020
@paulhauner
Copy link
Member Author

I'm closing this since it's stale and irrelevant now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A1 code-quality consensus An issue/PR that touches consensus code, such as state_processing or block verification.
Projects
None yet
Development

No branches or pull requests

1 participant