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(eureka): fix condition in commit packet, added test for zero timeout height #7109

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

crodriguezvega
Copy link
Contributor

@crodriguezvega crodriguezvega commented Aug 8, 2024

Description

  • Fix condition on commitV2Packet where timeout height should be hashed only if not empty.
  • Reformat some error messages.
  • Change some comments.

closes: #XXXX


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.

…hange some error messages and add some more comments
@@ -67,7 +67,7 @@ func commitV2Packet(packet Packet) []byte {
timeoutBuf := sdk.Uint64ToBigEndian(packet.GetTimeoutTimestamp())

// only hash the timeout height if it is non-zero. This will allow us to remove it entirely in the future
if timeoutHeight.EQ(clienttypes.ZeroHeight()) {
if !timeoutHeight.EQ(clienttypes.ZeroHeight()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the most important fix in the PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

yea, seems like it was missed after the suggestion, great eye!

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.

these look right to me, nicely caught the conditional!

@@ -67,7 +67,7 @@ func commitV2Packet(packet Packet) []byte {
timeoutBuf := sdk.Uint64ToBigEndian(packet.GetTimeoutTimestamp())

// only hash the timeout height if it is non-zero. This will allow us to remove it entirely in the future
if timeoutHeight.EQ(clienttypes.ZeroHeight()) {
if !timeoutHeight.EQ(clienttypes.ZeroHeight()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

yea, seems like it was missed after the suggestion, great eye!

modules/core/packet-server/keeper/keeper.go Show resolved Hide resolved
Copy link

sonarqubecloud bot commented Aug 8, 2024

@crodriguezvega crodriguezvega merged commit 2a07e6e into feat/ibc-eureka Aug 9, 2024
64 of 65 checks passed
@crodriguezvega crodriguezvega deleted the carlos/fix-commit-packet branch August 9, 2024 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants