-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Validator key assignment ('key delegation') #26
Comments
@AdityaSripal is this an issue that should move to the interchain-security repo? |
Yes thanks |
This will be a user tx on the provider CCV module, i.e., CreateKey(valAddr, consumerChainId). |
Jack's comment- a validator set change of more than 1/3 will break all the IBC light clients, so if validators with more than 1/3 of the power delegate their keys in one block, it will break the light clients connected to consumer chains. @AdityaSripal any ideas around this? |
I'm not sure I understand. I thought that the validators can choose their consensus keys for a given chain before the chain is initialized. Can validators do this while validating on the consumer chain? What would be the benefit of that? |
Key rotation is a nice to have feature but could present problems. Setting the key prior to consumer chain start should be fine. |
@okwme Is this feature (each validator having a different consensus key for each consumer chain) something we need for V1 or is it a "nice to have"? |
Honestly waiting for key rotation option. |
We are thinking of providing the expected_keeper interface for the ccv module as such:
Does this make sense from the ccv point of view? (names aren't final) |
QQ: If a validator joins the set how long would it take the update to propagate to N chains? The issue arises that once a validator joins the active set how long do they have to start spinning up on consumer chains, this would be the deciding factor for how this gets implemented for me |
If a validator joins the set, this should trigger an update to the child chain so it could be quite fast. Faster than the val might have to submit a new key for the child chain. However, maybe it shoudl be possible to associate keys before joining the val set? Also probably shouldn't try to validate whether a key is or is not currently a validator for the same reason. Would this improve the scenario you were worried about @marbar3778 ? |
yea that would solve it. I guess the docs would say when becoming a validator if you have not registered a child chain consensus key we will use the default one. The outstanding question is if a validator changes it after the validator is created on the child chain are there security assumptions to think about? |
easiest would be fail on create-validator message if there are no entries for that validator in the key lookup table. This would mean we require validators to not use the same key. |
I think this is solved if there was a store with Keys of operator PKs and Values of operator PKs. Provider Chain validators would register (or not) their consumer chain PK. These are used to send voting power to the consumer over CCV. A provider operator can change the consumer PK as often as they want. Once updated, they will need to use this new key as part of their node as soon as the update packet has landed on the child chain (they could just as well run two nodes with each PK as one will be ignored until the change happens without risk of double signing). If they consumer chain sends rewards to the parent chain but the parent has recently updated their PK, this is also not a problem, as the previous consumer PK is still a Key in the store pointing to the provider PK. It will be redundant with the new consumer PK that is also pointing to the provider PK, but that's not a problem. We may want to consider a garbage collection that is some period after it is assumed the new key has landed on the consumer chain. the key of the store is for operators of both consumer and provider. The value is both consumer and provider. There is no collision on the store key even though there may be redundant entries in the store value. |
how would this work for validators that are already in the set? Shouldn't we fail over to the same key if they did not register one? The child chain won't begin producing blocks until 2/3 of the validators come online. It is same to assume that after a proposal passes, these validators won't turn on their nodes until after registering their PKs. |
actually, there is no need to store consumer chain PKs in the store at all. |
@okwme We still need the mapping from consumer PKs to provider PKs to match |
This may lead to the problem pointed by Jack, i.e., #26 (comment). How does it work currently on a single chain? Can a validator change its PK while part of the validator set? I think for the first release, we should keep it simple and allow the validators to decide on their consumer chain PK only once before they join the validator set. By default is the same PK as on the provider. |
if it's required then it's also fine to have a general look up table like i first described and the validator can change as often as they want to with no problem. If the lookup table is initially like this:
and
query is always up to date whether you're using the old Consumer PK or the new Consumer PK it is still pointing to the correct Provider PK. |
Yeah, but on the consumer chain, we may have the case that in two subsequent blocks the validators corresponding to more than 1/3 of the voting power change their PKs. As a result, the client to the consumer chain can no longer be updated. My question still stands:
|
After discussions within the team, the consensus was to allow every validator to change its consensus key on any consumer chain at any point in time. The issue discussed in #26 (comment) can be address by the relayer switching to the sequential protocol for updating the client. |
Presumably the mapping should not be opaque? It seems likely that people will want to know which validators on the consumers map to which provider validators and vice versa. Thus we'll need queries/RPC for this mapping, and perhaps additional metadata anyways on the consumer for each validator. Have I got it right? Please see related |
I made a prototype design, it's a WIP. It's entirely provider side, the consumer doesn't need to know anything. |
I screwed up a bit. With the key delegation I currently have, everything seems to work perfectly except for one thing: The design takes place so far entirely on the provider side (literally, no consumer code is changed). The provider takes care of mapping tendermint updates through the assigned keys, and forwarding them to the consumer. When a consumer slash packet arrives on the provider, the correct key is looked up, and the validator gets slashed accordingly. So far so good, all seems to work perfectly. Except, problem is, I oversaw the following, until now: I see some solutions, some of which change external behavior, some not.
I'm fond of clarifying and simplifying how we deal with various slash scenarios. In particular see
I'd also like to keep the entire keymap logic provider side, as it is now. Aside from the mentioned problem, everything seems to be working well, incl. diff tests. EDIT:
Note that the sdk will not trigger two downtime slashes in a row without forcing two downtime windows to elapse |
TODOs
@okwme here is a quick summary. I will flesh out tomorrow morning. I recommend reading this doc to figure out what is going on. |
Allow Validators to set a different consensus key for each baby chain
The text was updated successfully, but these errors were encountered: