Skip to content

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions