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

Separate validation and handling for recv slash packets #542

Merged
merged 34 commits into from
Dec 7, 2022
Merged

Conversation

shaspitz
Copy link
Contributor

@shaspitz shaspitz commented Dec 2, 2022

Description

This PR separates out validation and handling for slash packets received on the provider. This allows us to separate out the concerns of

  1. At validation time, we return an IBC err ack immediately upon failure
  2. At handling time, we stop handling (no-op), or panic the binary upon system critical failures like marshalling. No errors are returned

No functionality should be changed in this PR, but the refactors are needed to properly implement #462

Note: VSCMatured packet handling is refactored in this PR as well (just adds an explicit handler method). Jehan and I decided it doesn't make sense to have a validate method for VSCMatured packets since there's not a case in which to return an IBC err ack

Linked issues

Closes #414

Type of change

Please delete options that are not relevant.

  • Non-breaking changes
  • Updates in store keepers or store keys
  • Testing

How was the feature tested?

  • Unit tests
  • E2E tests

Other information

Changes in functionality are reserved for #546 and #547

Checklist:

Please delete options that are not relevant.

  • Relevant issus are linked
  • Other PRs depend on this feature: #<issue>
  • testutil/e2e/debug_test.go is up-to-date with additional or changed e2e test names

@shaspitz shaspitz marked this pull request as ready for review December 2, 2022 23:52
Copy link
Contributor

@jtremback jtremback left a comment

Choose a reason for hiding this comment

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

LGTM except for the refactor getting rid of the getChainIdOrPanic method. But @mpoke really needs to review it.

@shaspitz shaspitz changed the title Separate validation and handling for recv provider packets Separate validation and handling for recv slash packets Dec 6, 2022
Copy link
Contributor

@danwt danwt left a comment

Choose a reason for hiding this comment

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

Nice! This makes things much easier to read.

x/ccv/provider/keeper/relay.go Show resolved Hide resolved
x/ccv/provider/keeper/relay.go Show resolved Hide resolved
x/ccv/provider/keeper/relay.go Show resolved Hide resolved
x/ccv/provider/keeper/relay.go Outdated Show resolved Hide resolved
x/ccv/provider/keeper/relay.go Outdated Show resolved Hide resolved
x/ccv/provider/keeper/relay.go Show resolved Hide resolved
x/ccv/provider/keeper/hooks.go Outdated Show resolved Hide resolved
testutil/keeper/expectations.go Outdated Show resolved Hide resolved
Copy link
Contributor

@mpoke mpoke 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 @smarshall-spitzbart. See my comments below.

x/ccv/provider/keeper/relay.go Show resolved Hide resolved
x/ccv/provider/keeper/relay.go Show resolved Hide resolved
x/ccv/provider/keeper/relay.go Show resolved Hide resolved
x/ccv/provider/keeper/relay.go Outdated Show resolved Hide resolved
x/ccv/provider/keeper/relay.go Show resolved Hide resolved
x/ccv/provider/keeper/relay.go Outdated Show resolved Hide resolved
x/ccv/provider/keeper/relay.go Outdated Show resolved Hide resolved
x/ccv/provider/keeper/relay.go Outdated Show resolved Hide resolved
@shaspitz shaspitz requested a review from mpoke December 7, 2022 03:27
Copy link
Contributor

@mpoke mpoke left a comment

Choose a reason for hiding this comment

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

LGTM

@mpoke mpoke merged commit 7fa197e into main Dec 7, 2022
@mpoke mpoke deleted the relay-cleanup branch December 7, 2022 09:02
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.

Be more precise about what kinds of consumer initated slash requests should trigger an error and channel close
4 participants