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 recv handler #7041

Merged
merged 6 commits into from
Aug 6, 2024

Conversation

DimitrisJim
Copy link
Contributor

@DimitrisJim DimitrisJim commented Aug 5, 2024

Description

closes: #6968


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.

if !ok {
return channeltypes.ErrChannelNotFound
}
if counterparty.ClientId != packet.SourceChannel {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the check for clientID == "", it is validated as non-empty in counterparty.Validate


commitment := channeltypes.CommitPacket(packet)

if err := k.clientKeeper.VerifyMembership(
Copy link
Contributor Author

@DimitrisJim DimitrisJim Aug 5, 2024

Choose a reason for hiding this comment

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

directly use client keeper method now instead of look-up of lcm and call (which also does status check)

return err
}

// REPLAY PROTECTION: Packet receipts will indicate that a packet has already been received
Copy link
Contributor Author

Choose a reason for hiding this comment

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

add replay protection which was missing

// is received for a certain sequence and for all duplicate receives.
func emitRecvPacketEvent(ctx sdk.Context, packet types.Packet, channel types.Channel) {
func EmitRecvPacketEvent(ctx sdk.Context, packet types.Packet, channel *types.Channel) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

think these event funcs should eventually be moved in an internal go package further up the source code tree and be re-used by both 04-channel and the eureka handling code


func (k Keeper) RecvPacket(
ctx sdk.Context,
_ *capabilitytypes.Capability,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

soon to be rm'ed in port router refactor

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.

utACK

modules/core/04-channel/keeper/events.go Outdated Show resolved Hide resolved
modules/core/packet-server/keeper/keeper.go Show resolved Hide resolved
modules/core/packet-server/keeper/keeper.go Outdated Show resolved Hide resolved
modules/core/packet-server/keeper/keeper.go Show resolved Hide resolved
@DimitrisJim DimitrisJim force-pushed the jim/recv-packet-eureka branch 2 times, most recently from db933cb to d8a7adc Compare August 6, 2024 04:47
@DimitrisJim DimitrisJim force-pushed the jim/recv-packet-eureka branch from d8a7adc to 7c982ec Compare August 6, 2024 04:48
@DimitrisJim DimitrisJim marked this pull request as ready for review August 6, 2024 06:37
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.

Minor nits, approving so you can address what makes sense to address and then merge

Copy link

sonarqubecloud bot commented Aug 6, 2024

@DimitrisJim DimitrisJim merged commit 94ad62a into feat/ibc-eureka Aug 6, 2024
64 of 65 checks passed
@DimitrisJim DimitrisJim deleted the jim/recv-packet-eureka branch August 6, 2024 12:18
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