Skip to content

Division by zero in get_attestation_deltas or wrong min value of get_total_balance #1663

@MrChico

Description

@MrChico

A comment in get_total_balance reads that the function returns a minimum of 1 Gwei to avoid divisions by zero.

But since #1635, total_balance must be at least EFFECTIVE_BALANCE_INCREMENT in order to avoid a division by zero in this line of get_attestation_deltas:

rewards[index] = reward_numerator // (total_balance // increment)

It seems that either the minimum of total_balance should be raised, or the reward calculation be adjusted to avoid this edge case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    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