Skip to content

Commit

Permalink
Fix GetPayloadTimelinessCommittee to return correct PTC size (#14012)
Browse files Browse the repository at this point in the history
  • Loading branch information
terencechain authored and potuz committed May 24, 2024
1 parent 85d8b1a commit d110677
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion beacon-chain/core/helpers/payload_attestation.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func GetPayloadTimelinessCommittee(ctx context.Context, state state.ReadOnlyBeac
}
committeesPerSlot := math.LargestPowerOfTwo(math.Min(SlotCommitteeCount(activeCount), fieldparams.PTCSize))
membersPerCommittee := fieldparams.PTCSize / committeesPerSlot
for i := uint64(0); i <= committeesPerSlot; i++ {
for i := uint64(0); i < committeesPerSlot; i++ {
committee, err := BeaconCommitteeFromState(ctx, state, slot, primitives.CommitteeIndex(i))
if err != nil {
return nil, err
Expand Down
1 change: 1 addition & 0 deletions beacon-chain/core/helpers/payload_attestation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func TestGetPayloadTimelinessCommittee(t *testing.T) {

ptc, err := helpers.GetPayloadTimelinessCommittee(ctx, state, state.Slot())
require.NoError(t, err)
require.Equal(t, fieldparams.PTCSize, len(ptc))

committee1, err := helpers.BeaconCommitteeFromState(ctx, state, state.Slot(), 0)
require.NoError(t, err)
Expand Down

0 comments on commit d110677

Please sign in to comment.