lighthouse/beacon_node/beacon_chain/src
Michael Sproul 775d222299 Enable proposer boost re-orging (#2860)
## Proposed Changes

With proposer boosting implemented (#2822) we have an opportunity to re-org out late blocks.

This PR adds three flags to the BN to control this behaviour:

* `--disable-proposer-reorgs`: turn aggressive re-orging off (it's on by default).
* `--proposer-reorg-threshold N`: attempt to orphan blocks with less than N% of the committee vote. If this parameter isn't set then N defaults to 20% when the feature is enabled.
* `--proposer-reorg-epochs-since-finalization N`: only attempt to re-org late blocks when the number of epochs since finalization is less than or equal to N. The default is 2 epochs, meaning re-orgs will only be attempted when the chain is finalizing optimally.

For safety Lighthouse will only attempt a re-org under very specific conditions:

1. The block being proposed is 1 slot after the canonical head, and the canonical head is 1 slot after its parent. i.e. at slot `n + 1` rather than building on the block from slot `n` we build on the block from slot `n - 1`.
2. The current canonical head received less than N% of the committee vote. N should be set depending on the proposer boost fraction itself, the fraction of the network that is believed to be applying it, and the size of the largest entity that could be hoarding votes.
3. The current canonical head arrived after the attestation deadline from our perspective. This condition was only added to support suppression of forkchoiceUpdated messages, but makes intuitive sense.
4. The block is being proposed in the first 2 seconds of the slot. This gives it time to propagate and receive the proposer boost.


## Additional Info

For the initial idea and background, see: https://github.com/ethereum/consensus-specs/pull/2353#issuecomment-950238004

There is also a specification for this feature here: https://github.com/ethereum/consensus-specs/pull/3034

Co-authored-by: Michael Sproul <micsproul@gmail.com>
Co-authored-by: pawan <pawandhananjay@gmail.com>
2022-12-13 09:57:26 +00:00
..
attestation_verification Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
schema_change Delete DB schema migrations for v11 and earlier (#3761) 2022-12-02 00:07:43 +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 Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +00:00
beacon_fork_choice_store.rs Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +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 Prioritise important parts of block processing (#3696) 2022-11-30 05:22:58 +00:00
builder.rs Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +00:00
canonical_head.rs Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +00:00
chain_config.rs Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +00:00
early_attester_cache.rs Fix some typos (#3376) 2022-07-27 00:51:06 +00:00
errors.rs Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +00:00
eth1_chain.rs Deposit Cache Finalization & Fast WS Sync (#2915) 2022-10-30 04:04:24 +00:00
eth1_finalization_cache.rs Deposit Cache Finalization & Fast WS Sync (#2915) 2022-10-30 04:04:24 +00:00
events.rs Implement API for block rewards (#2628) 2022-01-27 01:06:02 +00:00
execution_payload.rs Prioritise important parts of block processing (#3696) 2022-11-30 05:22:58 +00:00
fork_choice_signal.rs Run fork choice before block proposal (#3168) 2022-05-20 05:02:11 +00:00
fork_revert.rs Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +00:00
head_tracker.rs Fix rust 1.65 lints (#3682) 2022-11-04 07:43:43 +00:00
historical_blocks.rs Use async code when interacting with EL (#3244) 2022-07-03 05:36:50 +00:00
lib.rs Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +00:00
light_client_finality_update_verification.rs Adding light_client gossip topics (#3693) 2022-12-13 06:24:51 +00:00
light_client_optimistic_update_verification.rs Adding light_client gossip topics (#3693) 2022-12-13 06:24:51 +00:00
merge_readiness.rs Increase merge-readiness lookhead (#3463) 2022-08-15 01:30:59 +00:00
metrics.rs Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +00:00
migrate.rs Fix rust 1.65 lints (#3682) 2022-11-04 07:43:43 +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 Delete DB schema migrations for v11 and earlier (#3761) 2022-12-02 00:07:43 +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 Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +00:00
schema_change.rs Delete DB schema migrations for v11 and earlier (#3761) 2022-12-02 00:07:43 +00:00
shuffling_cache.rs Impl oneshot_broadcast for committee promises (#3595) 2022-09-21 01:01:50 +00:00
snapshot_cache.rs Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +00:00
state_advance_timer.rs Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +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 Enable proposer boost re-orging (#2860) 2022-12-13 09:57:26 +00:00
timeout_rw_lock.rs Add flag to disable lock timeouts (#2714) 2021-10-19 00:30:40 +00:00
validator_monitor.rs Make all validator monitor logs INFO (#3727) 2022-12-13 06:24:52 +00:00
validator_pubkey_cache.rs Prioritise important parts of block processing (#3696) 2022-11-30 05:22:58 +00:00