lighthouse/consensus
Michael Sproul 923486f34c Use bulk verification for sync_aggregate signature (#2415)
## Proposed Changes

Add the `sync_aggregate` from `BeaconBlock` to the bulk signature verifier for blocks. This necessitates a new signature set constructor for the sync aggregate, which is different from the others due to the use of [`eth2_fast_aggregate_verify`](https://github.com/ethereum/eth2.0-specs/blob/v1.1.0-alpha.7/specs/altair/bls.md#eth2_fast_aggregate_verify) for sync aggregates, per [`process_sync_aggregate`](https://github.com/ethereum/eth2.0-specs/blob/v1.1.0-alpha.7/specs/altair/beacon-chain.md#sync-aggregate-processing). I made the choice to return an optional signature set, with `None` representing the case where the signature is valid on account of being the point at infinity (requires no further checking).

To "dogfood" the changes and prevent duplication, the consensus logic now uses the signature set approach as well whenever it is required to verify signatures (which should only be in testing AFAIK). The EF tests pass with the code as it exists currently, but failed before I adapted the `eth2_fast_aggregate_verify` changes (which is good).

As a result of this change Altair block processing should be a little faster, and importantly, we will no longer accidentally verify signatures when replaying blocks, e.g. when replaying blocks from the database.
2021-07-28 05:40:21 +00:00
..
cached_tree_hash Tree hash caching and optimisations for Altair (#2459) 2021-07-23 00:23:53 +00:00
fork_choice Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
int_to_bytes Update to tokio 1.1 (#2172) 2021-02-10 23:29:49 +00:00
merkle_proof Implement matches! macro (#1777) 2020-10-15 21:42:43 +00:00
proto_array Advance state to next slot after importing block (#2174) 2021-02-15 07:17:52 +00:00
safe_arith Remove saturating arith from state_processing (#1644) 2020-09-25 05:18:21 +00:00
serde_utils Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
ssz [Altair] Sync committee pools (#2321) 2021-07-15 00:52:02 +00:00
ssz_derive Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
ssz_types [Altair] Sync committee pools (#2321) 2021-07-15 00:52:02 +00:00
state_processing Use bulk verification for sync_aggregate signature (#2415) 2021-07-28 05:40:21 +00:00
swap_or_not_shuffle Use hardware acceleration for SHA256 (#2426) 2021-07-12 08:47:01 +00:00
tree_hash Use hardware acceleration for SHA256 (#2426) 2021-07-12 08:47:01 +00:00
tree_hash_derive Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
types Cache participating indices for Altair epoch processing (#2416) 2021-07-27 07:01:01 +00:00