diff --git a/configs/mainnet.yaml b/configs/mainnet.yaml index d0d5fc496..aacd2a96e 100644 --- a/configs/mainnet.yaml +++ b/configs/mainnet.yaml @@ -94,7 +94,7 @@ CHURN_LIMIT_QUOTIENT: 65536 # 40% PROPOSER_SCORE_BOOST: 40 # 20% -REORG_WEIGHT_THRESHOLD: 20 +REORG_HEAD_WEIGHT_THRESHOLD: 20 # 160% REORG_PARENT_WEIGHT_THRESHOLD: 160 # `2` epochs diff --git a/configs/minimal.yaml b/configs/minimal.yaml index 8c09c7e37..592ad281b 100644 --- a/configs/minimal.yaml +++ b/configs/minimal.yaml @@ -93,7 +93,7 @@ CHURN_LIMIT_QUOTIENT: 32 # 40% PROPOSER_SCORE_BOOST: 40 # 20% -REORG_WEIGHT_THRESHOLD: 20 +REORG_HEAD_WEIGHT_THRESHOLD: 20 # 160% REORG_PARENT_WEIGHT_THRESHOLD: 160 # `2` epochs diff --git a/specs/bellatrix/fork-choice.md b/specs/bellatrix/fork-choice.md index d78862037..7bf607d6e 100644 --- a/specs/bellatrix/fork-choice.md +++ b/specs/bellatrix/fork-choice.md @@ -154,8 +154,8 @@ of the block to be proposed (due to withdrawals). If `should_override_forkchoice_update` returns `True` but `get_proposer_head` later chooses the canonical head rather than its parent, then this is a misprediction that will cause the node -to construct a payload with less notice. The result of `get_proposer_head` MUST be honoured in -preference to the heuristic method. +to construct a payload with less notice. The result of `get_proposer_head` MUST be preferred over +the result of `should_override_forkchoice_update` (when proposer reorgs are enabled). ## Helpers diff --git a/specs/phase0/fork-choice.md b/specs/phase0/fork-choice.md index 077209d5f..6a5437115 100644 --- a/specs/phase0/fork-choice.md +++ b/specs/phase0/fork-choice.md @@ -89,7 +89,7 @@ Any of the above handlers that trigger an unhandled exception (e.g. a failed ass | Name | Value | | ------------------------------------- | ------------ | | `PROPOSER_SCORE_BOOST` | `uint64(40)` | -| `REORG_WEIGHT_THRESHOLD` | `uint64(20)` | +| `REORG_HEAD_WEIGHT_THRESHOLD` | `uint64(20)` | | `REORG_PARENT_WEIGHT_THRESHOLD` | `uint64(160)`| | `REORG_MAX_EPOCHS_SINCE_FINALIZATION` | `Epoch(2)` | @@ -431,6 +431,7 @@ def is_finalization_ok(store: Store, slot: Slot) -> bool: ```python def is_proposing_on_time(store: Store) -> bool: + # Use half `SECONDS_PER_SLOT // INTERVALS_PER_SLOT` as the proposer reorg deadline time_into_slot = (store.time - store.genesis_time) % SECONDS_PER_SLOT proposer_reorg_cutoff = SECONDS_PER_SLOT // INTERVALS_PER_SLOT // 2 return time_into_slot <= proposer_reorg_cutoff @@ -441,7 +442,7 @@ def is_proposing_on_time(store: Store) -> bool: ```python def is_head_weak(store: Store, head_root: Root) -> bool: justified_state = store.checkpoint_states[store.justified_checkpoint] - reorg_threshold = calculate_committee_fraction(justified_state, REORG_WEIGHT_THRESHOLD) + reorg_threshold = calculate_committee_fraction(justified_state, REORG_HEAD_WEIGHT_THRESHOLD) head_weight = get_weight(store, head_root) return head_weight < reorg_threshold ```