ChainX icon indicating copy to clipboard operation
ChainX copied to clipboard

Improve xstaking election

Open icodezjb opened this issue 3 years ago • 0 comments

The current qualified validator election sets two conditions

1. has the desire to win the election.
2. meets the threshold of a valid candidate.

Even if the candidate satisfies the above 2 conditions, the candidate will be discarded by Session module, because the session keys are not set (call pallet-session::set_keys) (without any prompt log message).

To avoid this low-level error, we add a third condition

3. has set session keys by calling pallet_session set_keys.

Determine whether this candidate has set session keys by the trait ValidatorRegistration,

icodezjb avatar Jun 02 '22 07:06 icodezjb