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

improve error messages, indicate already relayed packets #184

Merged
merged 11 commits into from
May 27, 2021

Conversation

colin-axner
Copy link
Contributor

@colin-axner colin-axner commented May 21, 2021

Description

ref: #152


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.
  • Wrote unit and integration tests
  • Updated relevant documentation (docs/) or specification (x/<module>/spec/)
  • Added relevant godoc comments.
  • Added a relevant changelog entry to the Unreleased section in CHANGELOG.md
  • Re-reviewed Files changed in the Github PR explorer
  • Review Codecov Report in the comment section below once CI passes

@codecov-commenter
Copy link

codecov-commenter commented May 21, 2021

Codecov Report

Merging #184 (b0a7fd5) into main (2f97f0b) will increase coverage by 0.18%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #184      +/-   ##
==========================================
+ Coverage   80.05%   80.23%   +0.18%     
==========================================
  Files         109      109              
  Lines        6482     6491       +9     
==========================================
+ Hits         5189     5208      +19     
+ Misses        936      928       -8     
+ Partials      357      355       -2     
Impacted Files Coverage Δ
modules/core/23-commitment/types/merkle.go 65.21% <0.00%> (ø)
modules/core/04-channel/keeper/packet.go 97.09% <100.00%> (+4.02%) ⬆️
modules/core/04-channel/keeper/timeout.go 93.46% <100.00%> (-1.24%) ⬇️
.../light-clients/07-tendermint/types/client_state.go 74.55% <100.00%> (ø)

@colin-axner colin-axner mentioned this pull request May 24, 2021
30 tasks
Copy link
Member

@AdityaSripal AdityaSripal left a comment

Choose a reason for hiding this comment

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

Have a couple questions on error messages on ACK/Timeout

modules/core/04-channel/keeper/packet.go Outdated Show resolved Hide resolved
modules/core/04-channel/keeper/packet_test.go Show resolved Hide resolved
modules/core/04-channel/keeper/timeout.go Outdated Show resolved Hide resolved
@colin-axner colin-axner marked this pull request as draft May 26, 2021 11:36
@colin-axner colin-axner marked this pull request as ready for review May 26, 2021 14:06
@AdityaSripal AdityaSripal enabled auto-merge (squash) May 26, 2021 19:44
@colin-axner colin-axner disabled auto-merge May 27, 2021 10:36
@colin-axner colin-axner merged commit 4ecfe16 into main May 27, 2021
@colin-axner colin-axner deleted the colin/152-error-messages branch May 27, 2021 10:37
@@ -462,6 +470,10 @@ func (k Keeper) AcknowledgePacket(

commitment := k.GetPacketCommitment(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())

if len(commitment) == 0 {
return sdkerrors.Wrapf(types.ErrPacketCommitmentNotFound, "packet with sequence (%d) has been acknowledged, or timed out. In rare cases the packet was never sent or the packet sequence is incorrect", packet.GetSequence())
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you mean, "in rare cases"? In the case of incorrect relayer behaviour, perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

correct, should I rephrase? My thought process is it seems very unlikely a relayer would have a proof for a packet never sent (I'm not even sure how this would happen). The only case I can think of is if the relayer sets the packet sequence incorrectly

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's worth noting that this indicates some relayer misconfiguration, yeah. Very minor though.

@@ -80,6 +80,10 @@ func (k Keeper) TimeoutPacket(

commitment := k.GetPacketCommitment(ctx, packet.GetSourcePort(), packet.GetSourceChannel(), packet.GetSequence())

if len(commitment) == 0 {
return sdkerrors.Wrapf(types.ErrPacketCommitmentNotFound, "packet with sequence (%d) has been acknowledged or timed out. In rare cases the packet was never sent or the packet sequence is incorrect", packet.GetSequence())
Copy link
Contributor

Choose a reason for hiding this comment

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

Ditto on the rare cases question

@colin-axner colin-axner mentioned this pull request May 28, 2021
9 tasks
CosmosCar pushed a commit to caelus-labs/ibc-go that referenced this pull request Nov 6, 2023
CosmosCar pushed a commit to caelus-labs/ibc-go that referenced this pull request Nov 6, 2023
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.

4 participants