Skip to content
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(logging): displays correct chain info when query IBC header fails #1423

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 22 additions & 5 deletions relayer/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,9 @@ func MsgUpdateClient(
dstClientState, err = dst.ChainProvider.QueryClientState(ctx, dsth, dst.ClientID())
return err
}, retry.Context(ctx), RtyAtt, RtyDel, RtyErr, retry.OnRetry(func(n uint, err error) {
dst.log.Info(
dst.log.Error(
"Failed to query client state when updating clients",
zap.String("chain_id", dst.ChainID()),
zap.String("client_id", dst.ClientID()),
zap.Uint("attempt", n+1),
zap.Uint("max_attempts", RtyAttNum),
Expand All @@ -301,12 +302,20 @@ func MsgUpdateClient(
eg.Go(func() error {
return retry.Do(func() error {
var err error
src.log.Debug(
"Query IBC header",
zap.String("chain_id", src.ChainID()),
zap.String("client_id", src.ClientID()),
zap.Int64("height", srch),
)
srcHeader, err = src.ChainProvider.QueryIBCHeader(egCtx, srch)
return err
}, retry.Context(egCtx), RtyAtt, RtyDel, RtyErr, retry.OnRetry(func(n uint, err error) {
src.log.Info(
src.log.Error(
"Failed to query IBC header when building update client message",
zap.String("client_id", dst.ClientID()),
zap.String("chain_id", src.ChainID()),
zap.String("client_id", src.ClientID()),
zap.Int64("height", srch),
zap.Uint("attempt", n+1),
zap.Uint("max_attempts", RtyAttNum),
zap.Error(err),
Expand All @@ -316,12 +325,20 @@ func MsgUpdateClient(
eg.Go(func() error {
return retry.Do(func() error {
var err error
src.log.Debug(
"Query IBC header",
zap.String("chain_id", src.ChainID()),
zap.String("client_id", src.ClientID()),
zap.Int64("height", int64(dstClientState.GetLatestHeight().GetRevisionHeight())+1),
jtieri marked this conversation as resolved.
Show resolved Hide resolved
)
dstTrustedHeader, err = src.ChainProvider.QueryIBCHeader(egCtx, int64(dstClientState.GetLatestHeight().GetRevisionHeight())+1)
return err
}, retry.Context(egCtx), RtyAtt, RtyDel, RtyErr, retry.OnRetry(func(n uint, err error) {
src.log.Info(
src.log.Error(
"Failed to query IBC header when building update client message",
zap.String("client_id", dst.ClientID()),
zap.String("chain_id", src.ChainID()),
zap.String("client_id", src.ClientID()),
zap.Int64("height", int64(dstClientState.GetLatestHeight().GetRevisionHeight())+1),
jtieri marked this conversation as resolved.
Show resolved Hide resolved
zap.Uint("attempt", n+1),
zap.Uint("max_attempts", RtyAttNum),
zap.Error(err),
Expand Down
Loading