Skip to content

Commit

Permalink
Caplin: Inclusion of VoluntaryExits, AttesterSlashings, `Proposer…
Browse files Browse the repository at this point in the history
…Slashing`s, `BlsExecutionToChange`s and `Attestation`s into block production (#10071)

This PR add operations inclusion.
## Normal operations

* BlsExecutionChange
* VoluntaryExit
* Slashings

Each of these operations blacklist the index they work on so we do not
have repeating indices for the same operations twice. we assume all
signatures are pre-validated and just see if it is a good time to
produce a block with them (by looking at their slot)
## Aggregated Attestations

There is a lot of trash attestations on the network so we separate our
algorithm in 3 steps:

### Eligibility

We iterate over the entire pool of accumulated attestations and filter
out all attestations who cannot be included at the current slot, and
compute their expected reward. (filter out if 0).

### Ranking

We rank the `Attestation`s by their expected reward (we just sort the
array of candidates) by expected reward in ascending order.

### Filtering by superset

We may have some supersets left-over, filter attestation which ends up
being supersets of other. this process is done from highest reward down
to lowest reward.
  • Loading branch information
Giulio2002 authored Apr 27, 2024
1 parent 00850e0 commit b14b766
Show file tree
Hide file tree
Showing 4 changed files with 637 additions and 106 deletions.
5 changes: 0 additions & 5 deletions cl/aggregation/pool_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,6 @@ func NewAggregationPool(
}

func (p *aggregationPoolImpl) AddAttestation(inAtt *solid.Attestation) error {
// check if it's single attestation
if utils.BitsOnCount(inAtt.AggregationBits()) != 1 {
return fmt.Errorf("exactly one aggregation bit should be set")
}

// use hash of attestation data as key
hashRoot, err := inAtt.AttestantionData().HashSSZ()
if err != nil {
Expand Down
Loading

0 comments on commit b14b766

Please sign in to comment.