@lodestar/fork-choice 2.1.0-dev.a046f269a1 → 2.1.0-dev.a243bacf81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1734,7 +1734,7 @@ export class ForkChoice implements IForkChoice {
1734
1734
  * Return true if the block is "weak" ie. its weight is below REORG_HEAD_WEIGHT_THRESHOLD of the
1735
1735
  * total attester weight per slot.
1736
1736
  *
1737
- * https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.11/specs/phase0/fork-choice.md#is_head_weak
1737
+ * https://github.com/ethereum/consensus-specs/blob/v1.7.0-beta.5/specs/phase0/fork-choice.md#is_head_weak
1738
1738
  * https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.11/specs/gloas/fork-choice.md#modified-is_head_weak
1739
1739
  */
1740
1740
  private isHeadWeak(blockRoot: RootHex): boolean {
@@ -1753,10 +1753,6 @@ export class ForkChoice implements IForkChoice {
1753
1753
  committeePercent: this.config.REORG_HEAD_WEIGHT_THRESHOLD,
1754
1754
  });
1755
1755
 
1756
- if (!isForkPostGloas(this.config.getForkName(node.slot))) {
1757
- return node.weight < reorgThreshold;
1758
- }
1759
-
1760
1756
  let headWeight = node.attestationScore;
1761
1757
 
1762
1758
  const {equivocatingIndices} = this.fcStore;
@@ -1797,7 +1793,7 @@ export class ForkChoice implements IForkChoice {
1797
1793
  * Return true if the parent block is "strong" ie. its weight exceeds REORG_PARENT_WEIGHT_THRESHOLD
1798
1794
  * of the total attester weight per slot.
1799
1795
  *
1800
- * https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.12/specs/phase0/fork-choice.md#is_parent_strong
1796
+ * https://github.com/ethereum/consensus-specs/blob/v1.7.0-beta.5/specs/phase0/fork-choice.md#is_parent_strong
1801
1797
  * https://github.com/ethereum/consensus-specs/blob/v1.7.0-alpha.12/specs/gloas/fork-choice.md#modified-is_parent_strong
1802
1798
  */
1803
1799
  private isParentStrong(parentRoot: RootHex): boolean {
@@ -1812,9 +1808,7 @@ export class ForkChoice implements IForkChoice {
1812
1808
  committeePercent: this.config.REORG_PARENT_WEIGHT_THRESHOLD,
1813
1809
  });
1814
1810
 
1815
- // pre-gloas uses get_weight() (boost-inclusive), gloas uses get_attestation_score() (boost-excluded)
1816
- const parentWeight = isForkPostGloas(this.config.getForkName(node.slot)) ? node.attestationScore : node.weight;
1817
- return parentWeight > parentThreshold;
1811
+ return node.attestationScore > parentThreshold;
1818
1812
  }
1819
1813
 
1820
1814
  /**
@@ -70,6 +70,7 @@ export enum NotReorgedReason {
70
70
  NotProposingOnTime = "notProposingOnTime",
71
71
  NotProposerOfNextSlot = "notProposerOfNextSlot",
72
72
  HeadBlockNotAvailable = "headBlockNotAvailable", // Should not happen because head block should be in cache
73
+ HeadStateNotAvailable = "headStateNotAvailable",
73
74
  Unknown = "unknown", // A placeholder in case reason is not provided
74
75
  }
75
76