lighthouse/beacon_node/beacon_chain/src
Michael Sproul 77eabc5401 Revert "Optimise HTTP validator lookups" (#3658)
## Issue Addressed

This reverts commit ca9dc8e094 (PR #3559) with some modifications.

## Proposed Changes

Unfortunately that PR introduced a performance regression in fork choice. The optimisation _intended_ to build the exit and pubkey caches on the head state _only if_ they were not already built. However, due to the head state always being cloned without these caches, we ended up building them every time the head changed, leading to a ~70ms+ penalty on mainnet.

fcfd02aeec/beacon_node/beacon_chain/src/canonical_head.rs (L633-L636)

I believe this is a severe enough regression to justify immediately releasing v3.2.1 with this change.

## Additional Info

I didn't fully revert #3559, because there were some unrelated deletions of dead code in that PR which I figured we may as well keep.

An alternative would be to clone the extra caches, but this likely still imposes some cost, so in the interest of applying a conservative fix quickly, I think reversion is the best approach. The optimisation from #3559 was not even optimising a particularly significant path, it was mostly for VCs running larger numbers of inactive keys. We can re-do it in the `tree-states` world where cache clones are cheap.
2022-10-26 06:50:04 +00:00
..
attestation_verification Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
schema_change New rust lints for rustc 1.64.0 (#3602) 2022-09-23 03:52:46 +00:00
attestation_verification.rs Refactor op pool for speed and correctness (#3312) 2022-08-29 09:10:26 +00:00
attester_cache.rs Add early attester cache (#2872) 2022-01-11 01:35:55 +00:00
beacon_chain.rs Fix attestation shuffling filter (#3629) 2022-10-18 04:02:06 +00:00
beacon_fork_choice_store.rs Remove equivocating validators from fork choice (#3371) 2022-07-28 09:43:41 +00:00
beacon_proposer_cache.rs Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
beacon_snapshot.rs Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
block_reward.rs Refactor op pool for speed and correctness (#3312) 2022-08-29 09:10:26 +00:00
block_times_cache.rs Add BlockTimesCache to allow additional block delay metrics (#2546) 2021-09-30 04:31:41 +00:00
block_verification.rs Consensus context with proposer index caching (#3604) 2022-10-15 22:25:54 +00:00
builder.rs Remove fallback support from eth1 service (#3594) 2022-10-04 08:33:39 +00:00
canonical_head.rs Revert "Optimise HTTP validator lookups" (#3658) 2022-10-26 06:50:04 +00:00
chain_config.rs Strict count unrealized (#3522) 2022-09-05 04:50:47 +00:00
early_attester_cache.rs Fix some typos (#3376) 2022-07-27 00:51:06 +00:00
errors.rs Impl oneshot_broadcast for committee promises (#3595) 2022-09-21 01:01:50 +00:00
eth1_chain.rs Remove fallback support from eth1 service (#3594) 2022-10-04 08:33:39 +00:00
events.rs Implement API for block rewards (#2628) 2022-01-27 01:06:02 +00:00
execution_payload.rs Add more logging for invalid payloads (#3515) 2022-08-29 14:34:42 +00:00
fork_choice_signal.rs Run fork choice before block proposal (#3168) 2022-05-20 05:02:11 +00:00
fork_revert.rs Consensus context with proposer index caching (#3604) 2022-10-15 22:25:54 +00:00
head_tracker.rs Altair consensus changes and refactors (#2279) 2021-07-09 06:15:32 +00:00
historical_blocks.rs Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
lib.rs Deduplicate block root computation (#3590) 2022-09-23 03:52:42 +00:00
merge_readiness.rs Increase merge-readiness lookhead (#3463) 2022-08-15 01:30:59 +00:00
metrics.rs Avoid duplicate committee cache loads (#3574) 2022-09-16 08:54:03 +00:00
migrate.rs Avoid parallel fork choice runs during sync (#3217) 2022-05-25 03:27:30 +00:00
naive_aggregation_pool.rs Update to Rust 1.59 and 2021 edition (#3038) 2022-02-25 00:10:17 +00:00
observed_aggregates.rs v2.2.0 (#3139) 2022-04-05 02:53:09 +00:00
observed_attesters.rs Ensure doppelganger detects attestations in blocks (#2495) 2021-08-09 02:43:03 +00:00
observed_block_producers.rs Doppelganger detection (#2230) 2021-07-31 03:50:52 +00:00
observed_operations.rs Refactor op pool for speed and correctness (#3312) 2022-08-29 09:10:26 +00:00
otb_verification_service.rs Initial Commit of Retrospective OTB Verification (#3372) 2022-07-30 00:22:38 +00:00
persisted_beacon_chain.rs Fix head tracker concurrency bugs (#1771) 2020-10-19 05:58:39 +00:00
persisted_fork_choice.rs Remove equivocating validators from fork choice (#3371) 2022-07-28 09:43:41 +00:00
pre_finalization_cache.rs Separate execution payloads in the DB (#3157) 2022-05-12 00:42:17 +00:00
proposer_prep_service.rs Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
schema_change.rs Refactor op pool for speed and correctness (#3312) 2022-08-29 09:10:26 +00:00
shuffling_cache.rs Impl oneshot_broadcast for committee promises (#3595) 2022-09-21 01:01:50 +00:00
snapshot_cache.rs Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
state_advance_timer.rs Avoid duplicate committee cache loads (#3574) 2022-09-16 08:54:03 +00:00
sync_committee_verification.rs New rust lints for rustc 1.64.0 (#3602) 2022-09-23 03:52:46 +00:00
test_utils.rs New rust lints for rustc 1.64.0 (#3602) 2022-09-23 03:52:46 +00:00
timeout_rw_lock.rs Add flag to disable lock timeouts (#2714) 2021-10-19 00:30:40 +00:00
validator_monitor.rs Fix validator_monitor_prev_epoch_ metrics (#2911) 2022-06-20 04:06:30 +00:00
validator_pubkey_cache.rs Add support for beaconAPI in lcli functions (#3252) 2022-08-09 06:05:13 +00:00