chainx-org / ChainX

Bitcoin's layer2 smart contract network has already supported WASM and EVM, and is supporting MoveVM
https://chainx.org
GNU General Public License v3.0
323 stars 120 forks source link

Improve xstaking election #639

Closed icodezjb closed 1 year ago

icodezjb commented 2 years ago

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,