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

Emit close channel event when a timeout occurs on an ordered channel #202

Closed
3 tasks
colin-axner opened this issue May 28, 2021 · 2 comments · Fixed by #1464
Closed
3 tasks

Emit close channel event when a timeout occurs on an ordered channel #202

colin-axner opened this issue May 28, 2021 · 2 comments · Fixed by #1464
Assignees
Labels
04-channel type: refactor Architecture, code or CI improvements that may or may not tackle technical debt.

Comments

@colin-axner
Copy link
Contributor

Summary

we should emit a channel closed event when a timeout occurs for an ordered channel


For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged/assigned
@colin-axner colin-axner added this to the 1.1.0 milestone May 28, 2021
@crodriguezvega crodriguezvega modified the milestones: 1.1.0, vNext Sep 17, 2021
@crodriguezvega crodriguezvega moved this to Backlog in ibc-go Jan 3, 2022
@crodriguezvega crodriguezvega added 04-channel type: refactor Architecture, code or CI improvements that may or may not tackle technical debt. labels Jan 3, 2022
@crodriguezvega
Copy link
Contributor

crodriguezvega commented May 10, 2022

  • Add new event type EventTypeChannelClosed here.
  • Emit event after this line within the if block.
ctx.EventManager().EmitEvents(sdk.Events{
	sdk.NewEvent(
		types.EventTypeChannelClosed,
		sdk.NewAttribute(types.AttributeKeyPortID, portID),
		sdk.NewAttribute(types.AttributeKeyChannelID, channelID),
		sdk.NewAttribute(types.AttributeCounterpartyPortID, channel.Counterparty.PortId),
		sdk.NewAttribute(types.AttributeCounterpartyChannelID, channel.Counterparty.ChannelId),
		sdk.NewAttribute(types.AttributeKeyConnectionID, channel.ConnectionHops[0]),
                sdk.NewAttribute(types.AttributeKeyChannelOrdering, channel.Ordering.String()),
	),
	sdk.NewEvent(
		sdk.EventTypeMessage,
		sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory),
	),
})

@colin-axner
Copy link
Contributor Author

colin-axner commented May 11, 2022

LGTM

I think this part:

sdk.NewEvent(
		sdk.EventTypeMessage,
		sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory),
	),

is probably not needed.

The event should also have a function in 04-channel/keeper/events.go -> EmitChannelClosedEvent

I would do the event emission after we call EmitTimeoutPacketEvent

@crodriguezvega crodriguezvega moved this from Backlog to Todo in ibc-go May 30, 2022
@chatton chatton self-assigned this May 30, 2022
@crodriguezvega crodriguezvega moved this from Todo to In progress in ibc-go May 30, 2022
Repository owner moved this from In progress to Done in ibc-go May 31, 2022
CosmosCar pushed a commit to caelus-labs/ibc-go that referenced this issue Nov 6, 2023
Block and Tx indexing backend for optimint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
04-channel type: refactor Architecture, code or CI improvements that may or may not tackle technical debt.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants