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

Use 2*63 for the genesis slot #537

Merged
merged 1 commit into from
Feb 3, 2019
Merged

Use 2*63 for the genesis slot #537

merged 1 commit into from
Feb 3, 2019

Conversation

JustinDrake
Copy link
Collaborator

No description provided.

@djrtwo
Copy link
Contributor

djrtwo commented Jan 31, 2019

Rationale here -- #534

set initial slot to 2**63 such that you can always do state.slot << 1 to get the number of slots since genesis. Seems nice.

@Nashatyrev
Copy link
Member

Slot #‭576460752303423590‬6 doesn't look too user friendly.
From engineering point of view: the only reference point when understanding/debugging Eth1 blockchain issues was always the block number. This change will complicate the things.

BTW state.slot << 1 wouldn't be [slots since genesis] * 2 then ?

@JustinDrake
Copy link
Collaborator Author

Slot #‭576460752303423590‬6 doesn't look too user friendly.

Right, this number should not be exposed to users. Abstracting the most significant bit at a very low level would make sense.

state.slot << 1 wouldn't be [slots since genesis] * 2 then ?

(state.slot << 1) >> 1 is what you want :)

@djrtwo
Copy link
Contributor

djrtwo commented Feb 2, 2019

@Nashatyrev Given the (slot << 1) >>1 or slot - 2**63 does this satisfy the debugging requirement?

Starting at slot/epoch 0 requires adding a bunch of conditional underflow logic that will only be needed in the first few epochs.

@vbuterin
Copy link
Contributor

vbuterin commented Feb 2, 2019

Seems reasonable to me. As said above, we can have a UI convention that we subtract 2**63.

Copy link
Contributor

@vbuterin vbuterin left a comment

Choose a reason for hiding this comment

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

👍

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.

4 participants