Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

In staking rewards go to next validator set #4121

@gui1117

Description

@gui1117

Issue

session.validators contains the current set of validator validating and producing blocks,
session.queued_keys contains the next set.

in on_session_ending in case of a new era, the staking module elect a new set, put this set in staking::CurrentElected and returns it, session module put this new elected set in the queued keys.

But in staking::reward_by_ids we add reward points for a validator in stakig::CurrentElected.
And at the end of the era we reward according to this points the validators contained in staking::CurrentElected. This seems wrong as staking::CurrentElected at this moment contains the validator set for the next era not the current one.

How to fix

same as session, staking should have information for next_session but also for current_session. Maybe storing the staking information for previous elected set so it can reward them correctly.

CC @jacogr

Metadata

Metadata

Assignees

Labels

I3-bugThe node fails to follow expected behavior.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions