You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During periods of instability, it is often the case that the target vote is off, specially close to epoch transitions - in particular, clients might miss the last few blocks in the epoch and vote for a target with skipped slots - when we use the target directly, it means we must replay the state with the skipped slots in order to recreate the shuffling needed to validate the attestation in the context it was created.
However, the shuffling is already fixed one epoch prior - it would be possible to instead rely on (target.blck.atSlot(target.epoch-2).getLastSlotInEpoch()) - this is sometimes called the dependent root - and extract a lookahead shuffling from that state instead.
Relying on this older epoch will filter out a lot of the noise because we'll be looking at older data - any off-by-one or off-by-two-blocks votes will no longer cause replays.
The lookahead (epoch + 1) shuffling is normally not computed - EpochRef stores the shuffling for EpochRef.epoch - notably, we can only precompute the shuffling this way - we can't fill in the other EpochRef fields.
This means we must either extend EpochRef to also hold the shuffling for the next epoch or split out the shuffling into a separate cache.
An instance of this kind of cache inefficiency can be seen in #2675 where a series of poorly formed attestations led to a period of heightened memory usage that could have been avoided with the above scheme.
The text was updated successfully, but these errors were encountered:
One way I see this working is that we have a seed -> shuffling cache and store the seed in EpochRef - alternatively, we store the shuffling as a ref in EpochRef.
With increased load on the REST API for duty lookahead, this cache increasingly becomes important
In order to avoid full replays when validating attestations hailing from
untaken forks, it's better to keep shufflings separate from `EpochRef`
and perform a lookahead on the shuffling when processing the block that
determines them.
This also helps performance in the case where REST clients are trying to
perform lookahead on attestation duties and decreases memory usage by
sharing shufflings between EpochRef instances of the same dependent
root.
Attestation checks currently use an
EpochRef
to validate the committee, based on thetarget
vote:nimbus-eth2/beacon_chain/gossip_processing/gossip_validation.nim
Line 220 in 44f652f
During periods of instability, it is often the case that the target vote is off, specially close to epoch transitions - in particular, clients might miss the last few blocks in the epoch and vote for a target with skipped slots - when we use the target directly, it means we must replay the state with the skipped slots in order to recreate the shuffling needed to validate the attestation in the context it was created.
However, the shuffling is already fixed one epoch prior - it would be possible to instead rely on
(target.blck.atSlot(target.epoch-2).getLastSlotInEpoch())
- this is sometimes called the dependent root - and extract a lookahead shuffling from that state instead.Relying on this older epoch will filter out a lot of the noise because we'll be looking at older data - any off-by-one or off-by-two-blocks votes will no longer cause replays.
The lookahead (epoch + 1) shuffling is normally not computed -
EpochRef
stores the shuffling forEpochRef.epoch
- notably, we can only precompute the shuffling this way - we can't fill in the otherEpochRef
fields.This means we must either extend
EpochRef
to also hold the shuffling for the next epoch or split out the shuffling into a separate cache.An instance of this kind of cache inefficiency can be seen in #2675 where a series of poorly formed attestations led to a period of heightened memory usage that could have been avoided with the above scheme.
The text was updated successfully, but these errors were encountered: