Skip to content

Gloas: also count weight from equivocating committee members when determining if head is weak #9232

@ensi321

Description

@ensi321

Problem description

In gloas, spec's is_head_weak is updated to also count weight from equivocating committee validators in addition to just the the active ones from calculate_committee_fraction.

We need to update

// No reorg if headBlock is "not weak" ie. headBlock's weight exceeds (REORG_HEAD_WEIGHT_THRESHOLD = 20)% of total attester weight
// https://github.com/ethereum/consensus-specs/blob/v1.4.0-beta.4/specs/phase0/fork-choice.md#is_head_weak
const reorgThreshold = getCommitteeFraction(this.fcStore.justified.totalBalance, {
slotsPerEpoch: SLOTS_PER_EPOCH,
committeePercent: this.config.REORG_HEAD_WEIGHT_THRESHOLD,
});
const headNode = this.protoArray.getNode(headBlock.blockRoot, headBlock.payloadStatus);
// If headNode is unavailable, give up reorg
if (headNode === undefined || headNode.weight >= reorgThreshold) {
return {proposerHead, isHeadTimely, notReorgedReason: NotReorgedReason.HeadBlockNotWeak};
}

This is covered in ethereum/consensus-specs#4807 as one of the few things the PR aimed to solve

Solution description

Implement per spec.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    meta-feature-requestIssues to track feature requests.spec-gloasIssues targeting the Glamsterdam spec version

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions