Optimise and refine SingleAttestation
conversion
#6934
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue Addressed
Closes
SingleAttestation
conversion happens on theBeaconProcessor
#6805Proposed Changes
WorkEvent::GossipAttestationToConvert
to handle the conversion fromSingleAttestation
toAttestation
on the beacon processor (prevents a Tokio thread being blocked).SingleAttestation
s from the HTTP API.SingleAttestation -> Attestation
conversion function intobeacon_chain
so that it can return theattestation_verification::Error
type, which has well-defined error handling and peer penalties. The now-unused variants oftypes::Attestation::Error
have been removed.Additional Info
The names of variables and variants are quasi-generic so that we can switch around the conversion direction, i.e.
Attestation<E>
->SingleAttestation
, and run the whole attestation pipeline onSingleAttestation
only. This will be more efficient forSingleAttestation
s as we can postpone the expensive committee lookup until after signature verification (which is the whole point ofSingleAttestation
). I made a start on this here, but it needs more work:SingleAttestation
#6923See also:
SingleAttestation
full implementation #6616