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

Previous crosslink becomes outdated after epoch transition #845

Closed
mkalinin opened this issue Mar 27, 2019 · 2 comments
Closed

Previous crosslink becomes outdated after epoch transition #845

mkalinin opened this issue Mar 27, 2019 · 2 comments
Labels
general:bug Something isn't working

Comments

@mkalinin
Copy link
Collaborator

Issue

After transition to a 3rd epoch crosslink of an attestation created in the last slot of 2nd epoch becomes outdated.

Steps

The steps are taken from simulation with 4 shards and 4 slots in the epoch:

Epoch 0:
  s3: create att.s3.shard_3.previous_crosslink_epoch_0

Epoch 1:
  s4: transition to epoch_1 -> shard_3.latest_crosslink_epoch = 0 (not changed)
  s4: include att.s3.shard_3.previous_crosslink_epoch_0 into pending state 
      (Case 1: latest crosslink matches previous crosslink)

  s7: create att.s7.shard_3.previous_crosslink_epoch_0

Epoch 2:
  s8: transition to epoch_2 -> shard_3.latest_crosslink_epoch = slot_to_epoch(s3) = 1
  s8: include att.s7.shard_3.previous_crosslink_epoch_0 into pending state 
      (Case 2: latest crosslink matches current crosslink)

  s11: create att.s11.shard_3.previous_crosslink_epoch_1

Epoch 3:
  s12: transition to epoch_3 -> shard_3.latest_crosslink_epoch = slot_to_epoch(s11) = 2
  s12: att.s11.shard_3.previous_crosslink_epoch_1 becomes invalid
       (neither from two cases matches)
@JustinDrake JustinDrake added the general:bug Something isn't working label Mar 27, 2019
@mkalinin
Copy link
Collaborator Author

Looks like there is another potential issue around get_winning_root_and_participants.

Assuming there are two sibling epochs: e1 and e2. Considering the case when attestations att.e1.shard_n and att.e2.shard_n have been added to the state during epoch e2.

In that case get_winning_root_and_participants will have to deal with two attestations for shard_n during e2 -> e3 transition where crosslink_data_root of att.e1.shard_n could potentially win.

@hwwhww
Copy link
Contributor

hwwhww commented Apr 19, 2019

closing via #874

@hwwhww hwwhww closed this as completed Apr 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
general:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants