Skip to content

Commit

Permalink
Don't use MaxCover for Electra on-chain aggregates
Browse files Browse the repository at this point in the history
  • Loading branch information
rkapka committed Feb 13, 2025
1 parent 1502583 commit 864fed6
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package validator

import (
"bytes"
"cmp"
"context"
"fmt"
"slices"
"sort"

"github.com/pkg/errors"
Expand Down Expand Up @@ -277,7 +279,13 @@ func (a proposerAtts) sortOnChainAggregates() (proposerAtts, error) {
return a, nil
}

return a.sortByProfitabilityUsingMaxCover()
slices.SortFunc(a, func(a, b ethpb.Att) int {
return cmp.Or(
-cmp.Compare(a.GetData().Slot, b.GetData().Slot),
-cmp.Compare(a.GetAggregationBits().Count(), b.GetAggregationBits().Count()))
})

return a, nil
}

// Separate attestations by slot, as slot number takes higher precedence when sorting.
Expand Down

0 comments on commit 864fed6

Please sign in to comment.