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

feat(core): Wire packet handler to core message server #7091

Merged
merged 9 commits into from
Aug 8, 2024

Conversation

DimitrisJim
Copy link
Contributor

@DimitrisJim DimitrisJim commented Aug 8, 2024

Description

still pending on making TimeoutExecuted private and tweaking as many tests as I can.

closes: #7061


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/).
  • Added relevant godoc comments.
  • Provide a conventional commit message to follow the repository standards.
  • Include a descriptive changelog entry when appropriate. This may be left to the discretion of the PR reviewers. (e.g. chores should be omitted from changelog)
  • Re-reviewed Files changed in the GitHub PR explorer.
  • Review SonarCloud Report in the comment section below once CI passes.

// send packet
_, err := suite.chainA.App.GetPacketServer().SendPacket(suite.chainA.GetContext(), nil, packet.SourceChannel, packet.SourcePort, packet.DestinationPort, packet.TimeoutHeight, packet.TimeoutTimestamp, packet.AppVersion, packet.Data)
sequence, err := path.EndpointA.SendPacketV2(defaultTimeoutHeight, disabledTimeoutTimestamp, "", ibctesting.MockPacketData)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

added for convenience, will chage rest to use where applicable


ack = mock.MockAcknowledgement
err = suite.chainB.App.GetPacketServer().WriteAcknowledgement(suite.chainB.GetContext(), nil, packet, ack)
err = path.EndpointB.RecvPacket(packet)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

can now directly use this


case channeltypes.IBC_VERSION_2:
packetHandler = k.PacketServerKeeper
module = msg.Packet.DestinationPort
Copy link
Contributor Author

Choose a reason for hiding this comment

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

was not sure if we want to do fallback yet. can tweak and add tho

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.

Nice work!!


TimeoutPacket(
ctx sdk.Context,
chanCap *capabilitytypes.Capability,
Copy link
Member

@AdityaSripal AdityaSripal Aug 8, 2024

Choose a reason for hiding this comment

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

Hmm if there wasn't originally a chanCapability in this signature why do we need to add it only to then remove it later?

Copy link
Contributor Author

@DimitrisJim DimitrisJim Aug 8, 2024

Choose a reason for hiding this comment

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

because I inlined timeoutExecuted and need to have the signatures matching (TimeoutPacket/OnClose didn't require capability previously), unfortunate but pile it on the list of clean-ups after port-router!

@DimitrisJim
Copy link
Contributor Author

was looking into amending msg_server_tests.go to hopefully iterate through ibc versions and re-check flow. Since they all check both ORDERED/UNORDERED and use v1 functions from testing I felt like intermixing these would be less beneficial.

Ideally should copy over tests, trim down ordered cases, amend functions and just dump them in a new file.

@DimitrisJim DimitrisJim merged commit 366ab9d into feat/ibc-eureka Aug 8, 2024
65 of 66 checks passed
@DimitrisJim DimitrisJim deleted the jim/7061-wire-packet-handler-to-core branch August 8, 2024 14:09
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.

2 participants