prysm icon indicating copy to clipboard operation
prysm copied to clipboard

Discard attestations with wrong target after 5 slots

Open potuz opened this issue 3 years ago • 11 comments

Attestations with wrong target after 5 slots are useless in Altair and thus should be ignored.

See

https://github.com/ConsenSys/teku/issues/4412

potuz avatar Oct 17 '21 11:10 potuz

I do believe this is already implemented: https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/altair/attestation.go#L290-L291

lyzs90 avatar Sep 13 '22 14:09 lyzs90

I do believe this is already implemented: https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/core/altair/attestation.go#L290-L291

The quoted check just checks for the correct source, did you mean something else?

potuz avatar Sep 13 '22 17:09 potuz

Correct me if I'm wrong: this participation flag is false if the delay is > 5 slots, hence the attestation will not be processed.

Or were you looking to filter prior to this, say OnAttestation?

lyzs90 avatar Sep 14 '22 00:09 lyzs90

Correct me if I'm wrong: this participation flag is false if the delay is > 5 slots, hence the attestation will not be processed.

That participation flag is false but that doesn't mean that the attestation won't be processed. An attestation can have false timely source (as is the case of the check you highlighted) but have true timely target. The point of the issue is that any attestation that has wrong target after 5 slots will have false all timely flags and therefore it only occupies space in blocks if included.

potuz avatar Sep 14 '22 00:09 potuz

Thanks for clarifying. I think I got the gist of it: these flags are for facilitating reward accounting. By the time the attestation reaches this stage, it's bound to be included in the block.

lyzs90 avatar Sep 14 '22 01:09 lyzs90

@Iyzs90 I'm going to close this but feel free to reopen if there's any questions

terencechain avatar Sep 14 '22 07:09 terencechain

@terencechain isn't the issue still relevant?

lyzs90 avatar Sep 16 '22 13:09 lyzs90

This issue is very much still open

potuz avatar Sep 16 '22 14:09 potuz

Cool, I think I'm getting close. Similar to the Teku implementation, the filter can be placed prior to block proposal: https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go

lyzs90 avatar Sep 16 '22 16:09 lyzs90

Cool, I think I'm getting close. Similar to the Teku implementation, the filter can be placed prior to block proposal: https://github.com/prysmaticlabs/prysm/blob/develop/beacon-chain/rpc/prysm/v1alpha1/validator/proposer_attestations.go

I'd support if there's an earlier path for this. Any delay in packing attestations hurts block proposals and may affect broadcast timing. If we could get rid of those attestations in the pool earlier it would be best I think.

potuz avatar Sep 16 '22 16:09 potuz

@potuz Do let me know if that MR is on the right track, I think this is as early as it gets for filtering during block proposal. An alternative is while pruning the attestation pool, we could check the head and attempt filtering there?

lyzs90 avatar Sep 21 '22 16:09 lyzs90