-
Notifications
You must be signed in to change notification settings - Fork 586
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
fix: complete changes for CheckSubstituteAndUpdateState #1878
fix: complete changes for CheckSubstituteAndUpdateState #1878
Conversation
ctx.EventManager().EmitEvent( | ||
sdk.NewEvent( | ||
types.EventTypeUpdateClientProposal, | ||
sdk.NewAttribute(types.AttributeKeySubjectClientID, clientID), | ||
sdk.NewAttribute(types.AttributeKeyClientType, clientState.ClientType()), | ||
sdk.NewAttribute(types.AttributeKeyConsensusHeight, clientState.GetLatestHeight().String()), |
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.
There's no way to guarantee the latest height of the substitute is the latest height of subject. I question the usefulness of this information, so I'd prefer to remove it for now until it is requested (at which time we can query the subject client state)
|
||
defer func() { | ||
telemetry.IncrCounterWithLabels( | ||
[]string{"ibc", "client", "update"}, | ||
1, | ||
[]metrics.Label{ | ||
telemetry.NewLabel(types.LabelClientType, clientState.ClientType()), | ||
telemetry.NewLabel(types.LabelClientType, substituteClientState.ClientType()), |
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.
cannot guarantee client type doesn't change for the subject, so we use the substitute client type
CheckSubstituteAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore, substituteClientStore sdk.KVStore, substituteClient ClientState) (ClientState, error) | ||
// CheckSubstituteAndUpdateState must verify that the provided substitute may be used to update the subject client. | ||
// The light client must set the updated client and consensus states within the clientStore for the subject client. | ||
CheckSubstituteAndUpdateState(ctx sdk.Context, cdc codec.BinaryCodec, subjectClientStore, substituteClientStore sdk.KVStore, substituteClient ClientState) error |
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 realized we (I) forgot to update the interface for this function
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.
Good spot! LGTM
…c-go into colin/fix-substitute-interface
Description
closes: #XXXX
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