-
Notifications
You must be signed in to change notification settings - Fork 975
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
initial epoch options #504
Comments
note, we put a quick fix in via #505 but might consider this solution for the next release |
If we set
Not a fan of change 2). |
defining |
Oh wait, 86400 (seconds in a day) is a multiple of 64 :) Still, both |
what's ugly with |
The reason is that, semantically, you're using seconds as the unit when setting Incrementing by |
ah, whoops. I meant to make the genesis epoch the number of epochs since unix time start. Should be This I think is cleaner but does not resolve what happens if we reduce |
Potential alternative from @JustinDrake is to set initial slot to |
Some conversation in the sharding gitter brought up that this most significant bit set to 1 can have typing issues with certain languages/frameworks. For example, Java does not have a built in uint type so setting the most significant bit will be treated natively as negative numbers. Clean alternative is to set initial slot as |
Are there other examples?
I think we discussed that |
Someone on Nimbus ran into it with C types, but that was because they were mistakenly using signed rather than unsigned. You're right on the |
One consideration is that we may want to preserve the invariant that |
In the current spec (not the proposed solution):
Since |
Addressed by #655 :) |
Issue
We have a number of pretty ugly workarounds for avoiding underflows in slot/epoch arithmetic in early slots/epochs. Most (all?) of these could be entirely avoided if we just have the
genesis_slot
start far greater than 0.Proposed solution
Use
chainstart_time
which is logged inChainStart
to seed the genesis_slot/epoch instead of a pre-definedGENESIS_SLOT
.chainstart_time
intoget_initial_beacon_state
genesis_epoch
asslot_to_epoch(chainstart_time // EPOCH_LENGTH) + 1
genesis_slot
asget_epoch_start_slot(genesis_epoch)
GENESIS_EPOCH
andGENESIS_SLOT
constantsThe text was updated successfully, but these errors were encountered: