I feel like we can significantly improve the code clarity for UpdateValidator if we separate concerns there, and have a different method if the cliff validator already exists, and doesn't already exist. This is evidenced by there being 3 "if cliff val exists" calls in the function.
/cc @rigelrozanski @cwgoes @alexanderbez
Agreed this could be improved a bit. ref: #1923
good idea!
Concept ACK. Maybe there are other places in staking we could similarly simplify.
Possibly superseded issue if we remove cliff validator all-together....
Possibly superseded issue if we remove cliff validator all-together....
Maybe, but I think the cliff validator logic is a substantive performance improvement for the majority of likely real calls of UpdateValidator.
@cwgoes let's discuss this more - of course we want the performance - however I think there may be other ways which we could get (nearly) the same performance increase without having all the headache and code complexity of the cliff validator - see thoughts here: https://github.com/cosmos/cosmos-sdk/issues/2312
Let's talk about it in today's call however
Closing in favor of #2312, this becomes kind of irrelevant since we no longer have a reserved "cliff validator" seat, its just the 100th element of the arr, and we're switching to the end-block stuff.
Most helpful comment
@cwgoes let's discuss this more - of course we want the performance - however I think there may be other ways which we could get (nearly) the same performance increase without having all the headache and code complexity of the cliff validator - see thoughts here: https://github.com/cosmos/cosmos-sdk/issues/2312
Let's talk about it in today's call however