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

[Sharding] Calc the right root with respect to (slot, shard) for an empty PendingShardHeader #2368

Merged
merged 5 commits into from
May 14, 2021
4 changes: 2 additions & 2 deletions specs/sharding/beacon-chain.md
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ def process_pending_headers(state: BeaconState) -> None:
winning_index = voting_balances.index(max(voting_balances))
else:
# If no votes, zero wins
winning_index = [c.root for c in candidates].index(Root())
winning_index = [c.commitment for c in candidates].index(DataCommitment())
candidates[winning_index].confirmed = True
for slot_index in range(SLOTS_PER_EPOCH):
for shard in range(SHARD_COUNT):
Expand Down Expand Up @@ -763,7 +763,7 @@ def reset_pending_headers(state: BeaconState) -> None:
slot=slot,
shard=shard,
commitment=DataCommitment(),
root=Root(),
root=hash_tree_root(ShardBlobHeader(slot = slot, shard = shard)),
votes=Bitlist[MAX_VALIDATORS_PER_COMMITTEE]([0] * committee_length),
confirmed=False,
))
Expand Down