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

Should we check ChannelToChain on AcknowledgePacket #716

Closed
AdityaSripal opened this issue Feb 7, 2023 · 1 comment
Closed

Should we check ChannelToChain on AcknowledgePacket #716

AdityaSripal opened this issue Feb 7, 2023 · 1 comment
Assignees
Labels
good first issue Good for newcomers source: audit To indicate an issue found during an audit.

Comments

@AdityaSripal
Copy link
Member

ChannelToChain mapping is checked on TimeoutPacket but not on AcknowledgePacket

chainID, found := k.GetChannelToChain(ctx, packet.SourceChannel)

func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, ack channeltypes.Acknowledgement) error {

Not sure if there is a reason for the difference

@AdityaSripal AdityaSripal added the source: audit To indicate an issue found during an audit. label Feb 7, 2023
@mpoke mpoke added this to Cosmos Hub Feb 23, 2023
@github-project-automation github-project-automation bot moved this to 🩹 Triage in Cosmos Hub Feb 23, 2023
@mpoke mpoke added this to the ICS v1.0.1 milestone Feb 23, 2023
@mpoke mpoke moved this from 🩹 Triage to 📥 Todo in Cosmos Hub Feb 23, 2023
@mpoke mpoke modified the milestones: ICS v1.0.1, ICS next release Mar 5, 2023
@mpoke mpoke added the good first issue Good for newcomers label Mar 13, 2023
@mpoke mpoke modified the milestones: ICS next release, Gaia v10.0.0 Mar 13, 2023
@mpoke mpoke removed this from the Gaia v10.0.0 milestone Jun 20, 2023
@insumity
Copy link
Contributor

Synced (offline) with @AdityaSripal and we can close this ticket.

The reason being that k.GetChannelToChain is actually called by both OnTimeoutPacket and OnAcknowledgementPacket. Note that k.GetChannelToChain is used in a similar fashion by both methods. In OnTimeoutPacket we know something went wrong due to the timeout and we get the chain with k.GetChannelToChain, if we find the chain we stop it. Similarly, in OnAcknowledgementPacket if there's an error in the acknowledgement, we get the chain through k.GetChannelToChain and if we find the chain we stop it.

@github-project-automation github-project-automation bot moved this from 📥 Todo to ✅ Done in Cosmos Hub Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers source: audit To indicate an issue found during an audit.
Projects
Status: ✅ Done
Development

No branches or pull requests

3 participants