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/eureka): add timeout handler #7060

Merged
merged 11 commits into from
Aug 6, 2024

Conversation

AdityaSripal
Copy link
Member

@AdityaSripal AdityaSripal commented Aug 6, 2024

Description

closes: #6970


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 title timeout eureka implementation feat(core/eureka): add timeout handler Aug 6, 2024
suite.Require().NoError(err, "send packet failed")

// set packet receipt to mock a valid past receive
suite.chainB.App.GetIBCKeeper().ChannelKeeper.SetPacketReceipt(suite.chainB.GetContext(), packet.DestinationPort, packet.DestinationChannel, packet.Sequence)
Copy link
Member Author

Choose a reason for hiding this comment

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

Decided to just mock the receive here. I could do an actual receive but then would have to make sure the packet isn't timeout out for when the receive occurs but is timed out for the timeout and it ended up looking more confusing setup than just setting directly

@AdityaSripal AdityaSripal marked this pull request as ready for review August 6, 2024 13:33
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.

went through 04-channel's TimeoutPacket and VerifyPacketReceiptAbsence. Overall lgtm, only left nit-erinos

proofHeight exported.Height,
nextSequenceRecv uint64,
) error {
// Lookup counterparty associated with our channel and ensure that destination channel
Copy link
Contributor

Choose a reason for hiding this comment

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

can we do protocol version check here too?


// delete packet commitment to prevent replay
k.ChannelKeeper.DeletePacketCommitment(ctx, packet.SourcePort, packet.SourceChannel, packet.Sequence)

Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can also do the log here (think we also missed it for Send)

packet channeltypes.Packet,
proof []byte,
proofHeight exported.Height,
nextSequenceRecv uint64,
Copy link
Contributor

Choose a reason for hiding this comment

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

considering its relevant only for ordered which we do not have

Suggested change
nextSequenceRecv uint64,
_ uint64,

path := host.PacketReceiptKey(packet.DestinationPort, packet.DestinationChannel, packet.Sequence)
merklePath := types.BuildMerklePath(counterparty.MerklePathPrefix, path)

if err := k.ClientKeeper.VerifyNonMembership(
Copy link
Contributor

Choose a reason for hiding this comment

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

guess a client status check might also be nice here if working it in the tests isn't too much of a pain in the ass

proof,
merklePath,
); err != nil {
return err
Copy link
Contributor

Choose a reason for hiding this comment

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

we could wrap errors as 03-connection does, think I missed doing that too.

Copy link

sonarqubecloud bot commented Aug 6, 2024

@AdityaSripal AdityaSripal merged commit 8c3a9a4 into feat/ibc-eureka Aug 6, 2024
63 of 65 checks passed
@AdityaSripal AdityaSripal deleted the aditya/timeout-eureka branch August 6, 2024 18:47
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