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

imp: add logic for setting NextSeqRecv, NextSeqAck in OnChanUpgradeOpen #5438

Merged
merged 26 commits into from
Dec 20, 2023

Conversation

charleenfei
Copy link
Contributor

@charleenfei charleenfei commented Dec 18, 2023

Description

ref spec changes

note that the counterparty last send seq and other pruning related topics will be addressed in upcoming PRs.
this PR covers just the logic for setting NextSeqRecv and NextSeqAck in the upgrade handlers.

Commit Message / Changelog Entry

type: commit message

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 the 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.

@charleenfei charleenfei changed the title imp: add logic for setting NextSeqRecv OnChanUpgradeOpen imp: add logic for setting NextSeqRecv, NextSeqAck in OnChanUpgradeOpen Dec 19, 2023
@charleenfei charleenfei changed the title imp: add logic for setting NextSeqRecv, NextSeqAck in OnChanUpgradeOpen imp: add logic for setting NextSeqRecv, NextSeqAck in OnChanUpgradeOpen Dec 19, 2023
@crodriguezvega crodriguezvega added the channel-upgradability Channel upgradability feature label Dec 19, 2023
@charleenfei charleenfei marked this pull request as ready for review December 19, 2023 09:59
@charleenfei charleenfei marked this pull request as draft December 19, 2023 10:11
@charleenfei charleenfei marked this pull request as ready for review December 19, 2023 10:13
@charleenfei charleenfei marked this pull request as draft December 19, 2023 10:29
@@ -351,30 +351,6 @@ func (suite *KeeperTestSuite) TestRecvPacket() {
channel := path.EndpointB.GetChannel()
channel.State = types.FLUSHING
path.EndpointB.SetChannel(channel)

Copy link
Contributor Author

@charleenfei charleenfei Dec 19, 2023

Choose a reason for hiding this comment

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

i removed these tests bc we aren't checking these sequences in RecvPacket anymore

@charleenfei charleenfei marked this pull request as ready for review December 19, 2023 15:12
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.

Only a comment on even more assertion in test, but its implicitly checked. Shouldn't block merge if not written, with an optional isssue opened to add this if people find it important. I'm personally ambivalent, just saw that the test comment may be expecting that to be the case

ctx := suite.chainA.GetContext()

// assert that sequence (reset in ChanUpgradeTry) is 1 because channel is UNORDERED
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand the reset comment

Copy link
Member

Choose a reason for hiding this comment

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

Should we also be assert the counterpartyNextSequenceSend is 2 here?

Copy link
Contributor Author

@charleenfei charleenfei Dec 19, 2023

Choose a reason for hiding this comment

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

i believe we set the sequences to 1 so that the upgrade proof can be verified without the exact last sequences

modules/core/04-channel/keeper/upgrade_test.go Outdated Show resolved Hide resolved
@crodriguezvega crodriguezvega added the priority PRs that need prompt reviews label Dec 19, 2023
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.

Fantastic, @charleenfei! Thank you for adapting the code so quickly to the spec updates.

Copy link
Contributor

@DimitrisJim DimitrisJim left a comment

Choose a reason for hiding this comment

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

lgtm too! I left some minor nits, mostly on naming/comments

modules/core/04-channel/keeper/upgrade.go Outdated Show resolved Hide resolved
modules/core/04-channel/keeper/upgrade_test.go Outdated Show resolved Hide resolved
modules/core/04-channel/keeper/upgrade_test.go Outdated Show resolved Hide resolved
modules/core/04-channel/keeper/upgrade_test.go Outdated Show resolved Hide resolved
modules/core/04-channel/keeper/upgrade_test.go Outdated Show resolved Hide resolved
@DimitrisJim
Copy link
Contributor

quick q: do we want to merge #5460 and #5469 before merging this? Have no strong preference, whatever people prefer.

@charleenfei
Copy link
Contributor Author

quick q: do we want to merge #5460 and #5469 before merging this? Have no strong preference, whatever people prefer.

I am happy to merge them before and rebase, sounds more efficient to me!

Copy link
Member

@damiannolan damiannolan 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! Agree with @DimitrisJim's testing comments for improvements :)

LGTM

modules/core/04-channel/keeper/upgrade_test.go Outdated Show resolved Hide resolved
DimitrisJim and others added 2 commits December 20, 2023 14:39
…deOpen. (#5460)

* Add key for storing counterparty next sequence send.

* nit: function order localtion

* SetNextSequenceSend -> SetCounterpartyNextSequenceSend

* Add assertions to check for correct values set in tests.

* Rename keys.

* Apply suggestions from code review

Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>

---------

Co-authored-by: Carlos Rodriguez <carlos@interchain.io>
Co-authored-by: colin axnér <25233464+colin-axner@users.noreply.github.com>
@charleenfei
Copy link
Contributor Author

i'm gonna merge this one first after checks pass before this one, as there will be some reworking of that logic

@charleenfei charleenfei merged commit 34edc2e into 04-channel-upgrades Dec 20, 2023
56 checks passed
@charleenfei charleenfei deleted the charly/set_nextseqrecv branch December 20, 2023 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
channel-upgradability Channel upgradability feature priority PRs that need prompt reviews
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants