Skip to content

pallet-staking: era duration is off by one block. #468

Open
@gui1117

Description

In pallet-staking end_era is called through pallet-session::end_session during on_initialize. But end_era compute the duration of the era using the timestamp of the block, which is the timestamp of previous block due to timestamp inherent not being set yet for the current block. This means that the duration of the era is off doesn't take into account the duration of the last block of the era.

This should be fixed by computing the payout of the era in on_finalize when timestamp is set.

Metadata

Assignees

No one assigned

    Labels

    I5-enhancementAn additional feature request.

    Type

    No type

    Projects

    • Status

      📕 Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions