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

Initial shard slot number #1877

Closed
hwwhww opened this issue Jun 8, 2020 · 3 comments · Fixed by #1971
Closed

Initial shard slot number #1877

hwwhww opened this issue Jun 8, 2020 · 3 comments · Fixed by #1971
Labels

Comments

@hwwhww
Copy link
Contributor

hwwhww commented Jun 8, 2020

Issue

Currently, the initial shard state slot is set to PHASE_1_GENESIS_SLOT by setting shard_state.slot = pre.slot

For example, if PHASE_1_GENESIS_SLOT is 32:
image

The shard block 32 cannot exist and both B_32 and B_33 point to initial shard state.

How to fix it

IMO the scenario would be neater if we set initial shard slot to compute_previous_slot(pre.slot).
image

@hwwhww hwwhww added the phase1 label Jun 8, 2020
@hwwhww
Copy link
Contributor Author

hwwhww commented Jun 9, 2020

/cc @djrtwo @protolambda

@djrtwo
Copy link
Contributor

djrtwo commented Jun 23, 2020

This does seem reasonable, but one thing we need to be careful about is that for a system that is started from Phase 1 a GENESIS_SLOT, the shard states at B0 would be for slot 0 (because of how compute_previous_slot handles 0 input.

I do expect some systems to want to start phase 1 from slot 0 so we should at least ensure that nothing is broken here. OR we put some sort of requirement taht PHASE_1_GENESIS_SLOT is at least GENESIS_SLOT + SLOTS_PER_EPOCH

@mkalinin
Copy link
Contributor

This does seem reasonable, but one thing we need to be careful about is that for a system that is started from Phase 1 a GENESIS_SLOT, the shard states at B0 would be for slot 0 (because of how compute_previous_slot handles 0 input.

I have this particular kind of setup (PHASE_1_GENESIS_SLOT = GENESIS_SLOT = 0). The following list of patches did help to sort the things out:

  • get_shard_transition returns empty shard transition if GENESIS_SLOT
  • validate_attestation allows for empty shard transition root if GENESIS_SLOT
  • process_shard_transitions skips crosslink processing if compute_previous_slot(state.slot) == GENESIS_SLOT

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

Successfully merging a pull request may close this issue.

3 participants