-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
UpgradeClient Followup #1 #7457
Conversation
Codecov Report
@@ Coverage Diff @@
## master #7457 +/- ##
==========================================
+ Coverage 55.25% 55.28% +0.02%
==========================================
Files 591 591
Lines 36951 36998 +47
==========================================
+ Hits 20416 20453 +37
- Misses 14427 14432 +5
- Partials 2108 2113 +5 |
keys := strings.Split(cs.UpgradePath, "/") | ||
for _, k := range keys { | ||
if strings.TrimSpace(k) == "" { | ||
return sdkerrors.Wrapf(ErrInvalidUpgradePath, "upgrade path invalid: %s", cs.UpgradePath) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, can we move this to a ValidateUpgradePath
function?
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
In principle this seems alright but we need to be careful that off-by-one errors won't cause problems here - in particular, transactions processed in the last block need an extra block to be committed-to and proved - will that work here? |
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
…dk into aditya/upgrade-followups
Yes this is an excellent point. This will work because it isn't as if the upgrade client is committed at the last block. It should be committed much earlier. It's just that we use the last block height to prove it since it the latest upgraded client is what will still remain in store by that point. Although I think it is crucial that we see a live test of this feature in stargate testnets cc: @cwgoes |
This pull request introduces 1 alert when merging 85817e5 into 3e6089d - view on LGTM.com new alerts:
|
@@ -112,6 +112,14 @@ func (cs ClientState) Validate() error { | |||
return sdkerrors.Wrap(ErrInvalidProofSpecs, "proof spec cannot be nil") | |||
} | |||
} | |||
if cs.UpgradePath != "" { | |||
keys := strings.Split(cs.UpgradePath, "/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we move this to a utility function or is there one we could already use?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still uncertain about the handling on Get/SetUpgradeClient
. It feels like something someone will try to rewrite. Can you add sufficient godoc as to why it is constructed the way it is
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM. Pending previous comments from reviews
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK for most recent changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
Description
The current UpgradeClient followup logic does not take into account at what point the upgrade is going to occur on the old chain. This is an issue because multiple upgrade plans might be voted on and stored, with the latest one taking precedence. This becomes a problem since outdated plans are still provable by IBC light clients. Clients need some way to know what the latest planned upgrade is.
In order to accomplish this, I set the upgraded client at the height the planned upgrade will occur. This upgrade height must then be passed into the
MsgUpgradeClient
struct. The upgrade client logic will use this upgrade height as the proof height to ensure that the passed in upgrade client is the latest agreed upon client at the time of the upgrade height.Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.
docs/
) or specification (x/<module>/spec/
)godoc
comments.Unreleased
section inCHANGELOG.md
Files changed
in the Github PR explorerCodecov Report
in the comment section below once CI passes