Skip to content

Stake calculation doesn't handle cluster warmup / cooldown correctly #177

@felix-asym

Description

@felix-asym

When calculating stake delegations for the tip distribution merkle tree, the code doesn't handle partially deactivated stake correctly:
E.g the use of stake_account.delegation().stake in

lamports_delegated: stake_account.delegation().stake,
is wrong and could overestimate the active stake of a delegation that has been partially withdrawn.
Instead you should use stake_account.delegation().stake(bank.epoch(), ....) .

Otherwise someone could inflate their stake if the cluster is in cooldown.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions