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

Zeroed Validator Session Keys #3406

Open
TrustVeriCor opened this issue Jul 4, 2021 · 2 comments
Open

Zeroed Validator Session Keys #3406

TrustVeriCor opened this issue Jul 4, 2021 · 2 comments

Comments

@TrustVeriCor
Copy link

Failed extrinsic: Extrinsic#5509292-2

Looking at the extrinsic, it seems that the transaction included 6 keys instead of 5.

When finally included in active validator set (era 394), the session key in session was zeroed out (matching the 6th key value of the extrinsic)

However, prior to that Polkadot JS displayed session keys in UI that were non-zero.

Forced chill command, rotate keys, and reset intention resulted in expected state.

2 things:
Session keys should never be string of all zeroes.

Failed extrinsics (especially set session key) should be detected on chain and prevent inclusion in active validator set.

@bkchr
Copy link
Member

bkchr commented Jul 5, 2021

You probably called rotate_session_keys while syncing and thus, did not get the correct session keys.

As the native side doesn't know anything about the session keys, we need to call into the runtime to generate them. However, if you are still not near the tip of the chain, this can lead to generating incorrect keys. This part of zeroing missing keys is there to not break the entire system when such a validator is active.

@wpank can say you something about tools that should help you to detect these mismatches with on chain state and what you have in your keystore.

@wpank
Copy link
Contributor

wpank commented Jul 5, 2021

Looking at some of the txs from the controller account, my guess is what happens when you submit a setKeys tx with session keys generated from when the chain isn't synced is it makes a failed tx (polkadot.js is pretty explicit about the tx failing saying duplicate key error). Once this happens it would set the keys on chain to 0x, where they're all null. You can then submit a validate tx and your validator will be able to be nominated / in the set.

For checking keys, someone made this https://paranodes.io/SessionKeys

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants