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

Use enums in channel handshake log #3384

Merged
merged 1 commit into from
Mar 31, 2023

Conversation

expertdicer
Copy link
Contributor

@expertdicer expertdicer commented Mar 31, 2023

Description

closes: #3335

Commit Message / Changelog Entry

nit: Use enums in channel handshake log

see the guidelines for commit messages. (view raw markdown for examples)


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.

  • Targeted PR against correct branch (see CONTRIBUTING.md).
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Code follows the module structure standards and Go style guide.
  • Wrote unit and integration tests.
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/).
  • Added relevant godoc comments.
  • Provide a commit message to be used for the changelog entry in the PR description for review.
  • Re-reviewed Files changed in the Github PR explorer.
  • Review Codecov Report in the comment section below once CI passes.

Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Contributor

@crodriguezvega crodriguezvega left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all your contributions lately, @expertdicer!

I just realised that we can make the same improvement in the log statements in connection handshake. I opened this issue just now; if you're interested to take it, please comment and I will assign it to you. :)

@crodriguezvega crodriguezvega merged commit 3849b0f into cosmos:main Mar 31, 2023
@expertdicer expertdicer deleted the nguyen/use-enums branch March 31, 2023 08:01
@expertdicer
Copy link
Contributor Author

Thanks for all your contributions lately, @expertdicer!

I just realised that we can make the same improvement in the log statements in connection handshake. I opened this issue just now; if you're interested to take it, please comment and I will assign it to you. :)

yes please. Ty

Copy link
Contributor

@damiannolan damiannolan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @expertdicer! I think the WriteOpenAckChannel log is incorrect.
If you're picking up #3385 feel free to make a quick change in that :)

Thanks for the PR 🙏

@@ -204,7 +204,7 @@ func (k Keeper) WriteOpenTryChannel(

k.SetChannel(ctx, portID, channelID, channel)

k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", "NONE", "new-state", "TRYOPEN")
k.Logger(ctx).Info("channel state updated", "port-id", portID, "channel-id", channelID, "previous-state", types.UNINITIALIZED.String(), "new-state", types.TRYOPEN.String())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the case of crossing hellos, it may be possible that previous sate could be UNINITIALIZED or INIT.
But I think support for crossing hellos in opening handshakes was removed at some point 🤔

modules/core/04-channel/keeper/handshake.go Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use state in enums in channel handshake logs
4 participants