-
Notifications
You must be signed in to change notification settings - Fork 610
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
ChanUpgradeTimeout
msg_server
function
#3855
Changes from 41 commits
50b1163
ba1fde4
8cd8c0b
392a5b5
0a363de
a227949
8b18b02
7b8b67b
760940b
106ac13
7f12c0b
29f84ce
16f196a
17748af
7341c5a
e9a2c20
900dcb6
8cf4a62
661f006
014990e
5153722
4326f79
42c124d
480d28e
e83a917
9ee7758
55bc80f
3fc5a86
21ea910
3abf883
2a1b870
f703ae1
ee6b71b
ef48a1b
c15d556
8fc43af
b2f777b
e7afe58
c4f3c81
47897ec
1759848
118c94d
a392979
3ac26a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -466,10 +466,10 @@ func (k Keeper) ChanUpgradeTimeout( | |
return nil | ||
} | ||
|
||
// writeUpgradeTimeoutChannel restores the channel state of an initialising chain in the event that the counterparty chain has passed the timeout set in ChanUpgradeInit to the state before the upgrade was proposed. | ||
// WriteUpgradeTimeoutChannel restores the channel state of an initialising chain in the event that the counterparty chain has passed the timeout set in ChanUpgradeInit to the state before the upgrade was proposed. | ||
// Auxiliary upgrade state is also deleted. | ||
// An event is emitted for the handshake step. | ||
func (k Keeper) writeUpgradeTimeoutChannel( | ||
func (k Keeper) WriteUpgradeTimeoutChannel( | ||
charleenfei marked this conversation as resolved.
Show resolved
Hide resolved
|
||
ctx sdk.Context, | ||
portID, channelID string, | ||
) error { | ||
|
@@ -485,9 +485,7 @@ func (k Keeper) writeUpgradeTimeoutChannel( | |
panic(fmt.Sprintf("could not find existing upgrade when cancelling channel upgrade, channelID: %s, portID: %s", channelID, portID)) | ||
} | ||
|
||
if err := k.AbortUpgrade(ctx, portID, channelID, types.NewUpgradeError(channel.UpgradeSequence, types.ErrUpgradeTimeout)); err != nil { | ||
return errorsmod.Wrapf(types.ErrUpgradeRestoreFailed, "err: %v", err) | ||
} | ||
k.restoreChannel(ctx, portID, channelID, channel) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use restore here because we don't need to set an error receipt, just restoring channel state. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fine by me, see cosmos/ibc#986 for additional thoughts on the matter |
||
|
||
k.Logger(ctx).Info("channel state restored", "port-id", portID, "channel-id", channelID) | ||
emitChannelUpgradeTimeoutEvent(ctx, portID, channelID, channel, upgrade) | ||
|
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.
we are actually calling
OnChanUpgradeRestore
in theUpgradeTimeout
application callbacks