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(ics04): packet receive event type identifier #1179

Merged
merged 7 commits into from
Apr 22, 2024

Conversation

penso
Copy link
Contributor

@penso penso commented Apr 21, 2024

Closes: #1180

Description

Followup speaking with @rnbguy about a wrong event name I noticed while looking at optionally using ibc-rs for my Cosmos indexer, so it matches the go implementation


PR author checklist:

  • Added changelog entry, using unclog.
  • Added tests.
  • Linked to GitHub issue.
  • Updated code comments and documentation (e.g., docs/).
  • Tagged one reviewer who will be the one responsible for shepherding this PR.

Reviewer checklist:

  • Reviewed Files changed in the GitHub PR explorer.
  • Manually tested (in case integration/unit/mock tests are absent).

@penso penso changed the title fix: ics04 packet event name fix:(ics04) packet event name Apr 21, 2024
@rnbguy rnbguy changed the title fix:(ics04) packet event name fix(ics04): packet receive event identifier Apr 21, 2024
@rnbguy rnbguy changed the title fix(ics04): packet receive event identifier fix(ics04): packet receive event type identifier Apr 21, 2024
@rnbguy rnbguy requested review from romac and seanchen1991 April 21, 2024 12:56
@@ -32,13 +32,14 @@ const CHANNEL_OPEN_ACK_EVENT: &str = "channel_open_ack";
const CHANNEL_OPEN_CONFIRM_EVENT: &str = "channel_open_confirm";
const CHANNEL_CLOSE_INIT_EVENT: &str = "channel_close_init";
const CHANNEL_CLOSE_CONFIRM_EVENT: &str = "channel_close_confirm";
const CHANNEL_CLOSED_EVENT: &str = "channel_close";
Copy link
Contributor

Choose a reason for hiding this comment

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

Moving the CHANNEL_CLOSED_EVENT constant under the channel event types section introduces some ambiguity regarding the semantics and the purpose of the constant. The string itself being just "channel_close" when all the other "channel_*" constants carry some additional meaning also contributes to the ambiguity.

Can we at least add a docstring comment on the CHANNEL_CLOSED_EVENT constant?

Copy link
Collaborator

@rnbguy rnbguy Apr 22, 2024

Choose a reason for hiding this comment

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

you mean "channel_close_*", right?

It should definitely be

- "channel_close"
+ "channel_closed"

Copy link
Collaborator

Choose a reason for hiding this comment

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

I would suggest just adding a reference link to ibc-go. Because we copy these values from there.

Copy link
Contributor

Choose a reason for hiding this comment

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

ibc-go actually uses channel_close, not channel_closed, which is a bit confusing. But if parity is what we're aiming for, then I guess we go with channel_close.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yea, that's what I meant that we don't have a choice here 😅

@seanchen1991 seanchen1991 removed the request for review from romac April 22, 2024 16:44
Copy link
Contributor

@seanchen1991 seanchen1991 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for the contribution @penso!

@seanchen1991 seanchen1991 added this pull request to the merge queue Apr 22, 2024
Merged via the queue into cosmos:main with commit 41348af Apr 22, 2024
16 checks passed
@penso penso deleted the fix-recv-packet-name branch April 22, 2024 19:36
@cosmos cosmos deleted a comment Apr 23, 2024
@rnbguy
Copy link
Collaborator

rnbguy commented May 10, 2024

Related to #374

Farhad-Shabani pushed a commit that referenced this pull request Sep 9, 2024
* fix: ics04 packet event name

* Add Changelog

* Fix Changelog

* nit on const decl group

* nits on changelog entry

* Add link to ibc-go channel events

---------

Co-authored-by: Ranadeep Biswas <[email protected]>
Co-authored-by: Sean Chen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 👀 In Review
Development

Successfully merging this pull request may close these issues.

ics04 doesn't follow go implementation
3 participants