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

Rename Id Fields to Channel for Packet V2 #7428

Merged
merged 2 commits into from
Oct 9, 2024

Conversation

AdityaSripal
Copy link
Member

@AdityaSripal AdityaSripal commented Oct 9, 2024

Description

closes: #7416


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.

@AdityaSripal AdityaSripal changed the base branch from main to feat/ibc-eureka October 9, 2024 15:30
Copy link
Contributor

@bznein bznein left a comment

Choose a reason for hiding this comment

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

LGTM you even catched some commented out code to change :D

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.

Noticed a few mishaps in calls to verifyMembership. As well as a few log/error strings to be updated.

Otherwise lgtm!

modules/core/04-channel/v2/keeper/relay.go Outdated Show resolved Hide resolved
merklePath := types.BuildMerklePath(counterparty.MerklePathPrefix, path)

if err := k.ClientKeeper.VerifyNonMembership(
ctx,
packet.SourceId,
packet.SourceChannel,
Copy link
Member

Choose a reason for hiding this comment

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

This should be looking up the v2 channelEnd (now counterparty) and taking the clientID from it and using it here!

Not sure if you want to do that in this PR or not

merklePath := types.BuildMerklePath(counterparty.MerklePathPrefix, path)

commitment := channeltypesv2.CommitPacket(packet)

if err := k.ClientKeeper.VerifyMembership(
ctx,
packet.DestinationId,
packet.DestinationChannel,
Copy link
Member

Choose a reason for hiding this comment

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

Likewise, lookup v2 channelEnd and use the clientID rather than channelID

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, changed this in packetserver/relay.go recently. In general, there might be some tweaks necessary in these files before tests for it pass.

Copy link
Member Author

Choose a reason for hiding this comment

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

nice catch!! Though it seems this was already wrong before

Copy link
Member

Choose a reason for hiding this comment

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

Yup!

modules/core/04-channel/v2/keeper/relay.go Outdated Show resolved Hide resolved
}
}
if counterparty.ClientId != packet.SourceId {
if counterparty.ClientId != packet.SourceChannel {
Copy link
Contributor

@DimitrisJim DimitrisJim Oct 9, 2024

Choose a reason for hiding this comment

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

not related to this but should be CounterpartyChannelId. Unsure if this applies elsewhere but feel free to fix in follow-up.

merklePath := types.BuildMerklePath(counterparty.MerklePathPrefix, path)

commitment := channeltypesv2.CommitPacket(packet)

if err := k.ClientKeeper.VerifyMembership(
ctx,
packet.DestinationId,
packet.DestinationChannel,
Copy link
Contributor

Choose a reason for hiding this comment

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

yes, changed this in packetserver/relay.go recently. In general, there might be some tweaks necessary in these files before tests for it pass.

Copy link

sonarcloud bot commented Oct 9, 2024

@AdityaSripal
Copy link
Member Author

I think the above should be fixed in a separate PR. Will create a tracking issue

@AdityaSripal AdityaSripal merged commit 7e02a96 into feat/ibc-eureka Oct 9, 2024
66 checks passed
@AdityaSripal AdityaSripal deleted the aditya/packet-rename branch October 9, 2024 17:06
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