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

Handle ordered packets in UnreceivedPackets query. #3346

Conversation

DimitrisJim
Copy link
Contributor

@DimitrisJim DimitrisJim commented Mar 27, 2023

Description

closes: #1532

Commit Message / Changelog Entry

fix: handle ordered packets in `UnreceivedPackets` query.

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.

@codecov-commenter
Copy link

codecov-commenter commented Mar 27, 2023

Codecov Report

Merging #3346 (5ef8854) into main (ae27fa5) will decrease coverage by 0.07%.
The diff coverage is 60.97%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3346      +/-   ##
==========================================
- Coverage   78.66%   78.59%   -0.07%     
==========================================
  Files         181      181              
  Lines       12511    12546      +35     
==========================================
+ Hits         9842     9861      +19     
- Misses       2238     2252      +14     
- Partials      431      433       +2     
Impacted Files Coverage Δ
modules/core/04-channel/keeper/grpc_query.go 85.03% <60.97%> (-3.22%) ⬇️

... and 1 file with indirect coverage changes

// are present. 2 is received so 7, 9, 10 should be unreceived.
expSeq = []uint64{7, 9, 10}
packetCommitments := []uint64{2, 7, 9, 10}
suite.chainA.App.GetIBCKeeper().ChannelKeeper.SetNextSequenceRecv(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, 5)
Copy link
Contributor

@charleenfei charleenfei Mar 27, 2023

Choose a reason for hiding this comment

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

maybe the NextSequenceRecv parameter and the expSeq/packetCommitments variables can be set up as well generally as variables for the test which are then malleated per test?

Copy link
Contributor Author

@DimitrisJim DimitrisJim Mar 27, 2023

Choose a reason for hiding this comment

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

expSeq is already set up as so (If i'm understanding the comment correctly) and the rationale I got was that it's done since we need to assert its value against the expected in the main test body. Let me know if I got something wrong here.

Copy link
Contributor

Choose a reason for hiding this comment

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

ah okay, i was just seeing the packet commitment sequences getting declared/set on the tests as well as the sequence number, so i was thinking to just set them as variables instead for readability -- but i am not very strongly opinionated, i agree that expSeq is the most important as we are testing for that value as the expected one. thanks!

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

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

Looks great nice job! Just had a few suggestions 👍

modules/core/04-channel/keeper/grpc_query.go Outdated Show resolved Hide resolved
modules/core/04-channel/keeper/grpc_query_test.go Outdated Show resolved Hide resolved
modules/core/04-channel/keeper/grpc_query.go Outdated Show resolved Hide resolved
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.

Nice work, @DimitrisJim!

modules/core/04-channel/keeper/grpc_query_test.go Outdated Show resolved Hide resolved
modules/core/04-channel/keeper/grpc_query_test.go Outdated Show resolved Hide resolved
modules/core/04-channel/keeper/grpc_query.go Show resolved Hide resolved
@DimitrisJim
Copy link
Contributor Author

Test failure appears to be #3264.

Copy link
Contributor

@chatton chatton left a comment

Choose a reason for hiding this comment

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

LGTM nice work 👍

Copy link
Contributor

@charleenfei charleenfei left a comment

Choose a reason for hiding this comment

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

nice work, lgtm :)

@DimitrisJim
Copy link
Contributor Author

DimitrisJim commented Mar 29, 2023

Thanks all for the thorough reviews!

Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

Thank you @DimitrisJim! Everything looks great to me. I left several code improvement suggestions, most of which are modifying existing code/comments. Perfectly fine with if they are not all applied and/or modified. Thanks for adding all the tests!

modules/core/04-channel/keeper/grpc_query.go Show resolved Hide resolved
modules/core/04-channel/keeper/grpc_query.go Outdated Show resolved Hide resolved
modules/core/04-channel/keeper/grpc_query.go Show resolved Hide resolved
modules/core/04-channel/keeper/grpc_query.go Outdated Show resolved Hide resolved
modules/core/04-channel/keeper/grpc_query.go Outdated Show resolved Hide resolved
modules/core/04-channel/keeper/grpc_query_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@colin-axner colin-axner left a comment

Choose a reason for hiding this comment

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

ACK, thanks @DimitrisJim!

@crodriguezvega crodriguezvega merged commit c77f80f into main Mar 30, 2023
@crodriguezvega crodriguezvega deleted the jim/1532-unreceivedpackets-grpc-query-handler-only-works-for-unordered-channels branch March 30, 2023 18:55
colin-axner pushed a commit that referenced this pull request May 18, 2023
…3606)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

* fix conflicts

* fix links

* add changelog

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
colin-axner pushed a commit that referenced this pull request May 18, 2023
…3607)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

* fix conflicts

* fix links

* add changelog

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
colin-axner pushed a commit that referenced this pull request May 18, 2023
…3608)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

* fix conflicts

* add changelog

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
colin-axner pushed a commit that referenced this pull request May 18, 2023
…3609)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

* fix conflicts

* fix version of golangci

* add exclude rule

* add exclude rule

* add changelog

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
colin-axner pushed a commit that referenced this pull request May 18, 2023
…3610)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

* fix conflicts

* add changelog

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
colin-axner pushed a commit that referenced this pull request May 18, 2023
…3611)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

* fix dead links and version of golangci

* fix conflicts

* add exclude rule

* add changelod

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
colin-axner pushed a commit that referenced this pull request May 18, 2023
…3612)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

* add changelog

* add import

* use sdkerrors

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
colin-axner pushed a commit that referenced this pull request May 18, 2023
…3613)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

* fix conflicts

* add changelog

* fix version golangci

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
DimitrisJim added a commit that referenced this pull request May 18, 2023
…3614)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
Co-authored-by: colin axner <[email protected]>
crodriguezvega pushed a commit that referenced this pull request May 23, 2023
…3629)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

* fix conflicts

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
@faddat faddat mentioned this pull request Jun 23, 2023
9 tasks
ulbqb pushed a commit to ulbqb/ibc-go that referenced this pull request Jul 27, 2023
) (cosmos#3607)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

* fix conflicts

* fix links

* add changelog

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
ulbqb pushed a commit to ulbqb/ibc-go that referenced this pull request Jul 31, 2023
) (cosmos#3607)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

* fix conflicts

* fix links

* add changelog

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
ulbqb pushed a commit to ulbqb/ibc-go that referenced this pull request Jul 31, 2023
) (cosmos#3607)

* fix: handle ordered packets in `UnreceivedPackets` query

Co-authored-by: Cian Hatton <[email protected]>
(cherry picked from commit c77f80f)

* fix conflicts

* fix links

* add changelog

---------

Co-authored-by: Jim Fasarakis-Hilliard <[email protected]>
Co-authored-by: Carlos Rodriguez <[email protected]>
@ulbqb ulbqb mentioned this pull request Jul 31, 2023
9 tasks
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.

UnreceivedPackets grpc query handler only works for unordered channels
7 participants