Skip to content

Rewards Can Become Permanently Unclaimable Due to Epoch Logic #16

@Skyge

Description

@Skyge

Description:
A logic flaw in the epoch and locking mechanism can cause deposited rewards to be permanently locked and unclaimable in two scenarios:

  1. Initial Epoch Issue: Rewards deposited via depositReward() during epoch 0 are stored in epochReward[0]. However, the lock() function always begins locking from currentEpoch() + 1 (epoch 1). Consequently, rewards for epoch 0 have no corresponding lock positions and are irretrievable.

  2. Empty Previous Epoch Issue: For any epoch n, if there are zero active lockers from the previous epoch (n-1), then rewards deposited for epoch n will also be unclaimable, as there is no eligible stake to distribute them to.

Recommendation:

  • Prevent depositReward() from being called in epoch 0.
  • Add a validation check to ensure there is existing eligible stake (lockers from epoch n-1) before accepting rewards for epoch n.

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