From 0b1d429a47c2b3554a2e171e247b2cf85dddbf98 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Wed, 6 Sep 2023 11:52:01 -0700 Subject: [PATCH 01/17] merge main into throttle feat branch (#1267) * build(deps): bump actions/checkout from 3 to 4 (#1257) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps)!: bump github.com/cosmos/ibc-go/v7 from 7.2.0 to 7.3.0 (#1258) * build(deps): bump github.com/cosmos/ibc-go/v7 from 7.2.0 to 7.3.0 Bumps [github.com/cosmos/ibc-go/v7](https://github.com/cosmos/ibc-go) from 7.2.0 to 7.3.0. - [Release notes](https://github.com/cosmos/ibc-go/releases) - [Changelog](https://github.com/cosmos/ibc-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/ibc-go/compare/v7.2.0...v7.3.0) --- updated-dependencies: - dependency-name: github.com/cosmos/ibc-go/v7 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * add changelog entries --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mpoke * build(deps): bump github.com/cosmos/cosmos-sdk from 0.47.4 to 0.47.5 (#1259) * build(deps): bump github.com/cosmos/cosmos-sdk from 0.47.3 to 0.47.5 Bumps [github.com/cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) from 0.47.3 to 0.47.5. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/v0.47.3...v0.47.5) --- updated-dependencies: - dependency-name: github.com/cosmos/cosmos-sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * add changelog entries --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mpoke * chore: Separate semver (#1217) separate semver * docs: cleanup changelog (#1260) fix changelog * fix!: validate MsgTransfer before calling Transfer() (#1244) * validate MsgTransfer * add TestSendRewardsToProvider * update DefaultConsumerUnbondingPeriod to 14 days * update changelog * fix linter * fix test * apply review suggestions * update changelog * docs: Create adr-012-separate-releasing.md (#1229) * Create adr-011-separate-releasing.md * Update docs/docs/adrs/adr-011-separate-releasing.md Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * adr 12 not 11 * correct that we use postfix not prefix * explanation on example release flow --------- Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * fix: remove addr validation for provider fee pool addr param (#1262) * fix: remove validation for provider chain address since we cannot validate it properly on consumer * add changelog entry --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mpoke Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Co-authored-by: Dmitry Kolupaev --- .github/PULL_REQUEST_TEMPLATE/production.md | 1 + .github/workflows/automated-tests.yml | 6 +- .github/workflows/build.yml | 2 +- .github/workflows/codeql.yml | 2 +- .github/workflows/deploy-docs.yml | 2 +- .github/workflows/golangci-lint.yml | 2 +- .github/workflows/gosec.yml | 2 +- .github/workflows/linkchecker.yml | 2 +- .github/workflows/manual-e2e.yml | 12 +- .github/workflows/nightly-e2e.yml | 12 +- .github/workflows/proto-registry.yml | 2 +- .github/workflows/proto.yml | 2 +- CHANGELOG.md | 30 +++- CONTRIBUTING.md | 6 +- RELEASE_NOTES.md | 13 +- docs/docs/adrs/adr-012-separate-releasing.md | 76 ++++++++++ go.mod | 50 ++++--- go.sum | 119 ++++++++------- tests/integration/distribution.go | 147 ++++++++++++++++++- testutil/integration/debug_test.go | 4 + x/ccv/consumer/keeper/distribution.go | 116 ++++++++------- x/ccv/consumer/types/params_test.go | 4 - x/ccv/types/params.go | 8 +- 23 files changed, 443 insertions(+), 177 deletions(-) create mode 100644 docs/docs/adrs/adr-012-separate-releasing.md diff --git a/.github/PULL_REQUEST_TEMPLATE/production.md b/.github/PULL_REQUEST_TEMPLATE/production.md index 885d852cf0..7fe79eceb9 100644 --- a/.github/PULL_REQUEST_TEMPLATE/production.md +++ b/.github/PULL_REQUEST_TEMPLATE/production.md @@ -30,6 +30,7 @@ I have... * [ ] Updated the relevant documentation or specification * [ ] Reviewed "Files changed" and left comments if necessary * [ ] Confirmed all CI checks have passed +* [ ] If this PR is library API breaking, bump the go.mod version string of the repo, and follow through on a new major release for both the consumer and provider ### Reviewers Checklist diff --git a/.github/workflows/automated-tests.yml b/.github/workflows/automated-tests.yml index a9b594f53d..ad53314e76 100644 --- a/.github/workflows/automated-tests.yml +++ b/.github/workflows/automated-tests.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: lfs: true - name: Checkout LFS objects @@ -31,7 +31,7 @@ jobs: E2E_Tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: lfs: true - name: Checkout LFS objects @@ -45,7 +45,7 @@ jobs: Cometmock_Tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: lfs: true - name: Checkout LFS objects diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ec188dd429..a812b9fcf2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,7 @@ jobs: name: SonarCloud runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis lfs: true diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 09a848478a..c6fb56c2a6 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 0c7dff60c5..7fbd30cad7 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -22,7 +22,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout 🛎️ - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: persist-credentials: false fetch-depth: 0 diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 56166af86a..33a2f62c07 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: '1.20' - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: diff --git a/.github/workflows/gosec.yml b/.github/workflows/gosec.yml index ddcf2d3594..80dc4a3689 100644 --- a/.github/workflows/gosec.yml +++ b/.github/workflows/gosec.yml @@ -15,7 +15,7 @@ jobs: GO111MODULE: on steps: - name: Checkout Source - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run Gosec Security Scanner uses: securego/gosec@master with: diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml index 91242e5992..a1afa643cf 100644 --- a/.github/workflows/linkchecker.yml +++ b/.github/workflows/linkchecker.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-latest steps: # Check out the latest version of the code - - uses: actions/checkout@v3.5.2 + - uses: actions/checkout@v4 # Checks the status of hyperlinks in *.md files in docs/ - uses: gaurav-nelson/github-action-markdown-link-check@1.0.15 diff --git a/.github/workflows/manual-e2e.yml b/.github/workflows/manual-e2e.yml index 388a19f0f5..2bb74bb52d 100644 --- a/.github/workflows/manual-e2e.yml +++ b/.github/workflows/manual-e2e.yml @@ -12,7 +12,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: "1.20" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout LFS objects run: git lfs checkout - name: Setup Go @@ -28,7 +28,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: "1.20" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout LFS objects run: git lfs checkout - name: Setup Go @@ -44,7 +44,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: "1.20" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout LFS objects run: git lfs checkout - name: Setup Go @@ -60,7 +60,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: "1.20" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout LFS objects run: git lfs checkout - name: Setup Go @@ -76,7 +76,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: "1.20" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout LFS objects run: git lfs checkout - name: Setup Go @@ -92,7 +92,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: "1.20" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout LFS objects run: git lfs checkout - name: Setup Go diff --git a/.github/workflows/nightly-e2e.yml b/.github/workflows/nightly-e2e.yml index cd7f155e12..4ab03527fd 100644 --- a/.github/workflows/nightly-e2e.yml +++ b/.github/workflows/nightly-e2e.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: "1.20" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout LFS objects run: git lfs checkout - name: Setup Go @@ -41,7 +41,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: "1.20" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout LFS objects run: git lfs checkout - name: Setup Go @@ -57,7 +57,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: "1.20" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout LFS objects run: git lfs checkout - name: Setup Go @@ -73,7 +73,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: "1.20" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout LFS objects run: git lfs checkout - name: Setup Go @@ -89,7 +89,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: "1.20" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout LFS objects run: git lfs checkout - name: Setup Go @@ -105,7 +105,7 @@ jobs: - uses: actions/setup-go@v4 with: go-version: "1.20" - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Checkout LFS objects run: git lfs checkout - name: Setup Go diff --git a/.github/workflows/proto-registry.yml b/.github/workflows/proto-registry.yml index 5e4c7cb9ad..025c45b618 100644 --- a/.github/workflows/proto-registry.yml +++ b/.github/workflows/proto-registry.yml @@ -12,7 +12,7 @@ jobs: push: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: bufbuild/buf-setup-action@v1.26.1 - uses: bufbuild/buf-push-action@v1 with: diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml index 1b0846a842..ce525c5a8a 100644 --- a/.github/workflows/proto.yml +++ b/.github/workflows/proto.yml @@ -13,7 +13,7 @@ jobs: break-check: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: bufbuild/buf-setup-action@v1.26.1 - uses: bufbuild/buf-breaking-action@v1 with: diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c019b885c..792e83a7a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,16 +1,32 @@ # CHANGELOG -## [Unreleased] +## [Unreleased for Provider] -Add an entry to the unreleased section whenever merging a PR to main that is not targeted at a specific release. These entries will eventually be included in a release. +Add an entry to the unreleased provider section whenever merging a PR to main that is not targeted at a specific release. These entries will eventually be included in a provider release. +* (feature!) [#1244](https://github.com/cosmos/interchain-security/pull/1244) Update the default consumer unbonding period to 2 weeks. +* (deps) [#1259](https://github.com/cosmos/interchain-security/pull/1259) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.47.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.5). +* (deps!) [#1258](https://github.com/cosmos/interchain-security/pull/1258) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v7.3.0](https://github.com/cosmos/ibc-go/releases/tag/v7.3.0). +* (deps) [#1258](https://github.com/cosmos/interchain-security/pull/1258) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.47.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.4). * (deps!) [#1196](https://github.com/cosmos/interchain-security/pull/1196) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v7.2.0](https://github.com/cosmos/ibc-go/releases/tag/v7.2.0). * `[x/ccv/provider]` (fix) [#1076](https://github.com/cosmos/interchain-security/pull/1076) Add `InitTimeoutTimestamps` and `ExportedVscSendTimestamps` to exported genesis. -* (feat!) [#1024](https://github.com/cosmos/interchain-security/pull/1024) throttle with retries, consumer changes -* (fix!) revert consumer packet data changes from #1037 [#1150](https://github.com/cosmos/interchain-security/pull/1150) -* (fix!) proper deletion of pending packets [#1146](https://github.com/cosmos/interchain-security/pull/1146) -* (feat!) optimize pending packets storage on consumer, with migration! [#1037](https://github.com/cosmos/interchain-security/pull/1037) -* (feat) introduce the gRPC query `/interchain_security/ccv/consumer/provider-info` and CLI command `interchain-security-cd q ccvconsumer provider-info`to retrieve provider info from the consumer chain. + +## [Unreleased for Consumer] + +Add an entry to the unreleased consumer section whenever merging a PR to main that is not targeted at a specific release. These entries will eventually be included in a consumer release. + +* (feature!) [#1244](https://github.com/cosmos/interchain-security/pull/1244) Update the default consumer unbonding period to 2 weeks. +* (fix!) [#1244](https://github.com/cosmos/interchain-security/pull/1244) Validate token transfer messages before calling `Transfer()`. +* (deps) [#1259](https://github.com/cosmos/interchain-security/pull/1259) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.47.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.5). +* (deps!) [#1258](https://github.com/cosmos/interchain-security/pull/1258) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v7.3.0](https://github.com/cosmos/ibc-go/releases/tag/v7.3.0). +* (deps) [#1258](https://github.com/cosmos/interchain-security/pull/1258) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.47.4](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.4). +* (deps!) [#1196](https://github.com/cosmos/interchain-security/pull/1196) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v7.2.0](https://github.com/cosmos/ibc-go/releases/tag/v7.2.0). +* (feat!) [#1024](https://github.com/cosmos/interchain-security/pull/1024) Throttle with retries, consumer changes. +* (fix!) [#1150](https://github.com/cosmos/interchain-security/pull/1150) Revert consumer packet data changes from #1037. +* (fix!) [#1146](https://github.com/cosmos/interchain-security/pull/1146) Proper deletion of pending packets. +* (feat!) [#1037](https://github.com/cosmos/interchain-security/pull/1037) Optimize pending packets storage on consumer, with migration. +* (feat) [#1164](https://github.com/cosmos/interchain-security/pull/1164) Introduce the gRPC query `/interchain_security/ccv/consumer/provider-info` and CLI command `interchain-security-cd q ccvconsumer provider-info` to retrieve provider info from the consumer chain. +* (fix!) [#1262](https://github.com/cosmos/interchain-security/pull/1262) Remove incorrect address validation on `ProviderFeePoolAddrStr` param ## v3.1.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8975d37269..c376c3b824 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -247,9 +247,9 @@ ICS adheres to the [trunk based development branching model](https://trunkbasedd ICS follows [semantic versioning](https://semver.org), but with the following deviations (similar to [IBC-Go](https://github.com/cosmos/ibc-go/blob/main/RELEASES.md)): -- A library API breaking change will result in an increase of the MAJOR version number (X.y.z | x > 0). -- A state breaking change (change requiring coordinated upgrade and/or state migration for the consumer, the provider, or both) will result in an increase of the MINOR version number (x.Y.z | x > 0). -- Any other changes (including node API breaking changes) will result in an increase of the PATCH version number (x.y.Z | x > 0). +- A library API breaking change to EITHER the provider or consumer module will result in an increase of the MAJOR version number for BOTH modules (X.y.z-provider AND X.y.z-consumer). +- A state breaking change (change requiring coordinated upgrade and/or state migration) will result in an increase of the MINOR version number for the AFFECTED module(s) (x.Y.z-provider AND/OR x.Y.z-consumer). +- Any other changes (including node API breaking changes) will result in an increase of the PATCH version number for the AFFECTED module(s) (x.y.Z-provider AND/OR x.y.Z-consumer). ### Backwards Compatibility diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 62704ea9c6..f1a6edb066 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,12 +1,15 @@ -# Replicated Security Release Notes +# Replicated Security - Release Notes + + +## Note this release is ONLY relevant to ## 📝 Changelog diff --git a/docs/docs/adrs/adr-012-separate-releasing.md b/docs/docs/adrs/adr-012-separate-releasing.md new file mode 100644 index 0000000000..386c8add29 --- /dev/null +++ b/docs/docs/adrs/adr-012-separate-releasing.md @@ -0,0 +1,76 @@ +--- +sidebar_position: 13 +title: Separate Releasing +--- +# ADR 012: Separate Releasing + +## Changelog + +* {8/18/22}: Initial draft of idea in [#801](https://github.com/cosmos/interchain-security/issues/801) +* {8/22/22}: Put idea in this ADR + +## Status + +Accepted + +## Context + +### Spike results + +I explored the idea of [#801](https://github.com/cosmos/interchain-security/issues/801) with this [spike branch](https://github.com/cosmos/interchain-security/tree/shawn%2Fgo-mod-split-aug-spike). Here's my conclusions: + +Splitting this repo to have multiple go.mods is possible. However there are various intricacies involved in decoupling the package hierarchy to have `x/ccv/types` as the lowest level dep, with `x/ccv/consumer` and `x/ccv/provider` being one dep layer above, with high-level tests depending on all three of the mentioned packages. I'd estimate this decoupling would take 2-5 workdays to finish, and require significant review effort. + +### Why go.mod split is not the way to go + +Let's take a step back and remember the issue we're trying to solve - **We need a clean way to decouple semver/releasing for the consumer and provider modules**. After more consideration, splitting up go.mods gives us little benefit in achieving this. Reasons: + +* The `go.mod` dependency system is tied to git tags for the entire repo (ex: `require github.com/cometbft/cometbft v0.37.2` refers to a historical tag for the entire cometbft repo). +* It'd be an odd dev experience to allow modules to reference past releases of other modules in the same repo. When would we ever want the consumer module to reference a past release of the types module for example? +* If we allow for `go.mod` replace statements to build from local source code, why split up the package deps at all? +* Splitting go.mods adds a bunch of complexity with `go.work` files and all that shiz. VSCode does not play well with multiple module repos either. + +### Why separate repos is cool but also not the way to go + +All this considered, the cleanest solution to decoupling semver/releasing for the consumer and provider modules would be to have multiple repos, each with their own go.mod (3-4 repos total including high level tests). With this scheme we could separately tag each repo as changes are merged, they could share some code from `types` being an external dep, etc. + +I don't think any of us want to split up the monorepo, that's a lot of work and seems like bikeshedding. There's another solution that's very simple.. + +## Decision + +Slightly adapting [the current semver ruleset](https://github.com/cosmos/interchain-security/blob/cca008d856e3ffc60ec1a486871d0faa702abe26/CONTRIBUTING.md#semantic-versioning): + +* A library API breaking change to EITHER the provider or consumer module will result in an increase of the MAJOR version number for BOTH modules (X.y.z-provider AND X.y.z-consumer). +* A state breaking change (change requiring coordinated upgrade and/or state migration) will result in an increase of the MINOR version number for the AFFECTED module(s) (x.Y.z-provider AND/OR x.Y.z-consumer). +* Any other changes (including node API breaking changes) will result in an increase of the PATCH version number for the AFFECTED module(s) (x.y.Z-provider AND/OR x.y.Z-consumer). + +### Example release flow + +We upgrade `main` to use a new version of SDK. This is a major version bump, triggering a new release for both the provider and consumer modules, `v5.0.0-provider` and `v5.0.0-consumer`. + +* A state breaking change is merged to `main` for the provider module. We release only a `v5.1.0-provider` off main. +* Another state breaking change is merged to `main` for the provider module. We release only a `v5.2.0-provider` off main. +* At this point, the latest consumer version is still `v5.0.0-consumer`. We now merge a state breaking change for the consumer module to `main`, and consequently release `v5.1.0-consumer`. Note that `v5.1.0-consumer` is tagged off a LATER commit from main than `v5.2.0-provider`. This is fine, as the consumer module should not be affected by the provider module's state breaking changes. +* Once either module sees a library API breaking change, we bump the major version for both modules. For example, we merge a library API breaking change to `main` for the provider module. We release `v6.0.0-provider` and `v6.0.0-consumer` off main. Note that most often, a library API breaking change will affect both modules simultaneously (example being bumping sdk version). + +## Consequences + +### Positive + +* Consumer repos have clear communication of what tagged versions are relevant to them. Consumer devs should know to never reference an ICS version that starts with `provider`, even if it'd technically build. +* Consumer and provider modules do not deviate as long as we continually release off a shared main branch. Backporting remains relatively unchanged besides being explicit about what module(s) your changes should affect. +* No code changes, just changes in process. Very simple. + +### Negative + +* Slightly more complexity. +* This solution does not allow having provider and consumer on separate versions of e.g. the Cosmos SDK + +### Neutral + +## References + +> Are there any relevant PR comments, issues that led up to this, or articles referenced for why we made the given design choice? If so link them here! + +* [#801](https://github.com/cosmos/interchain-security/issues/801) +* [#801 comment](https://github.com/cosmos/interchain-security/issues/801#issuecomment-1683349298) diff --git a/go.mod b/go.mod index b7d1eb9afe..6cc988a794 100644 --- a/go.mod +++ b/go.mod @@ -7,9 +7,9 @@ require ( cosmossdk.io/math v1.1.2 github.com/cometbft/cometbft v0.37.2 github.com/cometbft/cometbft-db v0.8.0 - github.com/cosmos/cosmos-sdk v0.47.3 + github.com/cosmos/cosmos-sdk v0.47.5 github.com/cosmos/gogoproto v1.4.10 - github.com/cosmos/ibc-go/v7 v7.2.0 + github.com/cosmos/ibc-go/v7 v7.3.0 github.com/cosmos/ics23/go v0.10.0 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.3 @@ -23,24 +23,24 @@ require ( github.com/stretchr/testify v1.8.4 github.com/tidwall/gjson v1.16.0 golang.org/x/crypto v0.11.0 // indirect - golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc + golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb golang.org/x/net v0.12.0 // indirect - golang.org/x/sys v0.10.0 // indirect - google.golang.org/genproto v0.0.0-20230629202037-9506855d4529 // indirect + golang.org/x/sys v0.11.0 // indirect + google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect google.golang.org/grpc v1.57.0 google.golang.org/protobuf v1.31.0 gopkg.in/yaml.v2 v2.4.0 ) require ( - cloud.google.com/go v0.110.0 // indirect - cloud.google.com/go/compute v1.19.1 // indirect + cloud.google.com/go v0.110.4 // indirect + cloud.google.com/go/compute v1.20.1 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect - cloud.google.com/go/iam v0.13.0 // indirect - cloud.google.com/go/storage v1.29.0 // indirect + cloud.google.com/go/iam v1.1.0 // indirect + cloud.google.com/go/storage v1.30.1 // indirect cosmossdk.io/api v0.3.1 cosmossdk.io/core v0.5.1 // indirect - cosmossdk.io/depinject v1.0.0-alpha.3 // indirect + cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/tools/rosetta v0.2.1 filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect @@ -92,7 +92,7 @@ require ( github.com/google/orderedcode v0.0.1 // indirect github.com/google/uuid v1.3.0 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect - github.com/googleapis/gax-go/v2 v2.8.0 // indirect + github.com/googleapis/gax-go/v2 v2.11.0 // indirect github.com/gorilla/handlers v1.5.1 // indirect github.com/gorilla/websocket v1.5.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect @@ -119,7 +119,7 @@ require ( github.com/linxGnu/grocksdb v1.7.16 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect - github.com/mattn/go-isatty v0.0.18 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect github.com/minio/highwayhash v1.0.2 // indirect @@ -152,11 +152,11 @@ require ( github.com/zondax/ledger-go v0.14.1 // indirect go.etcd.io/bbolt v1.3.7 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/oauth2 v0.7.0 // indirect + golang.org/x/oauth2 v0.8.0 // indirect golang.org/x/term v0.10.0 // indirect - golang.org/x/text v0.11.0 // indirect + golang.org/x/text v0.12.0 // indirect golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect - google.golang.org/api v0.122.0 // indirect + google.golang.org/api v0.126.0 // indirect google.golang.org/appengine v1.6.7 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect @@ -167,17 +167,23 @@ require ( require ( github.com/spf13/viper v1.16.0 - google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e + google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 ) require ( - cosmossdk.io/log v1.1.0 // indirect - github.com/go-playground/locales v0.14.0 // indirect - github.com/google/s2a-go v0.1.3 // indirect + cosmossdk.io/log v1.2.1 // indirect + github.com/cockroachdb/errors v1.10.0 // indirect + github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect + github.com/cockroachdb/redact v1.1.5 // indirect + github.com/getsentry/sentry-go v0.23.0 // indirect + github.com/google/s2a-go v0.1.4 // indirect + github.com/kr/pretty v0.3.1 // indirect + github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/rs/zerolog v1.29.1 // indirect - golang.org/x/sync v0.1.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // indirect + github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rs/zerolog v1.30.0 // indirect + golang.org/x/sync v0.2.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect ) // following versions might cause unexpected behavior diff --git a/go.sum b/go.sum index a008e343c5..03e76f9812 100644 --- a/go.sum +++ b/go.sum @@ -34,8 +34,8 @@ cloud.google.com/go v0.100.2/go.mod h1:4Xra9TjzAeYHrl5+oeLlzbM2k3mjVhZh4UqTZ//w9 cloud.google.com/go v0.102.0/go.mod h1:oWcCzKlqJ5zgHQt9YsaeTY9KzIvjyy0ArmiBUgpQ+nc= cloud.google.com/go v0.102.1/go.mod h1:XZ77E9qnTEnrgEOvr4xzfdX5TRo7fB4T2F4O6+34hIU= cloud.google.com/go v0.104.0/go.mod h1:OO6xxXdJyvuJPcEPBLN9BJPD+jep5G1+2U5B5gkRYtA= -cloud.google.com/go v0.110.0 h1:Zc8gqp3+a9/Eyph2KDmcGaPtbKRIoqq4YTlL4NMD0Ys= -cloud.google.com/go v0.110.0/go.mod h1:SJnCLqQ0FCFGSZMUNUf84MV3Aia54kn7pi8st7tMzaY= +cloud.google.com/go v0.110.4 h1:1JYyxKMN9hd5dR2MYTPWkGUgcoxVVhg0LKNKEo0qvmk= +cloud.google.com/go v0.110.4/go.mod h1:+EYjdK8e5RME/VY/qLCAtuyALQ9q67dvuum8i+H5xsI= cloud.google.com/go/aiplatform v1.22.0/go.mod h1:ig5Nct50bZlzV6NvKaTwmplLLddFx0YReh9WfTO5jKw= cloud.google.com/go/aiplatform v1.24.0/go.mod h1:67UUvRBKG6GTayHKV8DBv2RtR1t93YRu5B1P3x99mYY= cloud.google.com/go/analytics v0.11.0/go.mod h1:DjEWCu41bVbYcKyvlws9Er60YE4a//bK6mnhWvQeFNI= @@ -73,8 +73,8 @@ cloud.google.com/go/compute v1.6.0/go.mod h1:T29tfhtVbq1wvAPo0E3+7vhgmkOYeXjhFvz cloud.google.com/go/compute v1.6.1/go.mod h1:g85FgpzFvNULZ+S8AYq87axRKuf2Kh7deLqV/jJ3thU= cloud.google.com/go/compute v1.7.0/go.mod h1:435lt8av5oL9P3fv1OEzSbSUe+ybHXGMPQHHZWZxy9U= cloud.google.com/go/compute v1.10.0/go.mod h1:ER5CLbMxl90o2jtNbGSbtfOpQKR0t15FOtRsugnLrlU= -cloud.google.com/go/compute v1.19.1 h1:am86mquDUgjGNWxiGn+5PGLbmgiWXlE/yNWpIpNvuXY= -cloud.google.com/go/compute v1.19.1/go.mod h1:6ylj3a05WF8leseCdIf77NK0g1ey+nj5IKd5/kvShxE= +cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg= +cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM= cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY= cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA= cloud.google.com/go/containeranalysis v0.5.1/go.mod h1:1D92jd8gRR/c0fGMlymRgxWD3Qw9C1ff6/T7mLgVL8I= @@ -114,13 +114,12 @@ cloud.google.com/go/gkehub v0.10.0/go.mod h1:UIPwxI0DsrpsVoWpLB0stwKCP+WFVG9+y97 cloud.google.com/go/grafeas v0.2.0/go.mod h1:KhxgtF2hb0P191HlY5besjYm6MqTSTj3LSI+M+ByZHc= cloud.google.com/go/iam v0.3.0/go.mod h1:XzJPvDayI+9zsASAFO68Hk07u3z+f+JrT2xXNdp4bnY= cloud.google.com/go/iam v0.5.0/go.mod h1:wPU9Vt0P4UmCux7mqtRu6jcpPAb74cP1fh50J3QpkUc= -cloud.google.com/go/iam v0.13.0 h1:+CmB+K0J/33d0zSQ9SlFWUeCCEn5XJA0ZMZ3pHE9u8k= -cloud.google.com/go/iam v0.13.0/go.mod h1:ljOg+rcNfzZ5d6f1nAUJ8ZIxOaZUVoS14bKCtaLZ/D0= +cloud.google.com/go/iam v1.1.0 h1:67gSqaPukx7O8WLLHMa0PNs3EBGd2eE4d+psbO/CO94= +cloud.google.com/go/iam v1.1.0/go.mod h1:nxdHjaKfCr7fNYx/HJMM8LgiMugmveWlkatear5gVyk= cloud.google.com/go/language v1.4.0/go.mod h1:F9dRpNFQmJbkaop6g0JhSBXCNlO90e1KWx5iDdxbWic= cloud.google.com/go/language v1.6.0/go.mod h1:6dJ8t3B+lUYfStgls25GusK04NLh3eDLQnWM3mdEbhI= cloud.google.com/go/lifesciences v0.5.0/go.mod h1:3oIKy8ycWGPUyZDR/8RNnTOYevhaMLqh5vLUXs9zvT8= cloud.google.com/go/lifesciences v0.6.0/go.mod h1:ddj6tSX/7BOnhxCSd3ZcETvtNr8NZ6t/iPhY2Tyfu08= -cloud.google.com/go/longrunning v0.4.1 h1:v+yFJOfKC3yZdY6ZUI933pIYdhyhV8S3NpWrXWmg7jM= cloud.google.com/go/mediatranslation v0.5.0/go.mod h1:jGPUhGTybqsPQn91pNXw0xVHfuJ3leR1wj37oU3y1f4= cloud.google.com/go/mediatranslation v0.6.0/go.mod h1:hHdBCTYNigsBxshbznuIMFNe5QXEowAuNmmC7h8pu5w= cloud.google.com/go/memcache v1.4.0/go.mod h1:rTOfiGZtJX1AaFUrOgsMHX5kAzaTQ8azHiuDoTPzNsE= @@ -178,8 +177,8 @@ cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3f cloud.google.com/go/storage v1.22.1/go.mod h1:S8N1cAStu7BOeFfE8KAQzmyyLkK8p/vmRq6kuBTW58Y= cloud.google.com/go/storage v1.23.0/go.mod h1:vOEEDNFnciUMhBeT6hsJIn3ieU5cFRmzeLgDvXzfIXc= cloud.google.com/go/storage v1.27.0/go.mod h1:x9DOL8TK/ygDUMieqwfhdpQryTeEkhGKMi80i/iqR2s= -cloud.google.com/go/storage v1.29.0 h1:6weCgzRvMg7lzuUurI4697AqIRPU1SvzHhynwpW31jI= -cloud.google.com/go/storage v1.29.0/go.mod h1:4puEjyTKnku6gfKoTfNOU/W+a9JyuVNxjpS5GBrB8h4= +cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/oNM= +cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= cloud.google.com/go/talent v1.1.0/go.mod h1:Vl4pt9jiHKvOgF9KoZo6Kob9oV4lwd/ZD5Cto54zDRw= cloud.google.com/go/talent v1.2.0/go.mod h1:MoNF9bhFQbiJ6eFD3uSsg0uBALw4n4gaCaEjBw9zo8g= cloud.google.com/go/videointelligence v1.6.0/go.mod h1:w0DIDlVRKtwPCn/C4iwZIJdvC69yInhW0cfi+p546uU= @@ -196,12 +195,12 @@ cosmossdk.io/api v0.3.1 h1:NNiOclKRR0AOlO4KIqeaG6PS6kswOMhHD0ir0SscNXE= cosmossdk.io/api v0.3.1/go.mod h1:DfHfMkiNA2Uhy8fj0JJlOCYOBp4eWUUJ1te5zBGNyIw= cosmossdk.io/core v0.5.1 h1:vQVtFrIYOQJDV3f7rw4pjjVqc1id4+mE0L9hHP66pyI= cosmossdk.io/core v0.5.1/go.mod h1:KZtwHCLjcFuo0nmDc24Xy6CRNEL9Vl/MeimQ2aC7NLE= -cosmossdk.io/depinject v1.0.0-alpha.3 h1:6evFIgj//Y3w09bqOUOzEpFj5tsxBqdc5CfkO7z+zfw= -cosmossdk.io/depinject v1.0.0-alpha.3/go.mod h1:eRbcdQ7MRpIPEM5YUJh8k97nxHpYbc3sMUnEtt8HPWU= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= -cosmossdk.io/log v1.1.0 h1:v0ogPHYeTzPcBTcPR1A3j1hkei4pZama8kz8LKlCMv0= -cosmossdk.io/log v1.1.0/go.mod h1:6zjroETlcDs+mm62gd8Ig7mZ+N+fVOZS91V17H+M4N4= +cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk= +cosmossdk.io/log v1.2.1/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4= cosmossdk.io/math v1.1.2 h1:ORZetZCTyWkI5GlZ6CZS28fMHi83ZYf+A2vVnHNzZBM= cosmossdk.io/math v1.1.2/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= cosmossdk.io/tools/rosetta v0.2.1 h1:ddOMatOH+pbxWbrGJKRAawdBkPYLfKXutK9IETnjYxw= @@ -243,7 +242,6 @@ github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia65gfNATL8TAiHDNxPzPdmEL5uirI2Uyuz6c= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/alecthomas/participle/v2 v2.0.0-alpha7 h1:cK4vjj0VSgb3lN1nuKA5F7dw+1s1pWBe5bx7nNCnN+c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -354,8 +352,13 @@ github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= -github.com/cockroachdb/apd/v3 v3.1.0 h1:MK3Ow7LH0W8zkd5GMKA1PvS9qG3bWFI95WaVNfyZJ/w= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= +github.com/cockroachdb/errors v1.10.0 h1:lfxS8zZz1+OjtV4MtNWgboi/W5tyLEB6VQZBXN+0VUU= +github.com/cockroachdb/errors v1.10.0/go.mod h1:lknhIsEVQ9Ss/qKDBQS/UqFSvPQjOwNq2qyKAxtHRqE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= +github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= +github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= +github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= @@ -381,8 +384,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-proto v1.0.0-beta.2 h1:X3OKvWgK9Gsejo0F1qs5l8Qn6xJV/AzgIWR2wZ8Nua8= github.com/cosmos/cosmos-proto v1.0.0-beta.2/go.mod h1:+XRCLJ14pr5HFEHIUcn51IKXD1Fy3rkEQqt4WqmN4V0= -github.com/cosmos/cosmos-sdk v0.47.3 h1:r0hGmZoAzP2D+MaPaFGHwAaTdFQq3pNpHaUp1BsffbM= -github.com/cosmos/cosmos-sdk v0.47.3/go.mod h1:c4OfLdAykA9zsj1CqrxBRqXzVz48I++JSvIMPSPcEmk= +github.com/cosmos/cosmos-sdk v0.47.5 h1:n1+WjP/VM/gAEOx3TqU2/Ny734rj/MX1kpUnn7zVJP8= +github.com/cosmos/cosmos-sdk v0.47.5/go.mod h1:EHwCeN9IXonsjKcjpS12MqeStdZvIdxt3VYXhus3G3c= github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= @@ -393,8 +396,8 @@ github.com/cosmos/gogoproto v1.4.10 h1:QH/yT8X+c0F4ZDacDv3z+xE3WU1P1Z3wQoLMBRJoK github.com/cosmos/gogoproto v1.4.10/go.mod h1:3aAZzeRWpAwr+SS/LLkICX2/kDFyaYVzckBDzygIxek= github.com/cosmos/iavl v0.20.0 h1:fTVznVlepH0KK8NyKq8w+U7c2L6jofa27aFX6YGlm38= github.com/cosmos/iavl v0.20.0/go.mod h1:WO7FyvaZJoH65+HFOsDir7xU9FWk2w9cHXNW1XHcl7A= -github.com/cosmos/ibc-go/v7 v7.2.0 h1:dx0DLUl7rxdyZ8NiT6UsrbzKOJx/w7s+BOaewFRH6cg= -github.com/cosmos/ibc-go/v7 v7.2.0/go.mod h1:OOcjKIRku/j1Xs1RgKK0yvKRrJ5iFuZYMetR1n3yMlc= +github.com/cosmos/ibc-go/v7 v7.3.0 h1:QtGeVMi/3JeLWuvEuC60sBHpAF40Oenx/y+bP8+wRRw= +github.com/cosmos/ibc-go/v7 v7.3.0/go.mod h1:mUmaHFXpXrEdcxfdXyau+utZf14pGKVUiXwYftRZZfQ= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.12.2 h1:/XYaBlE2BJxtvpkHiBm97gFGSGmYGKunKyF3nNqAXZA= @@ -408,8 +411,6 @@ github.com/creachadair/taskgroup v0.4.2 h1:jsBLdAJE42asreGss2xZGZ8fJra7WtwnHWeJF github.com/creachadair/taskgroup v0.4.2/go.mod h1:qiXUOSrbwAY3u0JPGTzObbE3yf9hcXHDKBZ2ZjpCbgM= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= -github.com/cucumber/common/messages/go/v17 v17.1.1 h1:RNqopvIFyLWnKv0LfATh34SWBhXeoFTJnSrgm9cT/Ts= github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4= github.com/danieljoos/wincred v1.1.2 h1:QLdCxFs1/Yl4zduvBdcHB8goaYk9RARS2SgLLRuAyr0= github.com/danieljoos/wincred v1.1.2/go.mod h1:GijpziifJoIBfYh+S7BbkdUTU4LfM+QnGqR5Vl2tAx0= @@ -490,14 +491,17 @@ github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbS github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= github.com/getkin/kin-openapi v0.53.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= github.com/getkin/kin-openapi v0.61.0/go.mod h1:7Yn5whZr5kJi6t+kShccXS8ae1APpYTW6yheSwk8Yi4= +github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= +github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= -github.com/gin-gonic/gin v1.6.3 h1:ahKqKTFpO5KTPHxWZjEdPScmYaGtLo8Y4DMHoEsnp14= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.8.1 h1:4+fr/el88TOO3ewCmQr8cx/CtZ/umlIRIs5M4NTNjf8= github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE= github.com/glycerine/goconvey v0.0.0-20190410193231-58a59202ab31/go.mod h1:Ogl1Tioa0aV7gstGFO7KhffUsb9M4ydbEbbxpcEDc24= github.com/go-chi/chi/v5 v5.0.0/go.mod h1:BBug9lr0cqtdAhsu6R4AAdvufI0/XBzAQSsUqJpoZOs= +github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -519,11 +523,10 @@ github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= -github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= -github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.11.1 h1:prmOlTVv+YjZjmRmNSF3VmspqJIxJWXmqUsHwfTRRkQ= github.com/go-sourcemap/sourcemap v2.1.3+incompatible/go.mod h1:F8jJfvm2KbVjc5NqelyYJmf/v5J0dwNLS2mL4sNA1Jg= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= @@ -534,11 +537,11 @@ github.com/gobwas/pool v0.2.0 h1:QEmUOlnSjWtnpRGHF3SauEiOsy82Cup83Vf2LcMlnc8= github.com/gobwas/pool v0.2.0/go.mod h1:q8bcK0KcYlCgd9e7WYLm9LpyS+YeLd8JVDW6WezmKEw= github.com/gobwas/ws v1.0.2 h1:CoAavW/wd/kulfZmSIBt6p24n4j7tHgNVCjsfHVNUbo= github.com/gobwas/ws v1.0.2/go.mod h1:szmBTxLgaFppYjEmNtny/v3w89xOydFnnZMcgRRu/EM= +github.com/goccy/go-json v0.9.11 h1:/pAaQDLHEoCq/5FFmSKBswWmK6H0e8g4159Kc/X/nqk= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 h1:ZpnhV/YsD2/4cESfV5+Hoeu/iUR3ruzNvZ+yQfO03a0= github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2/go.mod h1:bBOAhwG1umN6/6ZUMtDFBMQR8jRg9O75tm9K00oMsK4= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofrs/uuid v3.3.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.3.0+incompatible h1:CaSVZxm5B+7o45rtab4jC2G37WGYX1zQfuU2i6DSvnc= github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFGgqEef3s= github.com/gogo/googleapis v1.4.1-0.20201022092350-68b0159b7869/go.mod h1:5YRNX2z1oM5gXdAkurHa942MDgEJyk02w4OecKY87+c= github.com/gogo/googleapis v1.4.1 h1:1Yx4Myt7BxzvUr5ldGSbwYiZG6t9wGBZ+8/fX3Wvtq0= @@ -645,8 +648,8 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= -github.com/google/s2a-go v0.1.3 h1:FAgZmpLl/SXurPEZyCMPBIiiYeTbqfjlbdnCNTAkbGE= -github.com/google/s2a-go v0.1.3/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= +github.com/google/s2a-go v0.1.4 h1:1kZ/sQM3srePvKs3tXAvQzo66XfcReoqFpIpIccE7Oc= +github.com/google/s2a-go v0.1.4/go.mod h1:Ej+mSEMGRnqRzjc7VtF+jdBwYG5fuJfiZ8ELkjEwM0A= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -667,8 +670,8 @@ github.com/googleapis/gax-go/v2 v2.3.0/go.mod h1:b8LNqSzNabLiUpXKkY7HAR5jr6bIT99 github.com/googleapis/gax-go/v2 v2.4.0/go.mod h1:XOTVJ59hdnfJLIP/dh8n5CGryZR2LxK9wbMD5+iXC6c= github.com/googleapis/gax-go/v2 v2.5.1/go.mod h1:h6B0KMMFNtI2ddbGJn3T3ZbwkeT6yqEF02fYlzkUCyo= github.com/googleapis/gax-go/v2 v2.6.0/go.mod h1:1mjbznJAPHFpesgE5ucqfYEscaz5kMdcIDwU/6+DDoY= -github.com/googleapis/gax-go/v2 v2.8.0 h1:UBtEZqx1bjXtOQ5BVTkuYghXrr3N4V123VKJK67vJZc= -github.com/googleapis/gax-go/v2 v2.8.0/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= +github.com/googleapis/gax-go/v2 v2.11.0 h1:9V9PWXEsWnPpQhu/PeQIkS4eGzMlTLGgt80cUUI8Ki4= +github.com/googleapis/gax-go/v2 v2.11.0/go.mod h1:DxmR61SGKkGLa2xigwuZIQpkCI2S5iydzRfb3peWZJI= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g= github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= @@ -822,6 +825,7 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -867,8 +871,8 @@ github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2y github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.18 h1:DOKFKCQ7FNG2L1rbrmstDN4QVRdS89Nkh85u68Uwp98= -github.com/mattn/go-isatty v0.0.18/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.2/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.3/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= @@ -976,6 +980,8 @@ github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08/go.mod h1:pxMtw7c github.com/philhofer/fwd v1.0.0/go.mod h1:gk3iGcWd9+svBvR0sR+KPcfE+RNWozjowpeBVG3ZVNU= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -1026,19 +1032,20 @@ github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Ung github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= -github.com/regen-network/gocuke v0.6.2 h1:pHviZ0kKAq2U2hN2q3smKNxct6hS0mGByFMHGnWA97M= github.com/retailnext/hllpp v1.0.1-0.20180308014038-101a6d2f8b52/go.mod h1:RDpi1RftBQPUCDRw6SmxeaREsAaRKnOclghuzp/WRzc= github.com/rjeczalik/notify v0.9.1/go.mod h1:rKwnCoCGeuQnwBtTSPL9Dad03Vh2n40ePRrjvIXnJho= github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= -github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8= +github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= +github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= +github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= -github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= -github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc= -github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU= +github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= +github.com/rs/zerolog v1.30.0 h1:SymVODrcRsaRaSInD9yQtKbtWqwsfoPcRff/oRXLj4c= +github.com/rs/zerolog v1.30.0/go.mod h1:/tk+P47gFdPXq4QYjvCmT5/Gsug2nagsFWBWhAiSi1w= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -1227,8 +1234,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc h1:mCRnTeVUjcrhlRmO0VK8a6k6Rrf6TF9htwo2pJVSjIU= -golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc/go.mod h1:V1LtkGg67GoY2N1AnLN78QLrzxkLyJw7RJb1gzOOz9w= +golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb h1:xIApU0ow1zwMa2uL1VDNeQlNVFTWMQxZUZCMDy0Q4Us= +golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1256,7 +1263,7 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.8.0 h1:LUYupSeNrTNCGzR/hVBk2NHZO4hXcVaW1k4Qx7rjPx8= +golang.org/x/mod v0.11.0 h1:bUO06HqtnRcc/7l71XBe4WcqTZ+3AH1J59zWDDwLKgU= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1350,8 +1357,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.7.0 h1:qe6s0zUXlPX80/dITx3440hWZ7GwMwgDDyrSGTPJG/g= -golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= +golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8= +golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1366,8 +1373,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o= -golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.2.0 h1:PUR+T4wwASmuSTYdKjYHI5TD22Wy5ogLU5qZCOLxBrI= +golang.org/x/sync v0.2.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1476,8 +1483,8 @@ golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= -golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= @@ -1495,8 +1502,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4= -golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= +golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -1633,8 +1640,8 @@ google.golang.org/api v0.96.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ google.golang.org/api v0.97.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.98.0/go.mod h1:w7wJQLTM+wvQpNf5JyEcBoxK0RH7EDrh/L4qfsuJ13s= google.golang.org/api v0.100.0/go.mod h1:ZE3Z2+ZOr87Rx7dqFsdRQkRBk36kDtp/h+QpHbB7a70= -google.golang.org/api v0.122.0 h1:zDobeejm3E7pEG1mNHvdxvjs5XJoCMzyNH+CmwL94Es= -google.golang.org/api v0.122.0/go.mod h1:gcitW0lvnyWjSp9nKxAbdHKIZ6vF4aajGueeslZOyms= +google.golang.org/api v0.126.0 h1:q4GJq+cAdMAC7XP7njvQ4tvohGLiSlytuL4BQxbIZ+o= +google.golang.org/api v0.126.0/go.mod h1:mBwVAtz+87bEN6CbA1GtZPDOqY2R5ONPqJeIlvyo4Aw= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.2.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1754,12 +1761,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20230629202037-9506855d4529 h1:9JucMWR7sPvCxUFd6UsOUNmA5kCcWOfORaT3tpAsKQs= -google.golang.org/genproto v0.0.0-20230629202037-9506855d4529/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64= -google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e h1:AZX1ra8YbFMSb7+1pI8S9v4rrgRR7jU1FmuFSSjTVcQ= -google.golang.org/genproto/googleapis/api v0.0.0-20230526203410-71b5a4ffd15e/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 h1:2FZP5XuJY9zQyGM5N0rtovnoXjiMUEIUMvw0m9wlpLc= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:8mL13HKkDa+IuJ8yruA3ci0q+0vsUz4m//+ottjwS5o= +google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 h1:Au6te5hbKUV8pIYWHqOUZ1pva5qK/rwbIhoXEUB9Lu8= +google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130/go.mod h1:O9kGHb51iE/nOGvQaDUuadVYqovW56s5emA88lQnj6Y= +google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 h1:s5YSX+ZH5b5vS9rnpGymvIyMpLRJizowqDlOuyjXnTk= +google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 h1:bVf09lpb+OJbByTj913DRJioFFAjf/ZGxEz7MajTp2U= +google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98/go.mod h1:TUfxEVdsvPg18p6AslUXFoLdpED4oBnGwyqk3dV1XzM= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1858,7 +1865,7 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible/go.mod h1:DsYFclhRJ6vuDpmuTbkuFWG+y2sxOXAzmJt81HFBacw= -gotest.tools/v3 v3.4.0 h1:ZazjZUfuVeZGLAmlKKuyv3IKP5orXcwtOwDQH6YVr6o= +gotest.tools/v3 v3.5.0 h1:Ljk6PdHdOhAb5aDMWXjDLMMhph+BpztA4v1QdqEW2eY= honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/tests/integration/distribution.go b/tests/integration/distribution.go index 5d5c50220a..65b82eecd6 100644 --- a/tests/integration/distribution.go +++ b/tests/integration/distribution.go @@ -9,6 +9,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + icstestingutils "github.com/cosmos/interchain-security/v3/testutil/integration" + consumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" @@ -338,8 +340,151 @@ func (s *CCVTestSuite) TestEndBlockRD() { } } +// TestSendRewardsToProvider is effectively a unit test for SendRewardsToProvider(), +// but is written as an integration test to avoid excessive mocking. +func (s *CCVTestSuite) TestSendRewardsToProvider() { + testCases := []struct { + name string + setup func(sdk.Context, *consumerkeeper.Keeper, icstestingutils.TestBankKeeper) + expError bool + tokenTransfers int + }{ + { + name: "successful token transfer", + setup: func(ctx sdk.Context, keeper *consumerkeeper.Keeper, bankKeeper icstestingutils.TestBankKeeper) { + s.SetupTransferChannel() + + // register a consumer reward denom + params := keeper.GetConsumerParams(ctx) + params.RewardDenoms = []string{sdk.DefaultBondDenom} + keeper.SetParams(ctx, params) + + // send coins to the pool which is used for collect reward distributions to be sent to the provider + err := bankKeeper.SendCoinsFromAccountToModule( + ctx, + s.consumerChain.SenderAccount.GetAddress(), + consumertypes.ConsumerToSendToProviderName, + sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))), + ) + s.Require().NoError(err) + }, + expError: false, + tokenTransfers: 1, + }, + { + name: "no transfer channel", + setup: func(ctx sdk.Context, keeper *consumerkeeper.Keeper, bankKeeper icstestingutils.TestBankKeeper) { + }, + expError: false, + tokenTransfers: 0, + }, + { + name: "no reward denom", + setup: func(ctx sdk.Context, keeper *consumerkeeper.Keeper, bankKeeper icstestingutils.TestBankKeeper) { + s.SetupTransferChannel() + }, + expError: false, + tokenTransfers: 0, + }, + { + name: "reward balance is zero", + setup: func(ctx sdk.Context, keeper *consumerkeeper.Keeper, bankKeeper icstestingutils.TestBankKeeper) { + s.SetupTransferChannel() + + // register a consumer reward denom + params := keeper.GetConsumerParams(ctx) + params.RewardDenoms = []string{"uatom"} + keeper.SetParams(ctx, params) + + denoms := keeper.AllowedRewardDenoms(ctx) + s.Require().Len(denoms, 1) + }, + expError: false, + tokenTransfers: 0, + }, + { + name: "no distribution transmission channel", + setup: func(ctx sdk.Context, keeper *consumerkeeper.Keeper, bankKeeper icstestingutils.TestBankKeeper) { + s.SetupTransferChannel() + + // register a consumer reward denom + params := keeper.GetConsumerParams(ctx) + params.RewardDenoms = []string{sdk.DefaultBondDenom} + params.DistributionTransmissionChannel = "" + keeper.SetParams(ctx, params) + + // send coins to the pool which is used for collect reward distributions to be sent to the provider + err := bankKeeper.SendCoinsFromAccountToModule( + ctx, + s.consumerChain.SenderAccount.GetAddress(), + consumertypes.ConsumerToSendToProviderName, + sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))), + ) + s.Require().NoError(err) + }, + expError: false, + tokenTransfers: 0, + }, + { + name: "no recipient address", + setup: func(ctx sdk.Context, keeper *consumerkeeper.Keeper, bankKeeper icstestingutils.TestBankKeeper) { + s.SetupTransferChannel() + + // register a consumer reward denom + params := keeper.GetConsumerParams(ctx) + params.RewardDenoms = []string{sdk.DefaultBondDenom} + params.ProviderFeePoolAddrStr = "" + keeper.SetParams(ctx, params) + + // send coins to the pool which is used for collect reward distributions to be sent to the provider + err := bankKeeper.SendCoinsFromAccountToModule( + ctx, + s.consumerChain.SenderAccount.GetAddress(), + consumertypes.ConsumerToSendToProviderName, + sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100))), + ) + s.Require().NoError(err) + }, + expError: true, + tokenTransfers: 0, + }, + } + + for _, tc := range testCases { + s.SetupTest() + + // ccv channels setup + s.SetupCCVChannel(s.path) + bondAmt := sdk.NewInt(10000000) + delAddr := s.providerChain.SenderAccount.GetAddress() + delegate(s, delAddr, bondAmt) + s.providerChain.NextBlock() + + // customized setup + consumerCtx := s.consumerCtx() + consumerKeeper := s.consumerApp.GetConsumerKeeper() + tc.setup(consumerCtx, &consumerKeeper, s.consumerApp.GetTestBankKeeper()) + + // call SendRewardsToProvider + err := s.consumerApp.GetConsumerKeeper().SendRewardsToProvider(consumerCtx) + if tc.expError { + s.Require().Error(err) + } else { + s.Require().NoError(err) + } + + // check whether the amount of token transfers is as expected + commitments := s.consumerApp.GetIBCKeeper().ChannelKeeper.GetAllPacketCommitmentsAtChannel( + consumerCtx, + transfertypes.PortID, + s.consumerApp.GetConsumerKeeper().GetDistributionTransmissionChannel(consumerCtx), + ) + s.Require().Len(commitments, tc.tokenTransfers, "unexpected amount of token transfers; test: %s", tc.name) + } +} + // getEscrowBalance gets the current balances in the escrow account holding the transferred tokens to the provider -func (s CCVTestSuite) getEscrowBalance() sdk.Coins { //nolint:govet // we copy locks for this test +func (s *CCVTestSuite) getEscrowBalance() sdk.Coins { consumerBankKeeper := s.consumerApp.GetTestBankKeeper() transChanID := s.consumerApp.GetConsumerKeeper().GetDistributionTransmissionChannel(s.consumerCtx()) escAddr := transfertypes.GetEscrowAddress(transfertypes.PortID, transChanID) diff --git a/testutil/integration/debug_test.go b/testutil/integration/debug_test.go index 828c9b6810..6b9415440e 100644 --- a/testutil/integration/debug_test.go +++ b/testutil/integration/debug_test.go @@ -85,6 +85,10 @@ func TestEndBlockRD(t *testing.T) { runCCVTestByName(t, "TestEndBlockRD") } +func TestSendRewardsToProvider(t *testing.T) { + runCCVTestByName(t, "TestSendRewardsToProvider") +} + // // Expired client tests // diff --git a/x/ccv/consumer/keeper/distribution.go b/x/ccv/consumer/keeper/distribution.go index 5fe416ea2b..a2c19b495d 100644 --- a/x/ccv/consumer/keeper/distribution.go +++ b/x/ccv/consumer/keeper/distribution.go @@ -103,62 +103,74 @@ func (k Keeper) shouldSendRewardsToProvider(ctx sdk.Context) bool { // all the block rewards allocated for the provider func (k Keeper) SendRewardsToProvider(ctx sdk.Context) error { // empty out the toSendToProviderTokens address - ch := k.GetDistributionTransmissionChannel(ctx) - transferChannel, found := k.channelKeeper.GetChannel(ctx, transfertypes.PortID, ch) - if found && transferChannel.State == channeltypes.OPEN { - tstProviderAddr := k.authKeeper.GetModuleAccount(ctx, - types.ConsumerToSendToProviderName).GetAddress() - providerAddr := k.GetProviderFeePoolAddrStr(ctx) - timeoutHeight := clienttypes.ZeroHeight() - transferTimeoutPeriod := k.GetTransferTimeoutPeriod(ctx) - timeoutTimestamp := uint64(ctx.BlockTime().Add(transferTimeoutPeriod).UnixNano()) - - sentCoins := sdk.NewCoins() - var allBalances sdk.Coins - // iterate over all whitelisted reward denoms - for _, denom := range k.AllowedRewardDenoms(ctx) { - // get the balance of the denom in the toSendToProviderTokens address - balance := k.bankKeeper.GetBalance(ctx, tstProviderAddr, denom) - allBalances = allBalances.Add(balance) - - // if the balance is not zero, - if !balance.IsZero() { - packetTransfer := &transfertypes.MsgTransfer{ - SourcePort: transfertypes.PortID, - SourceChannel: ch, - Token: balance, - Sender: tstProviderAddr.String(), // consumer address to send from - Receiver: providerAddr, // provider fee pool address to send to - TimeoutHeight: timeoutHeight, // timeout height disabled - TimeoutTimestamp: timeoutTimestamp, - Memo: "consumer chain rewards distribution", - } - _, err := k.ibcTransferKeeper.Transfer(ctx, packetTransfer) - if err != nil { - return err - } - sentCoins = sentCoins.Add(balance) + sourceChannelID := k.GetDistributionTransmissionChannel(ctx) + transferChannel, found := k.channelKeeper.GetChannel(ctx, transfertypes.PortID, sourceChannelID) + if !found || transferChannel.State != channeltypes.OPEN { + k.Logger(ctx).Info("WARNING: cannot send rewards to provider;", + "transmission channel not in OPEN state", "channelID", sourceChannelID) + return nil + } + + // get params for sending rewards + toSendToProviderAddr := k.authKeeper.GetModuleAccount(ctx, + types.ConsumerToSendToProviderName).GetAddress() // sender address + providerAddr := k.GetProviderFeePoolAddrStr(ctx) // recipient address + timeoutHeight := clienttypes.ZeroHeight() + timeoutTimestamp := uint64(ctx.BlockTime().Add(k.GetTransferTimeoutPeriod(ctx)).UnixNano()) + + sentCoins := sdk.NewCoins() + var allBalances sdk.Coins + // iterate over all whitelisted reward denoms + for _, denom := range k.AllowedRewardDenoms(ctx) { + // get the balance of the denom in the toSendToProviderTokens address + balance := k.bankKeeper.GetBalance(ctx, toSendToProviderAddr, denom) + allBalances = allBalances.Add(balance) + + // if the balance is not zero, + if !balance.IsZero() { + packetTransfer := &transfertypes.MsgTransfer{ + SourcePort: transfertypes.PortID, + SourceChannel: sourceChannelID, + Token: balance, + Sender: toSendToProviderAddr.String(), // consumer address to send from + Receiver: providerAddr, // provider fee pool address to send to + TimeoutHeight: timeoutHeight, // timeout height disabled + TimeoutTimestamp: timeoutTimestamp, + Memo: "consumer chain rewards distribution", } - } - k.Logger(ctx).Info("sent block rewards to provider", - "total fee pool", allBalances.String(), - "sent", sentCoins.String(), - ) - currentHeight := ctx.BlockHeight() - ctx.EventManager().EmitEvent( - sdk.NewEvent( - ccv.EventTypeFeeDistribution, - sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), - sdk.NewAttribute(ccv.AttributeDistributionCurrentHeight, strconv.Itoa(int(currentHeight))), - sdk.NewAttribute(ccv.AttributeDistributionNextHeight, strconv.Itoa(int(currentHeight+k.GetBlocksPerDistributionTransmission(ctx)))), - sdk.NewAttribute(ccv.AttributeDistributionFraction, (k.GetConsumerRedistributionFrac(ctx))), - sdk.NewAttribute(ccv.AttributeDistributionTotal, allBalances.String()), - sdk.NewAttribute(ccv.AttributeDistributionToProvider, sentCoins.String()), - ), - ) + // validate MsgTransfer before calling Transfer() + err := packetTransfer.ValidateBasic() + if err != nil { + return err + } + + _, err = k.ibcTransferKeeper.Transfer(ctx, packetTransfer) + if err != nil { + return err + } + + sentCoins = sentCoins.Add(balance) + } } + k.Logger(ctx).Info("sent block rewards to provider", + "total fee pool", allBalances.String(), + "sent", sentCoins.String(), + ) + currentHeight := ctx.BlockHeight() + ctx.EventManager().EmitEvent( + sdk.NewEvent( + ccv.EventTypeFeeDistribution, + sdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName), + sdk.NewAttribute(ccv.AttributeDistributionCurrentHeight, strconv.Itoa(int(currentHeight))), + sdk.NewAttribute(ccv.AttributeDistributionNextHeight, strconv.Itoa(int(currentHeight+k.GetBlocksPerDistributionTransmission(ctx)))), + sdk.NewAttribute(ccv.AttributeDistributionFraction, (k.GetConsumerRedistributionFrac(ctx))), + sdk.NewAttribute(ccv.AttributeDistributionTotal, allBalances.String()), + sdk.NewAttribute(ccv.AttributeDistributionToProvider, sentCoins.String()), + ), + ) + return nil } diff --git a/x/ccv/consumer/types/params_test.go b/x/ccv/consumer/types/params_test.go index 1690fc9f81..ff5d0f325f 100644 --- a/x/ccv/consumer/types/params_test.go +++ b/x/ccv/consumer/types/params_test.go @@ -29,10 +29,6 @@ func TestValidateParams(t *testing.T) { "custom invalid params, dist transmission channel", ccvtypes.NewParams(true, 5, "badchannel/", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), false, }, - { - "custom invalid params, provider fee pool addr string", - ccvtypes.NewParams(true, 5, "", "imabadaddress", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), false, - }, { "custom invalid params, ccv timeout", ccvtypes.NewParams(true, 5, "", "", -5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), false, diff --git a/x/ccv/types/params.go b/x/ccv/types/params.go index e8ea0a8765..6a903c0d8f 100644 --- a/x/ccv/types/params.go +++ b/x/ccv/types/params.go @@ -32,10 +32,10 @@ const ( // (and for consistency with other protobuf schemas defined for ccv). DefaultHistoricalEntries = int64(stakingtypes.DefaultHistoricalEntries) - // In general, the default unbonding period on the consumer is one day less + // In general, the default unbonding period on the consumer is one week less // than the default unbonding period on the provider, where the provider uses // the staking module default. - DefaultConsumerUnbondingPeriod = stakingtypes.DefaultUnbondingTime - 24*time.Hour + DefaultConsumerUnbondingPeriod = stakingtypes.DefaultUnbondingTime - 7*24*time.Hour // By default, the bottom 5% of the validator set can opt out of validating consumer chains DefaultSoftOptOutThreshold = "0.05" @@ -179,8 +179,8 @@ func ValidateProviderFeePoolAddrStr(i interface{}) error { if i == "" { return nil } - // Otherwise validate as usual for a bech32 address - return ValidateBech32(i) + // Cannot validate provider chain address on the consumer chain + return nil } func ValidateSoftOptOutThreshold(i interface{}) error { From 727e731c9eccc3f4b52fd42db2e55bd8a484d263 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Thu, 14 Sep 2023 12:20:47 -0700 Subject: [PATCH 02/17] feat!: throttle with retries provider changes (#1230) * wip, tests not fixed yet * rm packet query on provider * rm unneeded UTs * rm tests from relay_test * rm query and more tests * rm more tests * builds again and rm debug tests * lint * fix handling of slash packet and integration test * Fix TestMultiConsumerSlashPacketThrottling * fix two more slashing integration tests * Update TestSlashRetries, cleanup neededc * cleaned up TestSlashRetries * UT for TestOnRecvDowntimeSlashPacket * cleans * use helper in throttle test * lintz * Revert "rm packet query on provider" This reverts commit a10a2398cc6b878a889e196252e97a1b67c65be4. * cmd file too * fully restore query * Revert "Merge branch 'main' into shawn/throttle-with-retries-provider-changes" This reverts commit 73db33b3ed906d29dac643daa8a600f191076eee, reversing changes made to 78a8269db9e041df1449be180098daab17a42f06. * make e2e test pass, with todos * clean * Revert "Revert "Merge branch 'main' into shawn/throttle-with-retries-provider-changes"" This reverts commit 5bfccc39dc130d6f4be9ed7c0932176357618296. * lint * Update CHANGELOG.md * slightly longer buffer * build(deps): bump actions/checkout from 3 to 4 (#1257) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps)!: bump github.com/cosmos/ibc-go/v7 from 7.2.0 to 7.3.0 (#1258) * build(deps): bump github.com/cosmos/ibc-go/v7 from 7.2.0 to 7.3.0 Bumps [github.com/cosmos/ibc-go/v7](https://github.com/cosmos/ibc-go) from 7.2.0 to 7.3.0. - [Release notes](https://github.com/cosmos/ibc-go/releases) - [Changelog](https://github.com/cosmos/ibc-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/ibc-go/compare/v7.2.0...v7.3.0) --- updated-dependencies: - dependency-name: github.com/cosmos/ibc-go/v7 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * add changelog entries --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mpoke * build(deps): bump github.com/cosmos/cosmos-sdk from 0.47.4 to 0.47.5 (#1259) * build(deps): bump github.com/cosmos/cosmos-sdk from 0.47.3 to 0.47.5 Bumps [github.com/cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) from 0.47.3 to 0.47.5. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/v0.47.3...v0.47.5) --- updated-dependencies: - dependency-name: github.com/cosmos/cosmos-sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * add changelog entries --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mpoke * chore: Separate semver (#1217) separate semver * docs: cleanup changelog (#1260) fix changelog * fix!: validate MsgTransfer before calling Transfer() (#1244) * validate MsgTransfer * add TestSendRewardsToProvider * update DefaultConsumerUnbondingPeriod to 14 days * update changelog * fix linter * fix test * apply review suggestions * update changelog * docs: Create adr-012-separate-releasing.md (#1229) * Create adr-011-separate-releasing.md * Update docs/docs/adrs/adr-011-separate-releasing.md Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * adr 12 not 11 * correct that we use postfix not prefix * explanation on example release flow --------- Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * fix: remove addr validation for provider fee pool addr param (#1262) * fix: remove validation for provider chain address since we cannot validate it properly on consumer * add changelog entry * Revert "Merge branch 'main' into shawn/throttle-with-retries-provider-changes" This reverts commit 6bdfff9db15da62b61244b813f045f49b56fc6c3, reversing changes made to d8f569020b45b7fa6048983a9ccef91b9c8dfc38. * fmt * Update steps_downtime.go * Update tests/e2e/steps_downtime.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * waittime instead of sleep * Update x/ccv/provider/client/cli/query.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * Update x/ccv/provider/client/cli/query.go Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * rm throttled packets from query * rm provider query * whoopsies forgot to rm some boilerplate --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mpoke Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Co-authored-by: Dmitry Kolupaev --- CHANGELOG.md | 1 + .../ccv/provider/v1/query.proto | 37 - tests/e2e/actions.go | 39 +- tests/e2e/main.go | 4 +- tests/e2e/state.go | 40 +- tests/e2e/steps_downtime.go | 73 +- tests/integration/common.go | 71 +- tests/integration/slashing.go | 38 +- tests/integration/stop_consumer.go | 48 - tests/integration/throttle.go | 481 +----- tests/integration/throttle_retry.go | 175 ++- testutil/integration/debug_test.go | 16 - testutil/keeper/unit_test_helpers.go | 9 - x/ccv/provider/client/cli/query.go | 37 - x/ccv/provider/keeper/grpc_query.go | 85 -- x/ccv/provider/keeper/proposal.go | 15 - x/ccv/provider/keeper/proposal_test.go | 23 - x/ccv/provider/keeper/relay.go | 113 +- x/ccv/provider/keeper/relay_test.go | 209 +-- x/ccv/provider/keeper/throttle.go | 438 ------ x/ccv/provider/keeper/throttle_test.go | 844 ----------- x/ccv/provider/module.go | 2 + x/ccv/provider/types/query.pb.go | 1317 ++--------------- x/ccv/provider/types/query.pb.gw.go | 83 -- 24 files changed, 456 insertions(+), 3742 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 792e83a7a9..867c9d54c6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ Add an entry to the unreleased provider section whenever merging a PR to main that is not targeted at a specific release. These entries will eventually be included in a provider release. +* (feat!) [#1230](https://github.com/cosmos/interchain-security/pull/1230) Throttle with retries provider changes. * (feature!) [#1244](https://github.com/cosmos/interchain-security/pull/1244) Update the default consumer unbonding period to 2 weeks. * (deps) [#1259](https://github.com/cosmos/interchain-security/pull/1259) Bump [cosmos-sdk](https://github.com/cosmos/cosmos-sdk) to [v0.47.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.47.5). * (deps!) [#1258](https://github.com/cosmos/interchain-security/pull/1258) Bump [ibc-go](https://github.com/cosmos/ibc-go) to [v7.3.0](https://github.com/cosmos/ibc-go/releases/tag/v7.3.0). diff --git a/proto/interchain_security/ccv/provider/v1/query.proto b/proto/interchain_security/ccv/provider/v1/query.proto index b0c1dc2b47..089df6bfec 100644 --- a/proto/interchain_security/ccv/provider/v1/query.proto +++ b/proto/interchain_security/ccv/provider/v1/query.proto @@ -65,14 +65,6 @@ service Query { "/interchain_security/ccv/provider/throttle_state"; } - // QueryThrottledConsumerPacketData returns a list of pending packet data - // instances (slash packet and vsc matured) for a single consumer chain - rpc QueryThrottledConsumerPacketData(QueryThrottledConsumerPacketDataRequest) - returns (QueryThrottledConsumerPacketDataResponse) { - option (google.api.http).get = - "/interchain_security/ccv/provider/pending_consumer_packets"; - } - // QueryRegisteredConsumerRewardDenoms returns a list of consumer reward // denoms that are registered rpc QueryRegisteredConsumerRewardDenoms( @@ -151,35 +143,6 @@ message QueryThrottleStateResponse { // full google.protobuf.Timestamp next_replenish_candidate = 3 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; - // data relevant to currently throttled slash packets - repeated ThrottledSlashPacket packets = 4; -} - -message QueryThrottledConsumerPacketDataRequest { string chain_id = 1; } - -message QueryThrottledConsumerPacketDataResponse { - string chain_id = 1; - uint64 size = 2; - repeated ThrottledPacketDataWrapper packetDataInstances = 3 - [ (gogoproto.nullable) = false ]; -} - -// A query wrapper type for the global entry and data relevant to a throttled -// slash packet. -message ThrottledSlashPacket { - interchain_security.ccv.provider.v1.GlobalSlashEntry global_entry = 1 - [ (gogoproto.nullable) = false ]; - interchain_security.ccv.v1.SlashPacketData data = 2 - [ (gogoproto.nullable) = false ]; -} - -// ThrottledPacketDataWrapper contains either SlashPacketData or -// VSCMaturedPacketData -message ThrottledPacketDataWrapper { - oneof data { - interchain_security.ccv.v1.SlashPacketData slash_packet = 1; - interchain_security.ccv.v1.VSCMaturedPacketData vsc_matured_packet = 2; - } } message QueryRegisteredConsumerRewardDenomsRequest {} diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index fccc27a957..7f31a3b451 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -1937,50 +1937,41 @@ func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbos tr.waitBlocks(chainID("provi"), 2, 30*time.Second) } -// slashThrottleDequeue polls slash queue sizes until nextQueueSize is achieved -type slashThrottleDequeue struct { - chain chainID - currentQueueSize int - nextQueueSize int +// slashMeterReplenishmentAction polls the slash meter on provider until value is achieved +type slashMeterReplenishmentAction struct { + targetValue int64 // panic if timeout is exceeded timeout time.Duration } -func (tr TestRun) waitForSlashThrottleDequeue( - action slashThrottleDequeue, +func (tr TestRun) waitForSlashMeterReplenishment( + action slashMeterReplenishmentAction, verbose bool, ) { timeout := time.Now().Add(action.timeout) - initialGlobalQueueSize := int(tr.getGlobalSlashQueueSize()) + initialSlashMeter := tr.getSlashMeter() - if initialGlobalQueueSize != action.currentQueueSize { - panic(fmt.Sprintf("wrong initial queue size: %d - expected global queue: %d\n", initialGlobalQueueSize, action.currentQueueSize)) + if initialSlashMeter >= 0 { + panic(fmt.Sprintf("No need to wait for slash meter replenishment, current value: %d", initialSlashMeter)) } + for { - globalQueueSize := int(tr.getGlobalSlashQueueSize()) - chainQueueSize := int(tr.getConsumerChainPacketQueueSize(action.chain)) + slashMeter := tr.getSlashMeter() if verbose { - fmt.Printf("waiting for packed queue size to reach: %d - current: %d\n", action.nextQueueSize, globalQueueSize) + fmt.Printf("waiting for slash meter to be replenished, current value: %d\n", slashMeter) } - // check if global queue size is equal to chain queue size - if globalQueueSize == chainQueueSize && globalQueueSize == action.nextQueueSize { //nolint:gocritic // this is the comparison that we want here. + // check if meter has reached target value + if slashMeter >= action.targetValue { break } if time.Now().After(timeout) { - panic(fmt.Sprintf("\n\n\nwaitForSlashThrottleDequeuemethod has timed out after: %s\n\n", action.timeout)) + panic(fmt.Sprintf("\n\nwaitForSlashMeterReplenishment has timed out after: %s\n\n", action.timeout)) } - time.Sleep(500 * time.Millisecond) + tr.WaitTime(5 * time.Second) } - // wair for 2 blocks to be created - // allowing the jailing to be incorporated into voting power - tr.waitBlocks(action.chain, 2, time.Minute) -} - -func uintPointer(i uint) *uint { - return &i } // GetPathNameForGorelayer returns the name of the path between two given chains used by Gorelayer. diff --git a/tests/e2e/main.go b/tests/e2e/main.go index e9336422ae..c8a840f206 100644 --- a/tests/e2e/main.go +++ b/tests/e2e/main.go @@ -242,8 +242,8 @@ func (tr *TestRun) runStep(step Step, verbose bool) { tr.registerRepresentative(action, verbose) case assignConsumerPubKeyAction: tr.assignConsumerPubKey(action, verbose) - case slashThrottleDequeue: - tr.waitForSlashThrottleDequeue(action, verbose) + case slashMeterReplenishmentAction: + tr.waitForSlashMeterReplenishment(action, verbose) case startRelayerAction: tr.startRelayer(action, verbose) case registerConsumerRewardDenomAction: diff --git a/tests/e2e/state.go b/tests/e2e/state.go index 8cc343ef00..57fc06e6c9 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -168,19 +168,6 @@ func (tr TestRun) getChainState(chain chainID, modelState ChainState) ChainState chainState.ProviderKeys = &providerKeys } - if modelState.GlobalSlashQueueSize != nil { - globalQueueSize := tr.getGlobalSlashQueueSize() - chainState.GlobalSlashQueueSize = &globalQueueSize - } - - if modelState.ConsumerChainQueueSizes != nil { - consumerChainQueueSizes := map[chainID]uint{} - for c := range *modelState.ConsumerChainQueueSizes { - consumerChainQueueSizes[c] = tr.getConsumerChainPacketQueueSize(c) - } - chainState.ConsumerChainQueueSizes = &consumerChainQueueSizes - } - if modelState.RegisteredConsumerRewardDenoms != nil { registeredConsumerRewardDenoms := tr.getRegisteredConsumerRewardDenoms(chain) chainState.RegisteredConsumerRewardDenoms = ®isteredConsumerRewardDenoms @@ -667,9 +654,10 @@ func (tr TestRun) getProviderAddressFromConsumer(consumerChain chainID, validato return addr } -func (tr TestRun) getGlobalSlashQueueSize() uint { +func (tr TestRun) getSlashMeter() int64 { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chainID("provi")].binaryName, + cmd := exec.Command("docker", "exec", + tr.containerConfig.instanceName, tr.chainConfigs[chainID("provi")].binaryName, "query", "provider", "throttle-state", `--node`, tr.getQueryNode(chainID("provi")), @@ -680,26 +668,8 @@ func (tr TestRun) getGlobalSlashQueueSize() uint { log.Fatal(err, "\n", string(bz)) } - packets := gjson.Get(string(bz), "packets").Array() - return uint(len(packets)) -} - -func (tr TestRun) getConsumerChainPacketQueueSize(consumerChain chainID) uint { - //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chainID("provi")].binaryName, - - "query", "provider", "throttled-consumer-packet-data", - string(consumerChain), - `--node`, tr.getQueryNode(chainID("provi")), - `-o`, `json`, - ) - bz, err := cmd.CombinedOutput() - if err != nil { - log.Fatal(err, "\n", string(bz)) - } - - size := gjson.Get(string(bz), "size").Uint() - return uint(size) + slashMeter := gjson.Get(string(bz), "slash_meter") + return slashMeter.Int() } func (tr TestRun) getRegisteredConsumerRewardDenoms(chain chainID) []string { diff --git a/tests/e2e/steps_downtime.go b/tests/e2e/steps_downtime.go index e6d320bec1..f79b945ec0 100644 --- a/tests/e2e/steps_downtime.go +++ b/tests/e2e/steps_downtime.go @@ -56,7 +56,8 @@ func stepsDowntime(consumerName string) []Step { chainID(consumerName): ChainState{ ValPowers: &map[validatorID]uint{ validatorID("alice"): 509, - validatorID("bob"): 500, + // Bob's stake may or may not be slashed at this point depending on comet vs cometmock + // See https://github.com/cosmos/interchain-security/issues/1304 validatorID("carol"): 501, }, }, @@ -278,7 +279,7 @@ func stepsThrottledDowntime(consumerName string) []Step { validator: validatorID("bob"), }, state: State{ - // slash packet queued on consumer, but powers not affected on either chain yet + // slash packet queued for bob on consumer, but powers not affected on either chain yet chainID("provi"): ChainState{ ValPowers: &map[validatorID]uint{ validatorID("alice"): 511, @@ -312,11 +313,6 @@ func stepsThrottledDowntime(consumerName string) []Step { validatorID("bob"): 0, // bob is jailed validatorID("carol"): 500, }, - // no provider throttling engaged yet - GlobalSlashQueueSize: uintPointer(0), - ConsumerChainQueueSizes: &map[chainID]uint{ - chainID(consumerName): uint(0), - }, }, chainID(consumerName): ChainState{ // VSC packet applying jailing is not yet relayed to consumer @@ -328,13 +324,13 @@ func stepsThrottledDowntime(consumerName string) []Step { }, }, }, + // Invoke carol downtime slash on consumer { action: downtimeSlashAction{ chain: chainID(consumerName), validator: validatorID("carol"), }, state: State{ - // powers not affected on either chain yet chainID("provi"): ChainState{ ValPowers: &map[validatorID]uint{ validatorID("alice"): 511, @@ -343,10 +339,9 @@ func stepsThrottledDowntime(consumerName string) []Step { }, }, chainID(consumerName): ChainState{ - // VSC packet applying jailing is not yet relayed to consumer ValPowers: &map[validatorID]uint{ validatorID("alice"): 511, - validatorID("bob"): 500, + validatorID("bob"): 500, // VSC packet jailing bob is not yet relayed to consumer validatorID("carol"): 500, }, }, @@ -364,42 +359,35 @@ func stepsThrottledDowntime(consumerName string) []Step { ValPowers: &map[validatorID]uint{ validatorID("alice"): 511, validatorID("bob"): 0, - validatorID("carol"): 500, // not slashed due to throttling - }, - GlobalSlashQueueSize: uintPointer(1), // carol's slash request is throttled - ConsumerChainQueueSizes: &map[chainID]uint{ - chainID(consumerName): uint(1), + validatorID("carol"): 500, // slash packet for carol recv by provider, carol not slashed due to throttling }, }, chainID(consumerName): ChainState{ ValPowers: &map[validatorID]uint{ validatorID("alice"): 511, - validatorID("bob"): 0, + validatorID("bob"): 0, // VSC packet applying bob jailing is also relayed and recv by consumer validatorID("carol"): 500, }, }, }, }, + // TODO(Shawn): Improve this test to have the consumer retry it's downtime slash, and to assert queue size on consumer. + // See https://github.com/cosmos/interchain-security/issues/1103 and https://github.com/cosmos/interchain-security/issues/1233 { - action: slashThrottleDequeue{ - chain: chainID(consumerName), - currentQueueSize: 1, - nextQueueSize: 0, + action: slashMeterReplenishmentAction{ + targetValue: 0, // We just want slash meter to be non-negative + // Slash meter replenish fraction is set to 10%, replenish period is 20 seconds, see config.go // Meter is initially at 10%, decremented to -23% from bob being jailed. It'll then take three replenishments - // for meter to become positive again. 3*20 = 60 seconds + buffer = 80 seconds - timeout: 80 * time.Second, + // for meter to become positive again. 3*20 = 60 seconds + buffer = 100 seconds + timeout: 100 * time.Second, }, state: State{ chainID("provi"): ChainState{ ValPowers: &map[validatorID]uint{ validatorID("alice"): 511, validatorID("bob"): 0, - validatorID("carol"): 0, // Carol is jailed upon packet being handled on provider - }, - GlobalSlashQueueSize: uintPointer(0), // slash packets dequeued - ConsumerChainQueueSizes: &map[chainID]uint{ - chainID(consumerName): 0, + validatorID("carol"): 500, // Carol still not slashed, packet must be retried }, }, chainID(consumerName): ChainState{ @@ -412,36 +400,5 @@ func stepsThrottledDowntime(consumerName string) []Step { }, }, }, - // A block is incremented each action, hence why VSC is committed on provider, - // and can now be relayed as packet to consumer - { - action: relayPacketsAction{ - chainA: chainID("provi"), - chainB: chainID(consumerName), - port: "provider", - channel: 0, - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 0, - }, - GlobalSlashQueueSize: uintPointer(0), - ConsumerChainQueueSizes: &map[chainID]uint{ - chainID(consumerName): 0, - }, - }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - // throttled update gets to consumer - validatorID("bob"): 0, - validatorID("carol"): 0, - }, - }, - }, - }, } } diff --git a/tests/integration/common.go b/tests/integration/common.go index 7d5175d5d7..171253ddbc 100644 --- a/tests/integration/common.go +++ b/tests/integration/common.go @@ -1,6 +1,7 @@ package integration import ( + "bytes" "fmt" "time" @@ -414,50 +415,33 @@ func (suite *CCVTestSuite) commitConsumerPacket(ctx sdk.Context, packetData ccv. func (s *CCVTestSuite) constructSlashPacketFromConsumer(bundle icstestingutils.ConsumerBundle, tmVal tmtypes.Validator, infractionType stakingtypes.Infraction, ibcSeqNum uint64, ) channeltypes.Packet { + packet, _ := s.constructSlashPacketFromConsumerWithData(bundle, tmVal, infractionType, ibcSeqNum) + return packet +} + +func (s *CCVTestSuite) constructSlashPacketFromConsumerWithData(bundle icstestingutils.ConsumerBundle, + tmVal tmtypes.Validator, infractionType stakingtypes.Infraction, ibcSeqNum uint64, +) (channeltypes.Packet, ccv.SlashPacketData) { valsetUpdateId := bundle.GetKeeper().GetHeightValsetUpdateID( bundle.GetCtx(), uint64(bundle.GetCtx().BlockHeight())) - data := ccv.ConsumerPacketData{ - Type: ccv.SlashPacket, - Data: &ccv.ConsumerPacketData_SlashPacketData{ - SlashPacketData: &ccv.SlashPacketData{ - Validator: abci.Validator{ - Address: tmVal.Address, - Power: tmVal.VotingPower, - }, - ValsetUpdateId: valsetUpdateId, - Infraction: infractionType, - }, + spdData := ccv.SlashPacketData{ + Validator: abci.Validator{ + Address: tmVal.Address, + Power: tmVal.VotingPower, }, + ValsetUpdateId: valsetUpdateId, + Infraction: infractionType, } - return channeltypes.NewPacket(data.GetBytes(), - ibcSeqNum, - ccv.ConsumerPortID, // Src port - bundle.Path.EndpointA.ChannelID, // Src channel - ccv.ProviderPortID, // Dst port - bundle.Path.EndpointB.ChannelID, // Dst channel - clienttypes.Height{}, - uint64(bundle.GetCtx().BlockTime().Add(ccv.DefaultCCVTimeoutPeriod).UnixNano()), - ) -} - -// constructVSCMaturedPacketFromConsumer constructs an IBC packet embedding -// VSC Matured packet data to be sent from consumer to provider -func (s *CCVTestSuite) constructVSCMaturedPacketFromConsumer(bundle icstestingutils.ConsumerBundle, - ibcSeqNum uint64, -) channeltypes.Packet { - valsetUpdateId := bundle.GetKeeper().GetHeightValsetUpdateID( - bundle.GetCtx(), uint64(bundle.GetCtx().BlockHeight())) - - data := ccv.ConsumerPacketData{ - Type: ccv.VscMaturedPacket, - Data: &ccv.ConsumerPacketData_VscMaturedPacketData{ - VscMaturedPacketData: &ccv.VSCMaturedPacketData{ValsetUpdateId: valsetUpdateId}, + cpdData := ccv.ConsumerPacketData{ + Type: ccv.SlashPacket, + Data: &ccv.ConsumerPacketData_SlashPacketData{ + SlashPacketData: &spdData, }, } - return channeltypes.NewPacket(data.GetBytes(), + return channeltypes.NewPacket(cpdData.GetBytes(), ibcSeqNum, ccv.ConsumerPortID, // Src port bundle.Path.EndpointA.ChannelID, // Src channel @@ -465,7 +449,7 @@ func (s *CCVTestSuite) constructVSCMaturedPacketFromConsumer(bundle icstestingut bundle.Path.EndpointB.ChannelID, // Dst channel clienttypes.Height{}, uint64(bundle.GetCtx().BlockTime().Add(ccv.DefaultCCVTimeoutPeriod).UnixNano()), - ) + ), spdData } // incrementTime increments the overall time by jumpPeriod @@ -615,3 +599,18 @@ func (s *CCVTestSuite) setupValidatorPowers() { } s.Require().Equal(int64(4000), stakingKeeper.GetLastTotalPower(s.providerCtx()).Int64()) } + +// mustGetStakingValFromTmVal returns the staking validator from the current state of the staking keeper, +// corresponding to a given tendermint validator. Note this func will fail the test if the validator is not found. +func (s *CCVTestSuite) mustGetStakingValFromTmVal(tmVal tmtypes.Validator) (stakingVal stakingtypes.Validator) { + vals := s.providerApp.GetTestStakingKeeper().GetAllValidators(s.providerCtx()) + for i, val := range vals { + consAddr, err := val.GetConsAddr() + s.Require().NoError(err) + if bytes.Equal(consAddr.Bytes(), tmVal.Address.Bytes()) { + stakingVal = vals[i] + } + } + s.Require().NotZero(stakingVal) + return stakingVal +} diff --git a/tests/integration/slashing.go b/tests/integration/slashing.go index 1ce7d11db8..7a7ea0e935 100644 --- a/tests/integration/slashing.go +++ b/tests/integration/slashing.go @@ -76,12 +76,11 @@ func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { firstConsumerKeeper.SetOutstandingDowntime(s.consumerCtx(), consumerConsAddr.ToSdkConsAddr()) // Note: RecvPacket advances two blocks. Let's say the provider is currently at height N. - // The received slash packet will be queued during N, and handled by the ccv module during - // the endblocker of N. The staking module will then register a validator update from that - // packet during the endblocker of N+1 (note that staking endblocker runs before ccv endblocker, - // hence why the VSC is registered on N+1). Then the ccv module sends VSC packets to each consumer - // during the endblocker of N+1. The new validator set will be committed to in block N+2, - // and will be in effect for the provider during block N+3. + // The received slash packet will be handled during N. The staking module will then register + // a validator update from that packet during the endblocker of N. Then the ccv module sends + // VSC packets to each consumer during the endblocker of N (note ccv endblocker runs after staking). + // The new validator set will be committed to in block N+1, and will be in effect + // for the provider during block N+2. valsetUpdateIdN := providerKeeper.GetValidatorSetUpdateId(s.providerCtx()) @@ -91,8 +90,8 @@ func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { // We've now advanced two blocks. - // VSC packets should have been sent from provider during block N+1 to each consumer - expectedSentValsetUpdateId := valsetUpdateIdN + 1 + // VSC packets should have been sent from provider during block N to each consumer + expectedSentValsetUpdateId := valsetUpdateIdN for _, bundle := range s.consumerBundles { _, found := providerKeeper.GetVscSendTimestamp(s.providerCtx(), bundle.Chain.ChainID, expectedSentValsetUpdateId) @@ -104,10 +103,7 @@ func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { s.Require().Equal(valsetUpdateIdN+2, providerKeeper.GetValidatorSetUpdateId(s.providerCtx())) - // Call next block so provider is now on block N + 3 mentioned above - s.providerChain.NextBlock() - - // check that the validator was removed from the provider validator set by N + 3 + // check that the validator was removed from the provider validator set by N + 2 s.Require().Len(s.providerChain.Vals.Validators, validatorsPerChain-1) for _, bundle := range s.consumerBundles { @@ -151,9 +147,10 @@ func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { pFlag := firstConsumerKeeper.OutstandingDowntime(s.consumerCtx(), consumerConsAddr.ToSdkConsAddr()) s.Require().False(pFlag) - // check that slashing packet gets acknowledged successfully - ack := channeltypes.NewResultAcknowledgement([]byte{byte(1)}) - err = s.path.EndpointA.AcknowledgePacket(packet, ack.Acknowledgement()) + // Check that first consumer can recv ack from provider. + // Provider has returned SlashPacketHandledResult. + ack := channeltypes.NewResultAcknowledgement(ccv.SlashPacketHandledResult) + err = s.getFirstBundle().Path.EndpointA.AcknowledgePacket(packet, ack.Acknowledgement()) s.Require().NoError(err) } @@ -234,8 +231,9 @@ func (s *CCVTestSuite) TestRelayAndApplyDoubleSignPacket() { // check that validator was NOT tombstoned on provider s.Require().False(valSignInfo.Tombstoned) - // check that slashing packet gets acknowledged successfully - ack := channeltypes.NewResultAcknowledgement([]byte{byte(1)}) + // check that slashing packet gets acknowledged successfully, + // provider returns V1Result acks for double sign packets + ack := channeltypes.NewResultAcknowledgement(ccv.V1Result) err = s.path.EndpointA.AcknowledgePacket(packet, ack.Acknowledgement()) s.Require().NoError(err) } @@ -426,16 +424,10 @@ func (suite *CCVTestSuite) TestOnRecvSlashPacketErrors() { errAck = providerKeeper.OnRecvSlashPacket(ctx, packet, *slashingPkt) suite.Require().False(errAck.Success()) - // Expect nothing was queued - suite.Require().Equal(0, len(providerKeeper.GetAllGlobalSlashEntries(ctx))) - suite.Require().Equal(uint64(0), (providerKeeper.GetThrottledPacketDataSize(ctx, consumerChainID))) - // expect to queue entries for the slash request slashingPkt.Infraction = stakingtypes.Infraction_INFRACTION_DOWNTIME ack = providerKeeper.OnRecvSlashPacket(ctx, packet, *slashingPkt) suite.Require().True(ack.Success()) - suite.Require().Equal(1, len(providerKeeper.GetAllGlobalSlashEntries(ctx))) - suite.Require().Equal(uint64(1), (providerKeeper.GetThrottledPacketDataSize(ctx, consumerChainID))) } // TestValidatorDowntime tests if a slash packet is sent diff --git a/tests/integration/stop_consumer.go b/tests/integration/stop_consumer.go index b3d32ee6a4..452b28e3b1 100644 --- a/tests/integration/stop_consumer.go +++ b/tests/integration/stop_consumer.go @@ -6,7 +6,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) @@ -80,33 +79,6 @@ func (s *CCVTestSuite) TestStopConsumerChain() { return nil }, }, - { - func(suite *CCVTestSuite) error { - // Queue slash and vsc packet data for consumer 0, these queue entries will be removed - firstBundle := s.getFirstBundle() - globalEntry := types.NewGlobalSlashEntry(s.providerCtx().BlockTime(), firstBundle.Chain.ChainID, 7, types.ProviderConsAddress{Address: []byte{}}) - providerKeeper.QueueGlobalSlashEntry(s.providerCtx(), globalEntry) - err := providerKeeper.QueueThrottledSlashPacketData(s.providerCtx(), firstBundle.Chain.ChainID, 1, - ccv.SlashPacketData{ValsetUpdateId: 1}) - suite.Require().NoError(err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(s.providerCtx(), - firstBundle.Chain.ChainID, 2, ccv.VSCMaturedPacketData{ValsetUpdateId: 2}) - suite.Require().NoError(err) - - // Queue slash and vsc packet data for consumer 1, these queue entries will be not be removed - secondBundle := s.getBundleByIdx(1) - globalEntry = types.NewGlobalSlashEntry(s.providerCtx().BlockTime(), secondBundle.Chain.ChainID, 7, types.ProviderConsAddress{Address: []byte{}}) - providerKeeper.QueueGlobalSlashEntry(s.providerCtx(), globalEntry) - err = providerKeeper.QueueThrottledSlashPacketData(s.providerCtx(), secondBundle.Chain.ChainID, 1, - ccv.SlashPacketData{ValsetUpdateId: 1}) - suite.Require().NoError(err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(s.providerCtx(), - secondBundle.Chain.ChainID, 2, ccv.VSCMaturedPacketData{ValsetUpdateId: 2}) - suite.Require().NoError(err) - - return nil - }, - }, } for _, so := range setupOperations { @@ -120,15 +92,6 @@ func (s *CCVTestSuite) TestStopConsumerChain() { // check all states are removed and the unbonding operation released s.checkConsumerChainIsRemoved(firstBundle.Chain.ChainID, true) - - // check entries related to second consumer chain are not removed - s.Require().Len(providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()), 1) - - secondBundle := s.getBundleByIdx(1) - slashData, vscMaturedData, _, _ := providerKeeper.GetAllThrottledPacketData( - s.providerCtx(), secondBundle.Chain.ChainID) - s.Require().Len(slashData, 1) - s.Require().Len(vscMaturedData, 1) } // TODO Simon: implement OnChanCloseConfirm in IBC-GO testing to close the consumer chain's channel end @@ -199,15 +162,4 @@ func (s *CCVTestSuite) checkConsumerChainIsRemoved(chainID string, checkChannel s.Require().Nil(providerKeeper.GetSlashAcks(s.providerCtx(), chainID)) s.Require().Zero(providerKeeper.GetInitChainHeight(s.providerCtx(), chainID)) s.Require().Empty(providerKeeper.GetPendingVSCPackets(s.providerCtx(), chainID)) - - // No remaining global entries for this consumer - allGlobalEntries := providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()) - for _, entry := range allGlobalEntries { - s.Require().NotEqual(chainID, entry.ConsumerChainID) - } - - // No remaining per-chain entries for this consumer - slashData, vscMaturedData, _, _ := providerKeeper.GetAllThrottledPacketData(s.providerCtx(), chainID) - s.Require().Empty(slashData) - s.Require().Empty(vscMaturedData) } diff --git a/tests/integration/throttle.go b/tests/integration/throttle.go index 0505d6257a..740576c4f7 100644 --- a/tests/integration/throttle.go +++ b/tests/integration/throttle.go @@ -13,7 +13,6 @@ import ( icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" "github.com/cosmos/interchain-security/v3/x/ccv/provider" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) const fullSlashMeterString = "1.0" @@ -85,7 +84,8 @@ func (s *CCVTestSuite) TestBasicSlashPacketThrottling() { packet = s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmVal, stakingtypes.Infraction_INFRACTION_DOWNTIME, 2) sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, packet) - // Require that slash packet has not been handled + // Require that slash packet has not been handled, a bounce result would have + // been returned, but the IBC helper throws out acks. vals = providerStakingKeeper.GetAllValidators(s.providerCtx()) s.Require().False(vals[2].IsJailed()) @@ -135,11 +135,14 @@ func (s *CCVTestSuite) TestBasicSlashPacketThrottling() { slashMeter = s.providerApp.GetProviderKeeper().GetSlashMeter(cacheCtx) s.Require().True(slashMeter.IsPositive()) - // Assert validator 2 is jailed once pending slash packets are handled in ccv endblocker. - s.providerChain.NextBlock() - vals = providerStakingKeeper.GetAllValidators(cacheCtx) - slashedVal = vals[2] - s.Require().True(slashedVal.IsJailed()) + // Assert validator 2 is jailed once slash packet is retried. + tmVal2 := s.providerChain.Vals.Validators[2] + packet = s.constructSlashPacketFromConsumer(s.getFirstBundle(), + *tmVal2, stakingtypes.Infraction_INFRACTION_DOWNTIME, 3) // make sure to use a new seq num + sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, packet) + + stakingVal2 := s.mustGetStakingValFromTmVal(*tmVal2) + s.Require().True(stakingVal2.IsJailed()) // Assert validator 2 has no power, this should be apparent next block, // since the staking endblocker runs before the ccv endblocker. @@ -156,23 +159,8 @@ func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { s.SetupAllCCVChannels() s.setupValidatorPowers() - providerKeeper := s.providerApp.GetProviderKeeper() providerStakingKeeper := s.providerApp.GetTestStakingKeeper() - // First confirm that VSC matured packets are handled immediately (not queued) - // when no slash packets are sent. - - // Send 2 VSC matured packets from every consumer to provider - for consumerChainID, bundle := range s.consumerBundles { - packet := s.constructVSCMaturedPacketFromConsumer(*bundle, 1) // use sequence 1 - sendOnConsumerRecvOnProvider(s, bundle.Path, packet) - packet = s.constructVSCMaturedPacketFromConsumer(*bundle, 2) // use sequence 2 - sendOnConsumerRecvOnProvider(s, bundle.Path, packet) - // Confirm packets were not queued on provider for this consumer - s.Require().Equal(uint64(0), - providerKeeper.GetThrottledPacketDataSize(s.providerCtx(), consumerChainID)) - } - // Choose 3 consumer bundles. It doesn't matter which ones. idx := 0 senderBundles := []*icstestingutils.ConsumerBundle{} @@ -184,7 +172,7 @@ func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { idx++ } - // Send some packets to provider from the 3 chosen consumers. + // Send some slash packets to provider from the 3 chosen consumers. // They will each slash a different validator according to idx. idx = 0 valsToSlash := []tmtypes.Validator{} @@ -200,54 +188,70 @@ func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { *bundle, *tmVal, stakingtypes.Infraction_INFRACTION_DOWNTIME, - 3, // use sequence 3, 1 and 2 are used above. + 1, // all consumers use 1 seq num ) sendOnConsumerRecvOnProvider(s, bundle.Path, packet) - // Send two trailing VSC matured packets from consumer to provider - packet = s.constructVSCMaturedPacketFromConsumer(*bundle, 4) // use sequence 4 - sendOnConsumerRecvOnProvider(s, bundle.Path, packet) - packet = s.constructVSCMaturedPacketFromConsumer(*bundle, 5) // use sequence 5 - sendOnConsumerRecvOnProvider(s, bundle.Path, packet) - idx++ } - // Confirm that the slash packet and trailing VSC matured packet - // were handled immediately for the first consumer (this packet was recv first). + // Confirm that the slash packet for the first consumer was handled (this packet was recv first). s.confirmValidatorJailed(valsToSlash[0], true) - s.Require().Equal(uint64(0), providerKeeper.GetThrottledPacketDataSize( - s.providerCtx(), senderBundles[0].Chain.ChainID)) - // Packets were queued for the second and third consumers. + // Packets were bounced for the second and third consumers. s.confirmValidatorNotJailed(valsToSlash[1], 1000) - s.Require().Equal(uint64(3), providerKeeper.GetThrottledPacketDataSize( - s.providerCtx(), senderBundles[1].Chain.ChainID)) s.confirmValidatorNotJailed(valsToSlash[2], 1000) - s.Require().Equal(uint64(3), providerKeeper.GetThrottledPacketDataSize( - s.providerCtx(), senderBundles[2].Chain.ChainID)) // Total power is now 3000 s.Require().Equal(int64(3000), providerStakingKeeper.GetLastTotalPower(s.providerCtx()).Int64()) // Now replenish the slash meter and confirm one of two queued slash - // packet entries are then handled. Order is irrelevant here since those - // two packets were sent and recv at the same block time when being queued. + // packet entries are then handled, when both are retried. s.replenishSlashMeterTillPositive() - // 1st NextBlock will handle the slash packet, 2nd will update staking module val powers + // Retry from consumer with idx 1 + bundle := senderBundles[1] + packet := s.constructSlashPacketFromConsumer( + *bundle, + valsToSlash[1], + stakingtypes.Infraction_INFRACTION_DOWNTIME, + 2, // seq number is incremented since last try + ) + sendOnConsumerRecvOnProvider(s, bundle.Path, packet) + + // retry from consumer with idx 2 + bundle = senderBundles[2] + packet = s.constructSlashPacketFromConsumer( + *bundle, + valsToSlash[2], + stakingtypes.Infraction_INFRACTION_DOWNTIME, + 2, // seq number is incremented since last try + ) + sendOnConsumerRecvOnProvider(s, bundle.Path, packet) + + // Call NextBlocks to update staking module val powers s.providerChain.NextBlock() s.providerChain.NextBlock() - // If one of the entires was handled, total power will be 2000 (1000 power was slashed) + // If one of the entires was handled, total power will be 2000 (1000 power was just slashed) s.Require().Equal(int64(2000), providerStakingKeeper.GetLastTotalPower(s.providerCtx()).Int64()) // Now replenish one more time, and handle final slash packet. s.replenishSlashMeterTillPositive() - // 1st NextBlock will handle the slash packet, 2nd will update last validator power + // Retry from consumer with idx 2 + bundle = senderBundles[2] + packet = s.constructSlashPacketFromConsumer( + *bundle, + valsToSlash[2], + stakingtypes.Infraction_INFRACTION_DOWNTIME, + 3, // seq number is incremented since last try + ) + sendOnConsumerRecvOnProvider(s, bundle.Path, packet) + + // Call NextBlocks to update staking module val powers s.providerChain.NextBlock() s.providerChain.NextBlock() @@ -260,15 +264,6 @@ func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { for _, val := range valsToSlash { s.confirmValidatorJailed(val, true) } - s.Require().Equal(uint64(0), providerKeeper.GetThrottledPacketDataSize( - s.providerCtx(), senderBundles[0].Chain.ChainID)) - s.Require().Equal(uint64(0), providerKeeper.GetThrottledPacketDataSize( - s.providerCtx(), senderBundles[1].Chain.ChainID)) - s.Require().Equal(uint64(0), providerKeeper.GetThrottledPacketDataSize( - s.providerCtx(), senderBundles[2].Chain.ChainID)) - - // All global queue entries are gone too - s.Require().Empty(providerKeeper.GetAllGlobalSlashEntries(s.providerCtx())) } // TestPacketSpam confirms that the provider can handle a large number of @@ -322,17 +317,14 @@ func (s *CCVTestSuite) TestPacketSpam() { providerKeeper.OnRecvSlashPacket(s.providerCtx(), packet, *consumerPacketData.GetSlashPacketData()) } - // Execute block to handle packets in endblock + // Execute block s.providerChain.NextBlock() - // Confirm all packets are handled or dropped (queues empty) - s.Require().Equal(uint64(0), providerKeeper.GetThrottledPacketDataSize( - s.providerCtx(), firstBundle.Chain.ChainID)) - slashData, vscMData, _, _ := providerKeeper.GetAllThrottledPacketData( - s.providerCtx(), firstBundle.Chain.ChainID) - s.Require().Empty(slashData) - s.Require().Empty(vscMData) - s.Require().Empty(providerKeeper.GetAllGlobalSlashEntries(s.providerCtx())) + // Confirm 3 expected vals are jailed + for i := 0; i < 3; i++ { + val := s.providerChain.Vals.Validators[i] + s.confirmValidatorJailed(*val, true) + } } func (s *CCVTestSuite) TestDoubleSignDoesNotAffectThrottling() { @@ -379,15 +371,6 @@ func (s *CCVTestSuite) TestDoubleSignDoesNotAffectThrottling() { // Execute block to handle packets in endblock s.providerChain.NextBlock() - // Confirm all packets are dropped (queues empty) - s.Require().Equal(uint64(0), providerKeeper.GetThrottledPacketDataSize( - s.providerCtx(), firstBundle.Chain.ChainID)) - slashData, vscMData, _, _ := providerKeeper.GetAllThrottledPacketData( - s.providerCtx(), firstBundle.Chain.ChainID) - s.Require().Empty(slashData) - s.Require().Empty(vscMData) - s.Require().Empty(providerKeeper.GetAllGlobalSlashEntries(s.providerCtx())) - // Confirm that slash meter is not affected s.Require().Equal(providerKeeper.GetSlashMeterAllowance(s.providerCtx()), providerKeeper.GetSlashMeter(s.providerCtx())) @@ -417,155 +400,6 @@ func (s *CCVTestSuite) TestDoubleSignDoesNotAffectThrottling() { } } -// TestQueueOrdering validates that the ordering of slash packet entries -// in the global queue (relevant to a single chain) matches the ordering of slash packet -// data in the chain specific queues, even in the presence of packet spam. -// -// Note: The global queue is ordered by: time, then IBC sequence number, see GlobalSlashEntryKey. -// The chain specific queue is ordered by: IBC sequence number, see ThrottledPacketDataKey. -func (s *CCVTestSuite) TestQueueOrdering() { - // Setup ccv channels to all consumers - s.SetupAllCCVChannels() - - // Setup validator powers to be 25%, 25%, 25%, 25% - s.setupValidatorPowers() - - // Explicitly set params, initialize slash meter - providerKeeper := s.providerApp.GetProviderKeeper() - params := providerKeeper.GetParams(s.providerCtx()) - params.SlashMeterReplenishFraction = "0.05" // 5% total power can be jailed - providerKeeper.SetParams(s.providerCtx(), params) - providerKeeper.InitializeSlashMeter(s.providerCtx()) - - // The packets to be recv in a single block, ordered as they will be recv. - packets := []channeltypes.Packet{} - - firstBundle := s.getFirstBundle() - - // Slash first 3 but not 4th validator - s.setDefaultValSigningInfo(*s.providerChain.Vals.Validators[0]) - s.setDefaultValSigningInfo(*s.providerChain.Vals.Validators[1]) - s.setDefaultValSigningInfo(*s.providerChain.Vals.Validators[2]) - - // Track and increment ibc seq num for each packet, since these need to be unique. - ibcSeqNum := uint64(4) - - for ibcSeqNum < 504 { - // Increment ibc seq num for each packet (starting at 5) - ibcSeqNum++ - - // Instantiate a vsc matured packet every 10th packet - if ibcSeqNum%10 == 0 { - packets = append(packets, s.constructVSCMaturedPacketFromConsumer(firstBundle, ibcSeqNum)) - continue - } - // Else instantiate a slash packet - - valToJail := s.providerChain.Vals.Validators[ibcSeqNum%3] - packets = append(packets, s.constructSlashPacketFromConsumer(firstBundle, *valToJail, stakingtypes.Infraction_INFRACTION_DOWNTIME, ibcSeqNum)) - } - - // Recv 500 packets from consumer to provider in same block - for i, packet := range packets { - - consumerPacketData, err := provider.UnmarshalConsumerPacket(packet) // Same func used by provider's OnRecvPacket - s.Require().NoError(err) - - // Type depends on index packets were appended from above - if (i+5)%10 == 0 { - vscMaturedPacketData := consumerPacketData.GetVscMaturedPacketData() - vscMaturedPacketData.ValsetUpdateId = uint64(i + 1000) - providerKeeper.OnRecvVSCMaturedPacket(s.providerCtx(), packet, *vscMaturedPacketData) - } else { - // Set valset update id to be 2000 + index to assert ordering - slashPacketData := consumerPacketData.GetSlashPacketData() - slashPacketData.ValsetUpdateId = uint64(i + 2000) - // Set block height mapping so packet is not dropped - providerKeeper.SetValsetUpdateBlockHeight(s.providerCtx(), - slashPacketData.ValsetUpdateId, uint64(firstBundle.GetCtx().BlockHeight())) - providerKeeper.OnRecvSlashPacket(s.providerCtx(), packet, *slashPacketData) - } - } - - // Confirm that global queue has 450 packet entries (500 * 0.9) - allGlobalEntries := providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()) - s.Require().Equal(450, len(allGlobalEntries)) - - // Confirm that the chain specific queue has 450 slash packet data instances, and 50 vsc matured - slashPacketData, vscMaturedPacketData, _, _ := providerKeeper.GetAllThrottledPacketData( - s.providerCtx(), firstBundle.Chain.ChainID) - s.Require().Equal(450, len(slashPacketData)) - s.Require().Equal(50, len(vscMaturedPacketData)) - - // IBC seq numbers of recv slash packets range from 5 to 504. - // Confirm expected global queue ordering. - expectedSeqNum := uint64(5) - for _, globalEntry := range allGlobalEntries { - // entries should be ordered by ibc seq num starting at 5 - s.Require().Equal(expectedSeqNum, globalEntry.IbcSeqNum) - expectedSeqNum++ - if expectedSeqNum%10 == 0 { - // Skip over vsc matured packets - expectedSeqNum++ - } - } - - // Confirm expected chain specific queue ordering. - expectedVscId := uint64(2000) - for _, slashPacket := range slashPacketData { - // entries should be ordered by valset update id starting at 2000 - s.Require().Equal(expectedVscId, slashPacket.ValsetUpdateId) - expectedVscId++ - if (expectedVscId+5)%10 == 0 { - // Skip over vsc matured packets - expectedVscId++ - } - } - for idx, vscMaturedPacket := range vscMaturedPacketData { - // entries should be ordered by valset update id starting at 1005 - // and show up every 10 packets - expectedVscId = uint64(1005) + 10*uint64(idx) - s.Require().Equal(expectedVscId, vscMaturedPacket.ValsetUpdateId) - } - - // Execute endblock to handle packets in throttled manner - s.providerChain.NextBlock() - - // Confirm that only the first packet was handled - allGlobalEntries = providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()) - s.Require().Equal(449, len(allGlobalEntries)) - slashPacketData, vscMaturedPacketData, _, _ = providerKeeper.GetAllThrottledPacketData( - s.providerCtx(), firstBundle.Chain.ChainID) - s.Require().Equal(449, len(slashPacketData)) - // No VSC matured packets should be handled yet - s.Require().Equal(50, len(vscMaturedPacketData)) - - // Replenish frac is 0.05, so jailing %25 of the validators should result in a negative slash meter. - s.Require().True(providerKeeper.GetSlashMeter(s.providerCtx()).IsNegative()) - - // Confirm total power is now 3000 once updated by staking end blocker - s.providerChain.NextBlock() - totalPower := s.providerApp.GetTestStakingKeeper().GetLastTotalPower(s.providerCtx()) - s.Require().Equal(sdk.NewInt(3000), totalPower) - - // Now change replenish frac to 0.67 and fully replenish the meter. - params.SlashMeterReplenishFraction = "0.67" - providerKeeper.SetParams(s.providerCtx(), params) - providerKeeper.InitializeSlashMeter(s.providerCtx()) - - // Execute endblock to handle packets (remaining packets are relevant to 2/3 of the validators) - // so the current replenish frac should be enough to handle all packets this block. - s.providerChain.NextBlock() - - // Confirm both queues are now empty, meaning every packet was handled. - allGlobalEntries = providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()) - s.Require().Equal(0, len(allGlobalEntries)) - slashPacketData, vscMaturedPacketData, _, _ = providerKeeper.GetAllThrottledPacketData( - s.providerCtx(), firstBundle.Chain.ChainID) - s.Require().Equal(0, len(slashPacketData)) - s.Require().Equal(0, len(vscMaturedPacketData)) -} - // TestSlashingSmallValidators tests that multiple slash packets from validators with small // power can be handled by the provider chain in a non-throttled manner. func (s *CCVTestSuite) TestSlashingSmallValidators() { @@ -645,59 +479,6 @@ func (s *CCVTestSuite) TestSlashMeterAllowanceChanges() { s.Require().Equal(int64(1200), providerKeeper.GetSlashMeterAllowance(s.providerCtx()).Int64()) } -// TestSlashSameValidator tests the edge case that that the total slashed validator power -// queued up for a single block exceeds the slash meter allowance, -// but some of the slash packets are for the same validator, and therefore some packets -// will be applied to a validator that is already jailed but still not unbonded (ie. still slashable). -func (s *CCVTestSuite) TestSlashSameValidator() { - s.SetupAllCCVChannels() - - // Setup 4 validators with 25% of the total power each. - s.setupValidatorPowers() - - providerKeeper := s.providerApp.GetProviderKeeper() - - // Set replenish fraction to 1.0 so that all sent packets should handled immediately (no throttling) - params := providerKeeper.GetParams(s.providerCtx()) - params.SlashMeterReplenishFraction = fullSlashMeterString // needs to be const for linter - providerKeeper.SetParams(s.providerCtx(), params) - providerKeeper.InitializeSlashMeter(s.providerCtx()) - - // Send a downtime and double-sign slash packet for 3/4 validators - // This will have a total slashing power of 150% total power. - tmval1 := s.providerChain.Vals.Validators[1] - tmval2 := s.providerChain.Vals.Validators[2] - tmval3 := s.providerChain.Vals.Validators[3] - s.setDefaultValSigningInfo(*tmval1) - s.setDefaultValSigningInfo(*tmval2) - s.setDefaultValSigningInfo(*tmval3) - - packets := []channeltypes.Packet{ - s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval1, stakingtypes.Infraction_INFRACTION_DOWNTIME, 1), - s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval2, stakingtypes.Infraction_INFRACTION_DOWNTIME, 2), - s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval3, stakingtypes.Infraction_INFRACTION_DOWNTIME, 3), - s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval1, stakingtypes.Infraction_INFRACTION_DOWNTIME, 4), - s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval2, stakingtypes.Infraction_INFRACTION_DOWNTIME, 5), - s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval3, stakingtypes.Infraction_INFRACTION_DOWNTIME, 6), - } - - // Recv and queue all slash packets. - for _, packet := range packets { - consumerPacketData, err := provider.UnmarshalConsumerPacket(packet) // Same func used by provider's OnRecvPacket - s.Require().NoError(err) - providerKeeper.OnRecvSlashPacket(s.providerCtx(), packet, *consumerPacketData.GetSlashPacketData()) - } - - // We should have 6 pending slash packet entries queued. - s.Require().Len(providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()), 6) - - // Call next block to process all pending slash packets in end blocker. - s.providerChain.NextBlock() - - // All slash packets should have been handled immediately, even though they totaled to 150% of total power. - s.Require().Len(providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()), 0) -} - // Similar to TestSlashSameValidator, but 100% of val power is jailed a single block, // and in the first packets recv for that block. // This edge case should not occur in practice, but is useful to validate that @@ -749,17 +530,7 @@ func (s CCVTestSuite) TestSlashAllValidators() { //nolint:govet // this is a tes providerKeeper.OnRecvSlashPacket(s.providerCtx(), packet, *consumerPacketData.GetSlashPacketData()) } - // We should have 24 pending slash packet entries queued. - s.Require().Len(providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()), 24) - - // Call next block to process all pending slash packets in end blocker. - s.providerChain.NextBlock() - - // All slash packets should have been handled immediately, - // even though the first 4 packets jailed 100% of the total power. - s.Require().Len(providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()), 0) - - // Sanity check that all validators are jailed. + // Check that all validators are jailed. for _, val := range s.providerChain.Vals.Validators { // Do not check power, since val power is not yet updated by staking endblocker. s.confirmValidatorJailed(*val, false) @@ -769,148 +540,6 @@ func (s CCVTestSuite) TestSlashAllValidators() { //nolint:govet // this is a tes // "applying the validator changes would result in empty set". } -func (s *CCVTestSuite) TestLeadingVSCMaturedAreDequeued() { - s.SetupAllCCVChannels() - providerKeeper := s.providerApp.GetProviderKeeper() - - // Queue up 50 vsc matured packets for each consumer - for _, bundle := range s.consumerBundles { - for i := 0; i < 50; i++ { - ibcSeqNum := uint64(i) - packet := s.constructVSCMaturedPacketFromConsumer(*bundle, ibcSeqNum) - packetData := ccvtypes.ConsumerPacketData{} - ccvtypes.ModuleCdc.MustUnmarshalJSON(packet.GetData(), &packetData) - providerKeeper.OnRecvVSCMaturedPacket(s.providerCtx(), - packet, *packetData.GetVscMaturedPacketData()) - } - } - - // Queue up 50 slash packets for each consumer - for _, bundle := range s.consumerBundles { - for i := 50; i < 100; i++ { - ibcSeqNum := uint64(i) - packet := s.constructSlashPacketFromConsumer(*bundle, - *s.providerChain.Vals.Validators[0], stakingtypes.Infraction_INFRACTION_DOWNTIME, ibcSeqNum) - consumerPacketData, err := provider.UnmarshalConsumerPacket(packet) // Same func used by provider's OnRecvPacket - s.Require().NoError(err) - providerKeeper.OnRecvSlashPacket(s.providerCtx(), packet, *consumerPacketData.GetSlashPacketData()) - } - } - - // Queue up another 50 vsc matured packets for each consumer - for _, bundle := range s.consumerBundles { - for i := 100; i < 150; i++ { - ibcSeqNum := uint64(i) - packet := s.constructVSCMaturedPacketFromConsumer(*bundle, ibcSeqNum) - packetData := ccvtypes.ConsumerPacketData{} - ccvtypes.ModuleCdc.MustUnmarshalJSON(packet.GetData(), &packetData) - providerKeeper.OnRecvVSCMaturedPacket(s.providerCtx(), - packet, *packetData.GetVscMaturedPacketData()) - } - } - - // Confirm queue size is 150 for each consumer-specific queue. - for _, bundle := range s.consumerBundles { - s.Require().Equal(uint64(150), - providerKeeper.GetThrottledPacketDataSize(s.providerCtx(), bundle.Chain.ChainID)) - } - // Confirm global queue size is 50 * 5 (50 slash packets for each of 5 consumers) - globalEntries := providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()) - s.Require().Equal(len(globalEntries), 50*5) - - // Set slash meter to negative value to not allow any slash packets to be handled. - providerKeeper.SetSlashMeter(s.providerCtx(), sdk.NewInt(-1)) - - // Set replenish time candidate so that no replenishment happens next block. - providerKeeper.SetSlashMeterReplenishTimeCandidate(s.providerCtx()) - - // Execute end blocker to dequeue only the leading vsc matured packets. - // Note we must call the end blocker three times, since only 100 vsc matured packets can be handled - // each block, and we have 5*50=250 total. - s.providerChain.NextBlock() - s.providerChain.NextBlock() - s.providerChain.NextBlock() - - // Confirm queue size is 100 for each consumer-specific queue (50 leading vsc matured are dequeued). - for _, bundle := range s.consumerBundles { - s.Require().Equal(uint64(100), - providerKeeper.GetThrottledPacketDataSize(s.providerCtx(), bundle.Chain.ChainID)) - } - - // No slash packets handled, global slash queue is same size as last block. - globalEntries = providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()) - s.Require().Equal(len(globalEntries), 50*5) - - // No slash packets handled even if we call end blocker a couple more times. - s.providerChain.NextBlock() - s.providerChain.NextBlock() - globalEntries = providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()) - s.Require().Equal(len(globalEntries), 50*5) -} - -// TestVscMaturedHandledPerBlockLimit tests that only 100 vsc matured packets are handled per block, -// specifically from HandleThrottleQueues(). -// -// Note the vsc matured per block limit is also tested in, TestLeadingVSCMaturedAreDequeued, -// specifically in the context of HandleLeadingVSCMaturedPackets(). -func (s *CCVTestSuite) TestVscMaturedHandledPerBlockLimit() { - s.SetupAllCCVChannels() - providerKeeper := s.providerApp.GetProviderKeeper() - - // Set replenish fraction to 1.0 so that all sent packets should be handled immediately (no jail throttling) - params := providerKeeper.GetParams(s.providerCtx()) - params.SlashMeterReplenishFraction = fullSlashMeterString // needs to be const for linter - providerKeeper.SetParams(s.providerCtx(), params) - providerKeeper.InitializeSlashMeter(s.providerCtx()) - - // Queue up 100 vsc matured packets for each consumer - for _, bundle := range s.consumerBundles { - for i := 0; i < 100; i++ { - ibcSeqNum := uint64(i) - packet := s.constructVSCMaturedPacketFromConsumer(*bundle, ibcSeqNum) - packetData := ccvtypes.ConsumerPacketData{} - ccvtypes.ModuleCdc.MustUnmarshalJSON(packet.GetData(), &packetData) - providerKeeper.OnRecvVSCMaturedPacket(s.providerCtx(), - packet, *packetData.GetVscMaturedPacketData()) - } - } - - // Queue up 50 slash packets for each consumer, with new IBC sequence numbers - for _, bundle := range s.consumerBundles { - for i := 100; i < 150; i++ { - ibcSeqNum := uint64(i) - packet := s.constructSlashPacketFromConsumer(*bundle, - *s.providerChain.Vals.Validators[0], stakingtypes.Infraction_INFRACTION_DOWNTIME, ibcSeqNum) - consumerPacketData, err := provider.UnmarshalConsumerPacket(packet) // Same func used by provider's OnRecvPacket - s.Require().NoError(err) - providerKeeper.OnRecvSlashPacket(s.providerCtx(), packet, *consumerPacketData.GetSlashPacketData()) - } - } - - // Confirm queue size is 150 for each consumer-specific queue. - for _, bundle := range s.consumerBundles { - s.Require().Equal(uint64(150), - providerKeeper.GetThrottledPacketDataSize(s.providerCtx(), bundle.Chain.ChainID)) - } - // Confirm global queue size is 50 * 5 (50 slash packets for each of 5 consumers) - globalEntries := providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()) - s.Require().Equal(len(globalEntries), 50*5) - - // Note even though there is no jail throttling active, slash packets will not be handled until - // all of the leading vsc matured packets are handled first. This should take 5 blocks. - for i := 0; i < 5; i++ { - s.providerChain.NextBlock() - s.Require().Len(providerKeeper.GetAllGlobalSlashEntries(s.providerCtx()), 250) // global entries remain same size - } - - // Set signing info for val to be jailed, preventing panic - s.setDefaultValSigningInfo(*s.providerChain.Vals.Validators[0]) - - // Now we execute one more block and all 250 of the slash packets should be handled. - s.providerChain.NextBlock() - s.Require().Empty(providerKeeper.GetAllGlobalSlashEntries(s.providerCtx())) // empty global entries = all slash packets handled -} - func (s *CCVTestSuite) confirmValidatorJailed(tmVal tmtypes.Validator, checkPower bool) { sdkVal, found := s.providerApp.GetTestStakingKeeper().GetValidator( s.providerCtx(), sdk.ValAddress(tmVal.Address)) diff --git a/tests/integration/throttle_retry.go b/tests/integration/throttle_retry.go index ae15aac977..4b445d5d25 100644 --- a/tests/integration/throttle_retry.go +++ b/tests/integration/throttle_retry.go @@ -1,32 +1,25 @@ package integration import ( + "time" + channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - provider "github.com/cosmos/interchain-security/v3/x/ccv/provider" - providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) -// TestSlashRetries tests the throttling v2 retry logic. Without provider changes, -// the consumer will queue up a slash packet, the provider will return a v1 result, -// and the consumer will never need to retry. -// -// Once provider changes are made (slash packet queuing is removed), the consumer may retry packets -// via new result acks from the provider. -// -// TODO: This test will need updating once provider changes are made. +// TestSlashRetries tests the throttling v2 retry logic at an integration level. func (s *CCVTestSuite) TestSlashRetries() { s.SetupAllCCVChannels() + s.SendEmptyVSCPacket() // Establish ccv channel s.setupValidatorPowers() // // Provider setup // providerKeeper := s.providerApp.GetProviderKeeper() - providerModule := provider.NewAppModule(&providerKeeper, s.providerApp.GetSubspace(providertypes.ModuleName)) // Initialize slash meter providerKeeper.InitializeSlashMeter(s.providerCtx()) // Assert that we start out with no jailings @@ -35,13 +28,24 @@ func (s *CCVTestSuite) TestSlashRetries() { for _, val := range vals { s.Require().False(val.IsJailed()) } + + // We jail two different validators in this test, referred to as val1 and val2. + // This may or may not correspond to the indexes 1 and 2 in various validator slices, + // depending on how the slice is constructed. + + // The s.providerChain.Vals.Validators set will change depending on jailings, + // so we cache these two val objects now to be the canonical val1 and val2. + tmval1 := s.providerChain.Vals.Validators[1] + tmval2 := s.providerChain.Vals.Validators[2] + // Setup signing info for jailings - s.setDefaultValSigningInfo(*s.providerChain.Vals.Validators[1]) + s.setDefaultValSigningInfo(*tmval1) + s.setDefaultValSigningInfo(*tmval2) // // Consumer setup // - consumerKeeper := s.consumerApp.GetConsumerKeeper() + consumerKeeper := s.getFirstBundle().App.GetConsumerKeeper() // Assert no slash record exists _, found := consumerKeeper.GetSlashRecord(s.consumerCtx()) s.Require().False(found) @@ -50,101 +54,166 @@ func (s *CCVTestSuite) TestSlashRetries() { // Test section: See FSM explanation in throttle_retry.go // - // Construct a mock slash packet from consumer - tmval1 := s.providerChain.Vals.Validators[1] - packet1 := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval1, stakingtypes.Infraction_INFRACTION_DOWNTIME, 1) + // Construct a slash packet + packet1, data := s.constructSlashPacketFromConsumerWithData( + s.getFirstBundle(), *tmval1, stakingtypes.Infraction_INFRACTION_DOWNTIME, 1) - // Mock the sending of the packet on consumer + // Append packet to be sent by consumer consumerKeeper.AppendPendingPacket(s.consumerCtx(), ccvtypes.SlashPacket, &ccvtypes.ConsumerPacketData_SlashPacketData{ - SlashPacketData: &ccvtypes.SlashPacketData{}, + SlashPacketData: &data, }, ) - consumerKeeper.UpdateSlashRecordOnSend(s.consumerCtx()) + + sendTime := s.consumerCtx().BlockTime() + + // Advance block on consumer to send pending packet + s.getFirstBundle().Chain.NextBlock() + + // Confirm packet was sent via state that's updated on send slashRecord, found := consumerKeeper.GetSlashRecord(s.consumerCtx()) s.Require().True(found) s.Require().True(slashRecord.WaitingOnReply) + s.Require().NotZero(slashRecord.SendTime) + s.Require().Equal(sendTime, slashRecord.SendTime) s.Require().Len(consumerKeeper.GetPendingPackets(s.consumerCtx()), 1) - // Recv packet on provider and assert ack. Provider should return v1 result. - ack := providerModule.OnRecvPacket(s.providerCtx(), packet1, nil) - expectedv1Ack := channeltypes.NewResultAcknowledgement([]byte(ccvtypes.V1Result)) - s.Require().Equal(expectedv1Ack.Acknowledgement(), ack.Acknowledgement()) + // Packet sending blocked until provider returns slash packet handled ack + s.Require().False(consumerKeeper.PacketSendingPermitted(s.consumerCtx())) + + // Recv packet on provider. + relayAllCommittedPackets(s, s.consumerChain, s.path, ccvtypes.ConsumerPortID, s.path.EndpointA.ChannelID, 1) // Couple blocks pass on provider for provider staking keeper to process jailing s.providerChain.NextBlock() s.providerChain.NextBlock() // Default slash meter replenish fraction is 0.05, so packet should be handled on provider. - vals = s.providerApp.GetTestStakingKeeper().GetAllValidators(s.providerCtx()) - s.Require().True(vals[1].IsJailed()) + stakingVal1 := s.mustGetStakingValFromTmVal(*tmval1) + s.Require().True(stakingVal1.IsJailed()) s.Require().Equal(int64(0), - s.providerApp.GetTestStakingKeeper().GetLastValidatorPower(s.providerCtx(), vals[1].GetOperator())) - s.Require().Equal(uint64(0), providerKeeper.GetThrottledPacketDataSize(s.providerCtx(), - s.getFirstBundle().Chain.ChainID)) + s.providerApp.GetTestStakingKeeper().GetLastValidatorPower(s.providerCtx(), stakingVal1.GetOperator())) // Now slash meter should be negative on provider s.Require().True(s.providerApp.GetProviderKeeper().GetSlashMeter(s.providerCtx()).IsNegative()) // Apply ack back on consumer - ackForConsumer := expectedv1Ack - err := consumerKeeper.OnAcknowledgementPacket(s.consumerCtx(), packet1, ackForConsumer) + expectedAck := channeltypes.NewResultAcknowledgement([]byte(ccvtypes.SlashPacketHandledResult)) + err := s.getFirstBundle().Path.EndpointA.AcknowledgePacket(packet1, expectedAck.Acknowledgement()) s.Require().NoError(err) - // Slash record should have been deleted, head of pending packets should have been popped - // Since provider has handled the packet + // Slash record should have been deleted, head of pending packets should have been popped, + // since provider has handled the packet. _, found = consumerKeeper.GetSlashRecord(s.consumerCtx()) s.Require().False(found) s.Require().Empty(consumerKeeper.GetPendingPackets(s.consumerCtx())) + // Packet sending should now be unblocked + s.Require().True(consumerKeeper.PacketSendingPermitted(s.consumerCtx())) + // pass two blocks on provider and consumer for good measure s.providerChain.NextBlock() s.providerChain.NextBlock() s.consumerChain.NextBlock() s.consumerChain.NextBlock() - // Construct and mock the sending of a second packet on consumer - tmval2 := s.providerChain.Vals.Validators[2] - packet2 := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval2, stakingtypes.Infraction_INFRACTION_DOWNTIME, 1) - + // Have consumer queue a new slash packet for a different validator. + packet2, data := s.constructSlashPacketFromConsumerWithData( + s.getFirstBundle(), *tmval2, stakingtypes.Infraction_INFRACTION_DOWNTIME, 1) consumerKeeper.AppendPendingPacket(s.consumerCtx(), ccvtypes.SlashPacket, &ccvtypes.ConsumerPacketData_SlashPacketData{ - SlashPacketData: &ccvtypes.SlashPacketData{}, + SlashPacketData: &data, }, ) - consumerKeeper.UpdateSlashRecordOnSend(s.consumerCtx()) + + // Advance block on consumer to send pending packet + sendTime = s.consumerCtx().BlockTime() + s.getFirstBundle().Chain.NextBlock() + + // Confirm packet was sent via state that's updated on send slashRecord, found = consumerKeeper.GetSlashRecord(s.consumerCtx()) s.Require().True(found) s.Require().True(slashRecord.WaitingOnReply) + s.Require().NotZero(slashRecord.SendTime) + s.Require().Equal(sendTime, slashRecord.SendTime) s.Require().Len(consumerKeeper.GetPendingPackets(s.consumerCtx()), 1) - // Recv 2nd slash packet on provider for different validator. - // Provider should return the same v1 result ack even tho the packet was queued. - ack = providerModule.OnRecvPacket(s.providerCtx(), packet2, nil) - expectedv1Ack = channeltypes.NewResultAcknowledgement([]byte(ccvtypes.V1Result)) - s.Require().Equal(expectedv1Ack.Acknowledgement(), ack.Acknowledgement()) + // Packet sending blocked until provider returns slash packet handled ack + s.Require().False(consumerKeeper.PacketSendingPermitted(s.consumerCtx())) + + // Recv 2nd packet on provider. + relayAllCommittedPackets(s, s.consumerChain, s.path, ccvtypes.ConsumerPortID, s.path.EndpointA.ChannelID, 1) // Couple blocks pass on provider for staking keeper to process jailings s.providerChain.NextBlock() s.providerChain.NextBlock() - // Val shouldn't be jailed on provider. Slash packet was queued - s.Require().False(vals[2].IsJailed()) + // Val 2 shouldn't be jailed on provider. Slash packet should have been bounced. + stakingVal2 := s.mustGetStakingValFromTmVal(*tmval2) + s.Require().False(stakingVal2.IsJailed()) s.Require().Equal(int64(1000), - providerStakingKeeper.GetLastValidatorPower(s.providerCtx(), vals[2].GetOperator())) - s.Require().Equal(uint64(1), providerKeeper.GetThrottledPacketDataSize(s.providerCtx(), - s.getFirstBundle().Chain.ChainID)) + providerStakingKeeper.GetLastValidatorPower(s.providerCtx(), stakingVal2.GetOperator())) // Apply ack on consumer - ackForConsumer = expectedv1Ack - err = consumerKeeper.OnAcknowledgementPacket(s.consumerCtx(), packet2, ackForConsumer) + expectedAck = channeltypes.NewResultAcknowledgement([]byte(ccvtypes.SlashPacketBouncedResult)) + err = s.getFirstBundle().Path.EndpointA.AcknowledgePacket(packet2, expectedAck.Acknowledgement()) s.Require().NoError(err) - // TODO: when provider changes are made, slashRecord.WaitingOnReply should have been updated to false on consumer. Slash Packet will still be in consumer's pending packets queue. + // Now consumer should have updated it's slash record on receipt of bounce ack + slashRecord, found = consumerKeeper.GetSlashRecord(s.consumerCtx()) + s.Require().True(found) + s.Require().False(slashRecord.WaitingOnReply) + // Packet still at head of queue + s.Require().Len(consumerKeeper.GetPendingPackets(s.consumerCtx()), 1) + + // Packet sending should still be blocked, WaitingOnReply is false, + // but retry delay hasn't passed yet. + s.Require().False(consumerKeeper.PacketSendingPermitted(s.consumerCtx())) + + // IBC testing framework doesn't have a way to advance time, + // so we manually mutate send time in the slash record to be in the past. + slashRecord.SendTime = slashRecord.SendTime.Add(-time.Hour - time.Minute) + consumerKeeper.SetSlashRecord(s.consumerCtx(), slashRecord) + + s.Require().True(consumerKeeper.PacketSendingPermitted(s.consumerCtx())) + + // Set slash meter on provider to positive value, + // now allowing handling of the slash packet + providerKeeper.InitializeSlashMeter(s.providerCtx()) + + // Advance block on consumer, now consumer should retry the sending of the slash packet. + sendTime = s.consumerCtx().BlockTime() + s.getFirstBundle().Chain.NextBlock() + + // Confirm packet was sent via state that's updated on send + slashRecord, found = consumerKeeper.GetSlashRecord(s.consumerCtx()) + s.Require().True(found) + s.Require().True(slashRecord.WaitingOnReply) + s.Require().NotZero(slashRecord.SendTime) + s.Require().Equal(sendTime, slashRecord.SendTime) + s.Require().Len(consumerKeeper.GetPendingPackets(s.consumerCtx()), 1) + + // Recv retried packet on provider. + relayAllCommittedPackets(s, s.consumerChain, s.path, ccvtypes.ConsumerPortID, s.path.EndpointA.ChannelID, 1) + + // Couple blocks pass on provider for provider staking keeper to process jailing + s.providerChain.NextBlock() + s.providerChain.NextBlock() + + // Provider should have now jailed val 2 + stakingVal2 = s.mustGetStakingValFromTmVal(*tmval2) + s.Require().True(stakingVal2.IsJailed()) + s.Require().Equal(int64(0), + s.providerApp.GetTestStakingKeeper().GetLastValidatorPower(s.providerCtx(), stakingVal2.GetOperator())) + + // Apply ack on consumer + expectedAck = channeltypes.NewResultAcknowledgement([]byte(ccvtypes.SlashPacketHandledResult)) + err = s.getFirstBundle().Path.EndpointA.AcknowledgePacket(packet2, expectedAck.Acknowledgement()) + s.Require().NoError(err) - // Slash record should have been deleted, head of pending packets should have been popped - // Since provider has handled the packet + // Consumer state is properly cleared again _, found = consumerKeeper.GetSlashRecord(s.consumerCtx()) s.Require().False(found) s.Require().Empty(consumerKeeper.GetPendingPackets(s.consumerCtx())) + s.Require().True(consumerKeeper.PacketSendingPermitted(s.consumerCtx())) } diff --git a/testutil/integration/debug_test.go b/testutil/integration/debug_test.go index 6b9415440e..ab1c78af7f 100644 --- a/testutil/integration/debug_test.go +++ b/testutil/integration/debug_test.go @@ -181,10 +181,6 @@ func TestDoubleSignDoesNotAffectThrottling(t *testing.T) { runCCVTestByName(t, "TestDoubleSignDoesNotAffectThrottling") } -func TestQueueOrdering(t *testing.T) { - runCCVTestByName(t, "TestQueueOrdering") -} - func TestSlashingSmallValidators(t *testing.T) { runCCVTestByName(t, "TestSlashingSmallValidators") } @@ -193,22 +189,10 @@ func TestSlashMeterAllowanceChanges(t *testing.T) { runCCVTestByName(t, "TestSlashMeterAllowanceChanges") } -func TestSlashSameValidator(t *testing.T) { - runCCVTestByName(t, "TestSlashSameValidator") -} - func TestSlashAllValidators(t *testing.T) { runCCVTestByName(t, "TestSlashAllValidators") } -func TestLeadingVSCMaturedAreDequeued(t *testing.T) { - runCCVTestByName(t, "TestLeadingVSCMaturedAreDequeued") -} - -func TestVscMaturedHandledPerBlockLimit(t *testing.T) { - runCCVTestByName(t, "TestVscMaturedHandledPerBlockLimit") -} - // // Unbonding tests // diff --git a/testutil/keeper/unit_test_helpers.go b/testutil/keeper/unit_test_helpers.go index b58d6d2471..77b4df9c10 100644 --- a/testutil/keeper/unit_test_helpers.go +++ b/testutil/keeper/unit_test_helpers.go @@ -254,15 +254,6 @@ func TestProviderStateIsCleanedAfterConsumerChainIsStopped(t *testing.T, ctx sdk require.Empty(t, providerKeeper.GetAllValidatorsByConsumerAddr(ctx, &expectedChainID)) require.Empty(t, providerKeeper.GetAllKeyAssignmentReplacements(ctx, expectedChainID)) require.Empty(t, providerKeeper.GetAllConsumerAddrsToPrune(ctx, expectedChainID)) - - allGlobalEntries := providerKeeper.GetAllGlobalSlashEntries(ctx) - for _, entry := range allGlobalEntries { - require.NotEqual(t, expectedChainID, entry.ConsumerChainID) - } - - slashPacketData, vscMaturedPacketData, _, _ := providerKeeper.GetAllThrottledPacketData(ctx, expectedChainID) - require.Empty(t, slashPacketData) - require.Empty(t, vscMaturedPacketData) } func GetTestConsumerAdditionProp() *providertypes.ConsumerAdditionProposal { diff --git a/x/ccv/provider/client/cli/query.go b/x/ccv/provider/client/cli/query.go index 1240e242f0..80746ff5d2 100644 --- a/x/ccv/provider/client/cli/query.go +++ b/x/ccv/provider/client/cli/query.go @@ -31,7 +31,6 @@ func NewQueryCmd() *cobra.Command { cmd.AddCommand(CmdConsumerValidatorKeyAssignment()) cmd.AddCommand(CmdProviderValidatorKey()) cmd.AddCommand(CmdThrottleState()) - cmd.AddCommand(CmdThrottledConsumerPacketData()) cmd.AddCommand(CmdRegisteredConsumerRewardDenoms()) return cmd @@ -286,42 +285,6 @@ $ %s query provider throttle-state return cmd } -func CmdThrottledConsumerPacketData() *cobra.Command { - cmd := &cobra.Command{ - Use: "throttled-consumer-packet-data [chainid]", - Short: "Query pending VSCMatured and slash packet data for a consumer chainId", - Long: strings.TrimSpace( - fmt.Sprintf(`Returns the current pending VSCMatured and slash packet data instances for a consumer chainId. - Queue is ordered by ibc sequence number. -Example: -$ %s query provider throttled-consumer-packet-data foochain -`, - version.AppName, - ), - ), - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) (err error) { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - queryClient := types.NewQueryClient(clientCtx) - - req := &types.QueryThrottledConsumerPacketDataRequest{ChainId: args[0]} - res, err := queryClient.QueryThrottledConsumerPacketData(cmd.Context(), req) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} - func CmdRegisteredConsumerRewardDenoms() *cobra.Command { cmd := &cobra.Command{ Use: "registered-consumer-reward-denoms", diff --git a/x/ccv/provider/keeper/grpc_query.go b/x/ccv/provider/keeper/grpc_query.go index 2b522ea9ef..881a6b1a98 100644 --- a/x/ccv/provider/keeper/grpc_query.go +++ b/x/ccv/provider/keeper/grpc_query.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "fmt" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -148,98 +147,14 @@ func (k Keeper) QueryThrottleState(goCtx context.Context, req *types.QueryThrott meter := k.GetSlashMeter(ctx) allowance := k.GetSlashMeterAllowance(ctx) candidate := k.GetSlashMeterReplenishTimeCandidate(ctx) // always UTC - packets := []*types.ThrottledSlashPacket{} - - // iterate global slash entries from all consumer chains - // and fetch corresponding SlashPacketData from the per-chain throttled packet data queue - allGlobalEntries := k.GetAllGlobalSlashEntries(ctx) - - for _, entry := range allGlobalEntries { - // Obtain slash packet data instance for the given global entry - slashData, found := k.getSlashPacketData(ctx, entry.ConsumerChainID, entry.IbcSeqNum) - if !found { - // silently skip over invalid data - continue - } - - packets = append(packets, &types.ThrottledSlashPacket{ - GlobalEntry: entry, - Data: slashData, - }) - } return &types.QueryThrottleStateResponse{ SlashMeter: meter.Int64(), SlashMeterAllowance: allowance.Int64(), NextReplenishCandidate: candidate, - Packets: packets, - }, nil -} - -func (k Keeper) QueryThrottledConsumerPacketData(goCtx context.Context, req *types.QueryThrottledConsumerPacketDataRequest) (*types.QueryThrottledConsumerPacketDataResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "empty request") - } - - if req.ChainId == "" { - return nil, status.Error(codes.InvalidArgument, "invalid chain-id") - } - - ctx := sdk.UnwrapSDKContext(goCtx) - if _, found := k.GetChainToChannel(ctx, req.ChainId); !found { - return nil, status.Error(codes.InvalidArgument, "invalid chain-id") - } - - packetDataInstances := []types.ThrottledPacketDataWrapper{} - _, _, rawOrderedData, _ := k.GetAllThrottledPacketData(ctx, req.ChainId) - - for _, raw := range rawOrderedData { - switch data := raw.(type) { - case ccvtypes.SlashPacketData: - w := &types.ThrottledPacketDataWrapper_SlashPacket{SlashPacket: &data} - packetDataInstances = append(packetDataInstances, types.ThrottledPacketDataWrapper{ - Data: w, - }) - case ccvtypes.VSCMaturedPacketData: - w := &types.ThrottledPacketDataWrapper_VscMaturedPacket{VscMaturedPacket: &data} - packetDataInstances = append(packetDataInstances, types.ThrottledPacketDataWrapper{ - Data: w, - }) - default: - k.Logger(ctx).Error(fmt.Sprintf("unexpected packet data type: %T", data)) - } - } - - return &types.QueryThrottledConsumerPacketDataResponse{ - ChainId: req.ChainId, - Size_: k.GetThrottledPacketDataSize(ctx, req.ChainId), - PacketDataInstances: packetDataInstances, }, nil } -// getSlashPacketData fetches a slash packet data from the store using consumerChainId and ibcSeqNum (direct access) -// If the returned bytes do not unmarshal to SlashPacketData, the data is considered not found. -func (k Keeper) getSlashPacketData(ctx sdk.Context, consumerChainID string, ibcSeqNum uint64) (ccvtypes.SlashPacketData, bool) { - store := ctx.KVStore(k.storeKey) - bz := store.Get(types.ThrottledPacketDataKey(consumerChainID, ibcSeqNum)) - if len(bz) == 0 { - return ccvtypes.SlashPacketData{}, false - } - - if bz[0] != slashPacketData { - return ccvtypes.SlashPacketData{}, false - } - - packet := ccvtypes.SlashPacketData{} - err := packet.Unmarshal(bz[1:]) - if err != nil { - // If the data cannot be unmarshaled, it is considered not found - return ccvtypes.SlashPacketData{}, false - } - - return packet, true -} - func (k Keeper) QueryRegisteredConsumerRewardDenoms(goCtx context.Context, req *types.QueryRegisteredConsumerRewardDenomsRequest) (*types.QueryRegisteredConsumerRewardDenomsResponse, error) { if req == nil { return nil, status.Error(codes.InvalidArgument, "empty request") diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 7e4eb557f7..80ed8af54d 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -214,21 +214,6 @@ func (k Keeper) StopConsumerChain(ctx sdk.Context, chainID string, closeChan boo k.DeleteUnbondingOpIndex(ctx, chainID, unbondingOpsIndex.VscId) } - // Remove any existing throttling related entries from the global queue, - // only for this consumer. - // Note: this call panics if the throttling state is invalid - k.DeleteGlobalSlashEntriesForConsumer(ctx, chainID) - - if k.GetThrottledPacketDataSize(ctx, chainID) > 0 { - k.Logger(ctx).Info("There are throttled slash and/or vsc matured packet data instances queued,"+ - " from a consumer that is being removed. This packet data will be thrown out!", "chainID", chainID) - } - - // Remove all throttled slash packets and vsc matured packets queued for this consumer. - // Note: queued VSC matured packets can be safely removed from the per-chain queue, - // since all unbonding operations for this consumer are release above. - k.DeleteThrottledPacketDataForConsumer(ctx, chainID) - k.Logger(ctx).Info("consumer chain removed from provider", "chainID", chainID) return nil diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index e6b8573e24..f49b6d3b11 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -18,7 +18,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" - cryptoutil "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" providerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" @@ -525,28 +524,6 @@ func TestStopConsumerChain(t *testing.T) { }, expErr: true, }, - { - description: "valid stop of consumer chain, throttle related queues are cleaned", - setup: func(ctx sdk.Context, providerKeeper *providerkeeper.Keeper, mocks testkeeper.MockedKeepers) { - testkeeper.SetupForStoppingConsumerChain(t, ctx, providerKeeper, mocks) - - // assert mocks for expected calls to `StopConsumerChain` when closing the underlying channel - gomock.InOrder(testkeeper.GetMocksForStopConsumerChainWithCloseChannel(ctx, &mocks)...) - - providerKeeper.QueueGlobalSlashEntry(ctx, providertypes.NewGlobalSlashEntry( - ctx.BlockTime(), "chainID", 1, cryptoutil.NewCryptoIdentityFromIntSeed(90).ProviderConsAddress())) - - err := providerKeeper.QueueThrottledSlashPacketData(ctx, "chainID", 1, testkeeper.GetNewSlashPacketData()) - if err != nil { - t.Fatal(err) - } - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chainID", 2, testkeeper.GetNewVSCMaturedPacketData()) - if err != nil { - t.Fatal(err) - } - }, - expErr: false, - }, { description: "valid stop of consumer chain, all mock calls hit", setup: func(ctx sdk.Context, providerKeeper *providerkeeper.Keeper, mocks testkeeper.MockedKeepers) { diff --git a/x/ccv/provider/keeper/relay.go b/x/ccv/provider/keeper/relay.go index d63594dad1..63ea8dd9d5 100644 --- a/x/ccv/provider/keeper/relay.go +++ b/x/ccv/provider/keeper/relay.go @@ -17,7 +17,7 @@ import ( ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ) -// OnRecvVSCMaturedPacket handles a VSCMatured packet +// OnRecvVSCMaturedPacket handles a VSCMatured packet and returns a no-op result ack. func (k Keeper) OnRecvVSCMaturedPacket( ctx sdk.Context, packet channeltypes.Packet, @@ -34,12 +34,9 @@ func (k Keeper) OnRecvVSCMaturedPacket( panic(fmt.Errorf("VSCMaturedPacket received on unknown channel %s", packet.DestinationChannel)) } - if err := k.QueueThrottledVSCMaturedPacketData(ctx, chainID, packet.Sequence, data); err != nil { - return ccv.NewErrorAcknowledgementWithLog(ctx, fmt.Errorf( - "failed to queue VSCMatured packet data: %s", err.Error())) - } + k.HandleVSCMaturedPacket(ctx, chainID, data) - k.Logger(ctx).Info("VSCMaturedPacket received and enqueued", + k.Logger(ctx).Info("VSCMaturedPacket handled", "chainID", chainID, "vscID", data.ValsetUpdateId, ) @@ -48,35 +45,6 @@ func (k Keeper) OnRecvVSCMaturedPacket( return ack } -// HandleLeadingVSCMaturedPackets handles all VSCMatured packet data that has been queued this block, -// but does not need to be throttled. The handled data is then removed from the queue. -// -// Note: VSC matured packet data which is queued behind slash packet data CANNOT be -// handled until the leading slash packet data has been handled. This is to maintain -// the "VSC Maturity and Slashing Order" CCV property. If VSC matured packet data DOES NOT -// trail slash packet data for that consumer, it will be handled in this method, -// bypassing HandleThrottleQueues. -func (k Keeper) HandleLeadingVSCMaturedPackets(ctx sdk.Context) (vscMaturedHandledThisBlock int) { - vscMaturedHandledThisBlock = 0 - for _, chain := range k.GetAllConsumerChains(ctx) { - // Note: it's assumed the order of the vsc matured slice matches the order of the ibc seq nums slice, - // in that a vsc matured packet data at index i is associated with the ibc seq num at index i. - leadingVscMatured, ibcSeqNums := k.GetLeadingVSCMaturedData(ctx, chain.ChainId) - ibcSeqNumsHandled := []uint64{} - for idx, data := range leadingVscMatured { - if vscMaturedHandledThisBlock >= vscMaturedHandledPerBlockLimit { - // Break from inner for-loop, DeleteThrottledPacketData will still be called for this consumer - break - } - k.HandleVSCMaturedPacket(ctx, chain.ChainId, data) - vscMaturedHandledThisBlock++ - ibcSeqNumsHandled = append(ibcSeqNumsHandled, ibcSeqNums[idx]) - } - k.DeleteThrottledPacketData(ctx, chain.ChainId, ibcSeqNumsHandled...) - } - return vscMaturedHandledThisBlock -} - // HandleVSCMaturedPacket handles a VSCMatured packet. // // Note: This method should only panic for a system critical error like a @@ -270,18 +238,10 @@ func (k Keeper) QueueVSCPackets(ctx sdk.Context) { k.IncrementValidatorSetUpdateId(ctx) } -// EndBlockCIS contains the EndBlock logic needed for -// the Consumer Initiated Slashing sub-protocol -func (k Keeper) EndBlockCIS(ctx sdk.Context) { - // set the ValsetUpdateBlockHeight - blockHeight := uint64(ctx.BlockHeight()) + 1 - valUpdateID := k.GetValidatorSetUpdateId(ctx) - k.SetValsetUpdateBlockHeight(ctx, valUpdateID, blockHeight) - k.Logger(ctx).Debug("vscID was mapped to block height", "vscID", valUpdateID, "height", blockHeight) - - // Replenish slash meter if necessary, BEFORE executing slash packet throttling logic. - // This ensures the meter value is replenished, and not greater than the allowance (max value) - // for the block, before the throttling logic is executed. +// BeginBlockCIS contains the BeginBlock logic needed for the Consumer Initiated Slashing sub-protocol. +func (k Keeper) BeginBlockCIS(ctx sdk.Context) { + // Replenish slash meter if necessary. This ensures the meter value is replenished before handling any slash packets, + // and ensures the meter value is not greater than the allowance (max value) for the block. // // Note: CheckForSlashMeterReplenishment contains panics for the following scenarios, any of which should never occur // if the protocol is correct and external data is properly validated: @@ -291,23 +251,16 @@ func (k Keeper) EndBlockCIS(ctx sdk.Context) { // - Marshaling and/or store corruption errors. // - Setting invalid slash meter values (see SetSlashMeter). k.CheckForSlashMeterReplenishment(ctx) +} - // Handle leading vsc matured packets before throttling logic. - // - // Note: HandleLeadingVSCMaturedPackets contains panics for the following scenarios, any of which should never occur - // if the protocol is correct and external data is properly validated: - // - // - Marshaling and/or store corruption errors. - vscMaturedHandledThisBlock := k.HandleLeadingVSCMaturedPackets(ctx) - // Handle queue entries considering throttling logic. - // - // Note: HandleThrottleQueues contains panics for the following scenarios, any of which should never occur - // if the protocol is correct and external data is properly validated: - // - // - SlashMeter has not been set (which should be set in InitGenesis, see InitializeSlashMeter). - // - Marshaling and/or store corruption errors. - // - Setting invalid slash meter values (see SetSlashMeter). - k.HandleThrottleQueues(ctx, vscMaturedHandledThisBlock) +// EndBlockCIS contains the EndBlock logic needed for +// the Consumer Initiated Slashing sub-protocol +func (k Keeper) EndBlockCIS(ctx sdk.Context) { + // set the ValsetUpdateBlockHeight + blockHeight := uint64(ctx.BlockHeight()) + 1 + valUpdateID := k.GetValidatorSetUpdateId(ctx) + k.SetValsetUpdateBlockHeight(ctx, valUpdateID, blockHeight) + k.Logger(ctx).Debug("vscID was mapped to block height", "vscID", valUpdateID, "height", blockHeight) } // OnRecvSlashPacket delivers a received slash packet, validates it and @@ -358,20 +311,27 @@ func (k Keeper) OnRecvSlashPacket(ctx sdk.Context, packet channeltypes.Packet, d return channeltypes.NewResultAcknowledgement(ccv.V1Result) } - // Queue a slash entry to the global queue, which will be seen by the throttling logic - k.QueueGlobalSlashEntry(ctx, providertypes.NewGlobalSlashEntry( - ctx.BlockTime(), // recv time - chainID, // consumer chain id that sent the packet - packet.Sequence, // IBC sequence number of the packet - providerConsAddr)) // Provider consensus address of val to be slashed - - // Queue slash packet data in the same (consumer chain specific) queue as vsc matured packet data, - // to enforce order of handling between the two packet data types. - if err := k.QueueThrottledSlashPacketData(ctx, chainID, packet.Sequence, data); err != nil { - return ccv.NewErrorAcknowledgementWithLog(ctx, fmt.Errorf("failed to queue slash packet data: %s", err.Error())) + meter := k.GetSlashMeter(ctx) + // Return bounce ack if meter is negative in value + if meter.IsNegative() { + k.Logger(ctx).Info("SlashPacket received, but meter is negative. Packet will be bounced", + "chainID", chainID, + "consumer cons addr", consumerConsAddr.String(), + "provider cons addr", providerConsAddr.String(), + "vscID", data.ValsetUpdateId, + "infractionType", data.Infraction, + ) + return channeltypes.NewResultAcknowledgement(ccv.SlashPacketBouncedResult) } - k.Logger(ctx).Info("slash packet received and enqueued", + // Subtract voting power that will be jailed/tombstoned from the slash meter, + // BEFORE handling slash packet. + meter = meter.Sub(k.GetEffectiveValPower(ctx, providerConsAddr)) + k.SetSlashMeter(ctx, meter) + + k.HandleSlashPacket(ctx, chainID, data) + + k.Logger(ctx).Info("slash packet received and handled", "chainID", chainID, "consumer cons addr", consumerConsAddr.String(), "provider cons addr", providerConsAddr.String(), @@ -379,7 +339,8 @@ func (k Keeper) OnRecvSlashPacket(ctx sdk.Context, packet channeltypes.Packet, d "infractionType", data.Infraction, ) - return channeltypes.NewResultAcknowledgement(ccv.V1Result) + // Return result ack that the packet was handled successfully + return channeltypes.NewResultAcknowledgement(ccv.SlashPacketHandledResult) } // ValidateSlashPacket validates a recv slash packet before it is diff --git a/x/ccv/provider/keeper/relay_test.go b/x/ccv/provider/keeper/relay_test.go index 590286261c..71e9528d64 100644 --- a/x/ccv/provider/keeper/relay_test.go +++ b/x/ccv/provider/keeper/relay_test.go @@ -3,7 +3,6 @@ package keeper_test import ( "strings" "testing" - "time" clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types" @@ -11,6 +10,8 @@ import ( "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" @@ -93,10 +94,8 @@ func TestQueueVSCPackets(t *testing.T) { } // TestOnRecvVSCMaturedPacket tests the OnRecvVSCMaturedPacket method of the keeper. -// Particularly the behavior that VSC matured packet data should be handled immediately -// if the pending packet data queue is empty, and should be queued otherwise. // -// Note: Handling logic itself is not testing in here, just queueing behavior. +// Note: Handling logic itself is not tested here. func TestOnRecvVSCMaturedPacket(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -106,131 +105,69 @@ func TestOnRecvVSCMaturedPacket(t *testing.T) { providerKeeper.SetChannelToChain(ctx, "channel-1", "chain-1") providerKeeper.SetChannelToChain(ctx, "channel-2", "chain-2") - // Execute on recv for chain-1 + // Execute on recv for chain-1, confirm v1 result ack is returned ack := executeOnRecvVSCMaturedPacket(t, &providerKeeper, ctx, "channel-1", 1) require.Equal(t, channeltypes.NewResultAcknowledgement([]byte{byte(1)}), ack) - // Assert that the packet data was queued for chain-1 - require.Equal(t, uint64(1), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-1")) - - // chain-2 queue empty - require.Equal(t, uint64(0), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-2")) - - // Now queue a slash packet data instance for chain-2, then confirm the on recv method - // queues the vsc matured behind the slash packet data - err := providerKeeper.QueueThrottledSlashPacketData(ctx, "chain-2", 1, testkeeper.GetNewSlashPacketData()) - require.NoError(t, err) + // Now queue a slash packet data instance for chain-2, confirm v1 result ack is returned ack = executeOnRecvVSCMaturedPacket(t, &providerKeeper, ctx, "channel-2", 2) require.Equal(t, channeltypes.NewResultAcknowledgement([]byte{byte(1)}), ack) - require.Equal(t, uint64(2), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-2")) - - // Chain-1 still has 1 packet data queued - require.Equal(t, uint64(1), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-1")) - - // Receive 5 more vsc matured packets for chain-2, then confirm chain-2 queue size is 7, chain-1 still size 1 - for i := 0; i < 5; i++ { - ack = executeOnRecvVSCMaturedPacket(t, &providerKeeper, ctx, "channel-2", uint64(i+3)) - require.Equal(t, channeltypes.NewResultAcknowledgement([]byte{byte(1)}), ack) - } - require.Equal(t, uint64(7), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-2")) - require.Equal(t, uint64(1), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-1")) - - // Delete chain-2's data from its queue, then confirm the queue size is 0 - providerKeeper.DeleteThrottledPacketData(ctx, "chain-2", []uint64{1, 2, 3, 4, 5, 6, 7}...) - require.Equal(t, uint64(0), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-2")) } -func TestHandleLeadingVSCMaturedPackets(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) +// TestOnRecvDowntimeSlashPacket tests the OnRecvSlashPacket method specifically for downtime slash packets. +func TestOnRecvDowntimeSlashPacket(t *testing.T) { + providerKeeper, ctx, ctrl, mocks := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() providerKeeper.SetParams(ctx, providertypes.DefaultParams()) - vscData := getTenSampleVSCMaturedPacketData() - - // Set channel to chain, and chain to client mappings - // (faking multiple established consumer channels) + // Set channel to chain (faking multiple established channels) providerKeeper.SetChannelToChain(ctx, "channel-1", "chain-1") - providerKeeper.SetConsumerClientId(ctx, "chain-1", "client-1") providerKeeper.SetChannelToChain(ctx, "channel-2", "chain-2") - providerKeeper.SetConsumerClientId(ctx, "chain-2", "client-2") - // Queue some leading vsc matured packet data for chain-1 - err := providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-1", 1, vscData[0]) - require.NoError(t, err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-1", 2, vscData[1]) - require.NoError(t, err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-1", 3, vscData[2]) - require.NoError(t, err) + // Generate a new slash packet data instance with double sign infraction type + packetData := testkeeper.GetNewSlashPacketData() + packetData.Infraction = stakingtypes.Infraction_INFRACTION_DOWNTIME - // Queue some trailing slash packet data (and a couple more vsc matured) - err = providerKeeper.QueueThrottledSlashPacketData(ctx, "chain-1", 4, testkeeper.GetNewSlashPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledSlashPacketData(ctx, "chain-1", 5, testkeeper.GetNewSlashPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-1", 6, vscData[3]) - require.NoError(t, err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-1", 7, vscData[4]) - require.NoError(t, err) + // Set a block height for the valset update id in the generated packet data + providerKeeper.SetValsetUpdateBlockHeight(ctx, packetData.ValsetUpdateId, uint64(15)) - // Queue some leading vsc matured packet data for chain-2 - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-2", 1, vscData[5]) - require.NoError(t, err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-2", 2, vscData[6]) - require.NoError(t, err) + // Set slash meter to negative value and assert a bounce ack is returned + providerKeeper.SetSlashMeter(ctx, math.NewInt(-5)) + ack := executeOnRecvSlashPacket(t, &providerKeeper, ctx, "channel-1", 1, packetData) + require.Equal(t, channeltypes.NewResultAcknowledgement(ccv.SlashPacketBouncedResult), ack) - // And trailing slash packet data for chain-2 - err = providerKeeper.QueueThrottledSlashPacketData(ctx, "chain-2", 3, testkeeper.GetNewSlashPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledSlashPacketData(ctx, "chain-2", 4, testkeeper.GetNewSlashPacketData()) - require.NoError(t, err) + // Also bounced for chain-2 + ack = executeOnRecvSlashPacket(t, &providerKeeper, ctx, "channel-2", 2, packetData) + require.Equal(t, channeltypes.NewResultAcknowledgement(ccv.SlashPacketBouncedResult), ack) + + // Now set slash meter to positive value and assert slash packet handled result is returned + providerKeeper.SetSlashMeter(ctx, math.NewInt(5)) + + // Mock call to GetEffectiveValPower, so that it returns 2. + providerAddr := providertypes.NewProviderConsAddress(packetData.Validator.Address) + calls := []*gomock.Call{ + mocks.MockStakingKeeper.EXPECT().GetValidatorByConsAddr(ctx, providerAddr.ToSdkConsAddr()). + Return(stakingtypes.Validator{}, true).Times(1), + mocks.MockStakingKeeper.EXPECT().GetLastValidatorPower(ctx, gomock.Any()). + Return(int64(2)).Times(1), + } - // And one more trailing vsc matured packet for chain-2 - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-2", 5, vscData[7]) - require.NoError(t, err) + // Add mocks for slash packet handling + calls = append(calls, + testkeeper.GetMocksForHandleSlashPacket( + ctx, mocks, providerAddr, stakingtypes.Validator{Jailed: false}, true)..., + ) + gomock.InOrder(calls...) - // Set VSC Send timestamps for each recv vsc matured packet - providerKeeper.SetVscSendTimestamp(ctx, "chain-1", vscData[0].ValsetUpdateId, time.Now()) - providerKeeper.SetVscSendTimestamp(ctx, "chain-1", vscData[1].ValsetUpdateId, time.Now()) - providerKeeper.SetVscSendTimestamp(ctx, "chain-1", vscData[2].ValsetUpdateId, time.Now()) - providerKeeper.SetVscSendTimestamp(ctx, "chain-1", vscData[3].ValsetUpdateId, time.Now()) - providerKeeper.SetVscSendTimestamp(ctx, "chain-1", vscData[4].ValsetUpdateId, time.Now()) - providerKeeper.SetVscSendTimestamp(ctx, "chain-2", vscData[5].ValsetUpdateId, time.Now()) - providerKeeper.SetVscSendTimestamp(ctx, "chain-2", vscData[6].ValsetUpdateId, time.Now()) - providerKeeper.SetVscSendTimestamp(ctx, "chain-2", vscData[7].ValsetUpdateId, time.Now()) - - // Confirm each chain-specific queue has the expected number of packet data instances - require.Equal(t, uint64(7), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-1")) - require.Equal(t, uint64(5), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-2")) - - // Handle leading vsc matured packets and confirm queue sizes change for both chains - providerKeeper.HandleLeadingVSCMaturedPackets(ctx) - require.Equal(t, uint64(4), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-1")) - require.Equal(t, uint64(3), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-2")) - - // Confirm the leading vsc matured packet data was handled for both chains, - // but not the vsc matured packet data that trails slash data in the queue. - // This assertion is made by checking that VSC Send timestamps were deleted for - // handled vsc matured packet data. - _, found := providerKeeper.GetVscSendTimestamp(ctx, "chain-1", vscData[0].ValsetUpdateId) - require.False(t, found) - _, found = providerKeeper.GetVscSendTimestamp(ctx, "chain-1", vscData[1].ValsetUpdateId) - require.False(t, found) - _, found = providerKeeper.GetVscSendTimestamp(ctx, "chain-1", vscData[2].ValsetUpdateId) - require.False(t, found) - _, found = providerKeeper.GetVscSendTimestamp(ctx, "chain-1", vscData[3].ValsetUpdateId) - require.True(t, found) - _, found = providerKeeper.GetVscSendTimestamp(ctx, "chain-1", vscData[4].ValsetUpdateId) - require.True(t, found) + // Execute on recv and confirm slash packet handled result is returned + ack = executeOnRecvSlashPacket(t, &providerKeeper, ctx, "channel-1", 1, packetData) + require.Equal(t, channeltypes.NewResultAcknowledgement(ccv.SlashPacketHandledResult), ack) - _, found = providerKeeper.GetVscSendTimestamp(ctx, "chain-2", vscData[5].ValsetUpdateId) - require.False(t, found) - _, found = providerKeeper.GetVscSendTimestamp(ctx, "chain-2", vscData[6].ValsetUpdateId) - require.False(t, found) - _, found = providerKeeper.GetVscSendTimestamp(ctx, "chain-2", vscData[7].ValsetUpdateId) - require.True(t, found) + // Require slash meter was decremented appropriately, 5-2=3 + require.Equal(t, int64(3), providerKeeper.GetSlashMeter(ctx).Int64()) } -// TestOnRecvSlashPacket tests the OnRecvSlashPacket method specifically for double-sign slash packets. +// TestOnRecvDoubleSignSlashPacket tests the OnRecvSlashPacket method specifically for double-sign slash packets. func TestOnRecvDoubleSignSlashPacket(t *testing.T) { providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) defer ctrl.Finish() @@ -249,12 +186,8 @@ func TestOnRecvDoubleSignSlashPacket(t *testing.T) { // Receive the double-sign slash packet for chain-1 and confirm the expected acknowledgement ack := executeOnRecvSlashPacket(t, &providerKeeper, ctx, "channel-1", 1, packetData) - require.Equal(t, channeltypes.NewResultAcknowledgement([]byte{byte(1)}), ack) + require.Equal(t, channeltypes.NewResultAcknowledgement(ccv.V1Result), ack) - // Nothing should be queued - require.Equal(t, uint64(0), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-1")) - require.Equal(t, uint64(0), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-2")) - require.Equal(t, 0, len(providerKeeper.GetAllGlobalSlashEntries(ctx))) require.True(t, providerKeeper.GetSlashLog(ctx, providertypes.NewProviderConsAddress(packetData.Validator.Address))) @@ -263,56 +196,6 @@ func TestOnRecvDoubleSignSlashPacket(t *testing.T) { require.False(t, providerKeeper.GetSlashLog(ctx, randomAddress)) } -// TestOnRecvSlashPacket tests the OnRecvSlashPacket method specifically for downtime slash packets, -// and how the method interacts with the parent and per-chain slash packet queues. -func TestOnRecvDowntimeSlashPacket(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - providerKeeper.SetParams(ctx, providertypes.DefaultParams()) - - // Set channel to chain (faking multiple established channels) - providerKeeper.SetChannelToChain(ctx, "channel-1", "chain-1") - providerKeeper.SetChannelToChain(ctx, "channel-2", "chain-2") - - // Generate a new slash packet data instance with downtime infraction type - packetData := testkeeper.GetNewSlashPacketData() - packetData.Infraction = stakingtypes.Infraction_INFRACTION_DOWNTIME - - // Set a block height for the valset update id in the generated packet data - providerKeeper.SetValsetUpdateBlockHeight(ctx, packetData.ValsetUpdateId, uint64(15)) - - // Receive the downtime slash packet for chain-1 at time.Now() - ctx = ctx.WithBlockTime(time.Now()) - ack := executeOnRecvSlashPacket(t, &providerKeeper, ctx, "channel-1", 1, packetData) - require.Equal(t, channeltypes.NewResultAcknowledgement([]byte{byte(1)}), ack) - - // Confirm an entry was added to the global queue, and pending packet data was added to the per-chain queue - globalEntries := providerKeeper.GetAllGlobalSlashEntries(ctx) // parent queue - require.Equal(t, 1, len(globalEntries)) - require.Equal(t, "chain-1", globalEntries[0].ConsumerChainID) - require.Equal(t, uint64(1), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-1")) // per chain queue - - // Generate a new downtime packet data instance with downtime infraction type - packetData = testkeeper.GetNewSlashPacketData() - packetData.Infraction = stakingtypes.Infraction_INFRACTION_DOWNTIME - - // Set a block height for the valset update id in the generated packet data - providerKeeper.SetValsetUpdateBlockHeight(ctx, packetData.ValsetUpdateId, uint64(15)) - - // Receive a downtime slash packet for chain-2 at time.Now(Add(1 *time.Hour)) - ctx = ctx.WithBlockTime(time.Now().Add(1 * time.Hour)) - ack = executeOnRecvSlashPacket(t, &providerKeeper, ctx, "channel-2", 2, packetData) - require.Equal(t, channeltypes.NewResultAcknowledgement([]byte{byte(1)}), ack) - - // Confirm sizes of parent queue and both per-chain queues - globalEntries = providerKeeper.GetAllGlobalSlashEntries(ctx) - require.Equal(t, 2, len(globalEntries)) - require.Equal(t, "chain-1", globalEntries[0].ConsumerChainID) - require.Equal(t, "chain-2", globalEntries[1].ConsumerChainID) - require.Equal(t, uint64(1), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-1")) // per chain queue - require.Equal(t, uint64(1), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-2")) // per chain queue -} - func executeOnRecvVSCMaturedPacket(t *testing.T, providerKeeper *keeper.Keeper, ctx sdk.Context, channelID string, ibcSeqNum uint64, ) exported.Acknowledgement { diff --git a/x/ccv/provider/keeper/throttle.go b/x/ccv/provider/keeper/throttle.go index d8be629ee7..8232e37a25 100644 --- a/x/ccv/provider/keeper/throttle.go +++ b/x/ccv/provider/keeper/throttle.go @@ -11,64 +11,8 @@ import ( tmtypes "github.com/cometbft/cometbft/types" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) -// This file contains functionality relevant to the throttling of slash and vsc matured packets, aka circuit breaker logic. - -const vscMaturedHandledPerBlockLimit = 100 - -// HandleThrottleQueues iterates over the global slash entry queue, and -// handles all or some portion of throttled (slash and/or VSC matured) packet data received from -// consumer chains. The slash meter is decremented appropriately in this method. -func (k Keeper) HandleThrottleQueues(ctx sdktypes.Context, vscMaturedHandledThisBlock int) { - meter := k.GetSlashMeter(ctx) - // Return if meter is negative in value - if meter.IsNegative() { - return - } - - // Return if vsc matured handle limit was already reached this block, during HandleLeadingVSCMaturedPackets. - // It makes no practical difference for throttling logic to execute next block. - // By doing this, we assure that all leading vsc matured packets were handled before any slash packets. - if vscMaturedHandledThisBlock >= vscMaturedHandledPerBlockLimit { - return - } - - // Obtain all global slash entries, where only some of them may be handled in this method, - // depending on the value of the slash meter. - allEntries := k.GetAllGlobalSlashEntries(ctx) - handledEntries := []providertypes.GlobalSlashEntry{} - - for _, globalEntry := range allEntries { - // Subtract voting power that will be jailed/tombstoned from the slash meter - providerAddr := providertypes.NewProviderConsAddress(globalEntry.ProviderValConsAddr) - meter = meter.Sub(k.GetEffectiveValPower(ctx, providerAddr)) - - // Handle one slash and any trailing vsc matured packet data instances by passing in - // chainID and appropriate callbacks, relevant packet data is deleted in this method. - - k.HandlePacketDataForChain(ctx, globalEntry.ConsumerChainID, k.HandleSlashPacket, k.HandleVSCMaturedPacket, vscMaturedHandledThisBlock) - handledEntries = append(handledEntries, globalEntry) - - // don't handle any more global entries if meter becomes negative in value - if meter.IsNegative() { - k.Logger(ctx).Info("negative slash meter value, no more slash packets will be handled", "meter", meter.Int64()) - break - } - } - - // Handled global entries are deleted after iteration is completed - k.DeleteGlobalSlashEntries(ctx, handledEntries...) - - // Persist current value for slash meter - k.SetSlashMeter(ctx, meter) - - if len(handledEntries) > 0 { - k.Logger(ctx).Info("handled global slash entries", "count", len(handledEntries), "meter", meter.Int64()) - } -} - // Obtains the effective validator power relevant to a validator consensus address. func (k Keeper) GetEffectiveValPower(ctx sdktypes.Context, valConsAddr providertypes.ProviderConsAddress, @@ -87,41 +31,6 @@ func (k Keeper) GetEffectiveValPower(ctx sdktypes.Context, } } -// HandlePacketDataForChain handles only the first queued slash packet relevant to the passed consumer chainID, -// and then handles any trailing vsc matured packets in that (consumer chain specific) throttled packet data queue. -// The handled data is then deleted from the queue. -// -// Note: Any packet data which is handled in this method is also deleted from the (consumer chain specific) queue. -func (k Keeper) HandlePacketDataForChain(ctx sdktypes.Context, consumerChainID string, - slashPacketHandler func(sdktypes.Context, string, ccvtypes.SlashPacketData), - vscMaturedPacketHandler func(sdktypes.Context, string, ccvtypes.VSCMaturedPacketData), - vscMaturedHandledThisBlock int, -) { - // Get slash packet data and trailing vsc matured packet data, handle it all. - slashFound, slashData, vscMaturedData, seqNums := k.GetSlashAndTrailingData(ctx, consumerChainID) - seqNumsHandled := []uint64{} - if slashFound { - slashPacketHandler(ctx, consumerChainID, slashData) - // Due to HandleLeadingVSCMaturedPackets() running before HandleThrottleQueues(), and the fact that - // HandleThrottleQueues() will return until all leading vsc matured have been handled, a slash packet - // should always be the first packet in the queue. So we can safely append the first seqNum here. - seqNumsHandled = append(seqNumsHandled, seqNums[0]) - } - for idx, vscMData := range vscMaturedData { - if vscMaturedHandledThisBlock >= vscMaturedHandledPerBlockLimit { - // Break from for-loop, DeleteThrottledPacketData will still be called for this consumer - break - } - vscMaturedPacketHandler(ctx, consumerChainID, vscMData) - vscMaturedHandledThisBlock++ - // Append seq num for this vsc matured packet - seqNumsHandled = append(seqNumsHandled, seqNums[idx+1]) // Note idx+1, since slash packet is at index 0 - } - - // Delete handled data after it has all been handled. - k.DeleteThrottledPacketData(ctx, consumerChainID, seqNumsHandled...) -} - // InitializeSlashMeter initializes the slash meter to it's max value (also its allowance), // and sets the replenish time candidate to one replenish period from current block time. func (k Keeper) InitializeSlashMeter(ctx sdktypes.Context) { @@ -206,353 +115,6 @@ func (k Keeper) GetSlashMeterAllowance(ctx sdktypes.Context) math.Int { return roundedInt } -// -// CRUD section -// - -// QueueGlobalSlashEntry queues an entry to the "global" slash packet queue, used for throttling val power changes -// related to jailing/tombstoning over time. This "global" queue is used to coordinate the order of slash packet handling -// between chains, whereas the chain-specific queue is used to coordinate the order of slash and vsc matured packets -// relevant to each chain. -func (k Keeper) QueueGlobalSlashEntry(ctx sdktypes.Context, entry providertypes.GlobalSlashEntry) { - store := ctx.KVStore(k.storeKey) - key := providertypes.GlobalSlashEntryKey(entry) - bz := entry.ProviderValConsAddr - store.Set(key, bz) -} - -// DeleteGlobalSlashEntriesForConsumer deletes all pending slash packet entries in the global queue, -// only relevant to a single consumer. -func (k Keeper) DeleteGlobalSlashEntriesForConsumer(ctx sdktypes.Context, consumerChainID string) { - allEntries := k.GetAllGlobalSlashEntries(ctx) - entriesToDel := []providertypes.GlobalSlashEntry{} - - for _, entry := range allEntries { - if entry.ConsumerChainID == consumerChainID { - entriesToDel = append(entriesToDel, entry) - } - } - k.DeleteGlobalSlashEntries(ctx, entriesToDel...) -} - -// GetAllGlobalSlashEntries returns all global slash entries from the queue. -// -// Note global slash entries are stored under keys with the following format: -// GlobalSlashEntryBytePrefix | uint64 recv time | ibc seq num | consumer chain id -// Thus, the returned array is ordered by recv time, then ibc seq num. -func (k Keeper) GetAllGlobalSlashEntries(ctx sdktypes.Context) []providertypes.GlobalSlashEntry { - store := ctx.KVStore(k.storeKey) - iterator := sdktypes.KVStorePrefixIterator(store, []byte{providertypes.GlobalSlashEntryBytePrefix}) - defer iterator.Close() - - entries := []providertypes.GlobalSlashEntry{} - - for ; iterator.Valid(); iterator.Next() { - // MustParseGlobalSlashEntryKey should not panic, since we should be iterating over keys that're - // assumed to be correctly serialized in QueueGlobalSlashEntry. - recvTime, chainID, ibcSeqNum := providertypes.MustParseGlobalSlashEntryKey(iterator.Key()) - valAddr := providertypes.NewProviderConsAddress(iterator.Value()) - entry := providertypes.NewGlobalSlashEntry(recvTime, chainID, ibcSeqNum, valAddr) - entries = append(entries, entry) - } - return entries -} - -// DeleteGlobalSlashEntries deletes the given global entries from the global slash queue -func (k Keeper) DeleteGlobalSlashEntries(ctx sdktypes.Context, entries ...providertypes.GlobalSlashEntry) { - store := ctx.KVStore(k.storeKey) - for _, entry := range entries { - store.Delete(providertypes.GlobalSlashEntryKey(entry)) - } -} - -// Pending packet data type enum, used to encode the type of packet data stored at each entry in the mutual queue. -const ( - slashPacketData byte = iota - vscMaturedPacketData -) - -// GetThrottledPacketDataSize returns the size of the throttled packet data queue for the given consumer chain -func (k Keeper) GetThrottledPacketDataSize(ctx sdktypes.Context, consumerChainID string) uint64 { - store := ctx.KVStore(k.storeKey) - key := providertypes.ThrottledPacketDataSizeKey(consumerChainID) - var size uint64 - bz := store.Get(key) - if bz == nil { - size = 0 - } else { - size = sdktypes.BigEndianToUint64(bz) - } - return size -} - -// SetThrottledPacketDataSize sets the size of the throttled packet data queue for the given consumer chain -func (k Keeper) SetThrottledPacketDataSize(ctx sdktypes.Context, consumerChainID string, size uint64) { - // Sanity check to ensure that the chain-specific throttled packet data queue does not grow too - // large for a single consumer chain. This check ensures that binaries would panic deterministically - // if the queue does grow too large. MaxThrottledPackets should be set accordingly (quite large). - if size >= uint64(k.GetMaxThrottledPackets(ctx)) { - panic(fmt.Sprintf("throttled packet data queue for chain %s is too large: %d", consumerChainID, size)) - } - - store := ctx.KVStore(k.storeKey) - key := providertypes.ThrottledPacketDataSizeKey(consumerChainID) - bz := sdktypes.Uint64ToBigEndian(size) - store.Set(key, bz) -} - -// IncrementThrottledPacketDataSize increments the size of the throttled packet data -// queue for the given consumer chain. -func (k Keeper) IncrementThrottledPacketDataSize(ctx sdktypes.Context, consumerChainID string) { - size := k.GetThrottledPacketDataSize(ctx, consumerChainID) - k.SetThrottledPacketDataSize(ctx, consumerChainID, size+1) - k.Logger(ctx).Debug("incremented throttled packets size", - "chainID", consumerChainID, - "size", size+1, - ) -} - -// QueueThrottledSlashPacketData queues the slash packet data for a chain-specific throttled packet data queue. -// -// Note: This queue is shared between pending slash packet data and pending vsc matured packet data. -func (k Keeper) QueueThrottledSlashPacketData( - ctx sdktypes.Context, consumerChainID string, ibcSeqNum uint64, data ccvtypes.SlashPacketData, -) error { - return k.QueueThrottledPacketData(ctx, consumerChainID, ibcSeqNum, data) -} - -// QueueThrottledVSCMaturedPacketData queues the vsc matured packet data for a chain-specific throttled packet data queue. -// -// Note: This queue is shared between pending slash packet data and pending vsc matured packet data. -func (k Keeper) QueueThrottledVSCMaturedPacketData( - ctx sdktypes.Context, consumerChainID string, ibcSeqNum uint64, data ccvtypes.VSCMaturedPacketData, -) error { - return k.QueueThrottledPacketData(ctx, consumerChainID, ibcSeqNum, data) -} - -// QueueThrottledPacketData queues a slash packet data or vsc matured packet data instance -// for the given consumer chain's queue. -// -// Note: This method returns an error because it is called from -// OnRecvSlashPacket and OnRecvVSCMaturedPacket, meaning we can return an ibc err ack to the -// counter party chain on error, instead of panicking this chain. -func (k Keeper) QueueThrottledPacketData( - ctx sdktypes.Context, consumerChainID string, ibcSeqNum uint64, packetData interface{}, -) error { - store := ctx.KVStore(k.storeKey) - - var bz []byte - var err error - switch data := packetData.(type) { - case ccvtypes.SlashPacketData: - bz, err = data.Marshal() - if err != nil { - return fmt.Errorf("failed to marshal slash packet data: %v", err) - } - bz = append([]byte{slashPacketData}, bz...) - case ccvtypes.VSCMaturedPacketData: - bz, err = data.Marshal() - if err != nil { - return fmt.Errorf("failed to marshal vsc matured packet data: %v", err) - } - bz = append([]byte{vscMaturedPacketData}, bz...) - default: - // Indicates a developer error, this method should only be called - // by tests, QueueThrottledSlashPacketData, or QueueThrottledVSCMaturedPacketData. - panic(fmt.Sprintf("unexpected packet data type: %T", data)) - } - - store.Set(providertypes.ThrottledPacketDataKey(consumerChainID, ibcSeqNum), bz) - k.IncrementThrottledPacketDataSize(ctx, consumerChainID) - return nil -} - -// GetLeadingVSCMaturedData returns the leading vsc matured packet data instances -// for a chain-specific throttled packet data queue. Ie the vsc matured packet data instances -// that do not have any slash packet data instances preceding them in the queue for consumerChainID. -func (k Keeper) GetLeadingVSCMaturedData(ctx sdktypes.Context, consumerChainID string) ( - vscMaturedData []ccvtypes.VSCMaturedPacketData, ibcSeqNums []uint64, -) { - store := ctx.KVStore(k.storeKey) - iteratorPrefix := providertypes.ChainIdWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) - iterator := sdktypes.KVStorePrefixIterator(store, iteratorPrefix) - defer iterator.Close() - - // Iterate over the throttled packet data queue, - // and return vsc matured packet data instances until we encounter a slash packet data instance. - vscMaturedData = []ccvtypes.VSCMaturedPacketData{} - ibcSeqNums = []uint64{} - for ; iterator.Valid(); iterator.Next() { - - bz := iterator.Value() - if bz[0] == slashPacketData { - break - } else if bz[0] != vscMaturedPacketData { - // This case would indicate a developer error or store corruption, - // since QueueThrottledPacketData should only queue slash packet data or vsc matured packet data. - panic(fmt.Sprintf("unexpected packet data type: %d", bz[0])) - } - - var data ccvtypes.VSCMaturedPacketData - err := data.Unmarshal(bz[1:]) - if err != nil { - // An error here would indicate something is very wrong, - // vsc matured packet data is assumed to be correctly serialized in QueueThrottledPacketData. - panic(fmt.Sprintf("failed to unmarshal vsc matured packet data: %v", err)) - } - - vscMaturedData = append(vscMaturedData, data) - // The below func should not panic, since we should be iterating over keys that're - // assumed to be correctly serialized in QueueThrottledPacketData. - _, ibcSeqNum := providertypes.MustParseThrottledPacketDataKey(iterator.Key()) - ibcSeqNums = append(ibcSeqNums, ibcSeqNum) - } - return vscMaturedData, ibcSeqNums -} - -// GetSlashAndTrailingData returns the first slash packet data instance and any -// trailing vsc matured packet data instances in the chain-specific throttled packet data queue. -// -// Note that throttled packet data is stored under keys with the following format: -// ThrottledPacketDataBytePrefix | len(chainID) | chainID | ibcSeqNum -// Thus, the returned array is in ascending order of ibc seq numbers. -func (k Keeper) GetSlashAndTrailingData(ctx sdktypes.Context, consumerChainID string) ( - slashFound bool, slashData ccvtypes.SlashPacketData, vscMaturedData []ccvtypes.VSCMaturedPacketData, - // Note: this slice contains the IBC sequence numbers of the slash packet data - // and trailing vsc matured packet data instances. This is used by caller to delete the - // data after it has been handled. - ibcSeqNums []uint64, -) { - store := ctx.KVStore(k.storeKey) - iteratorPrefix := providertypes.ChainIdWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) - iterator := sdktypes.KVStorePrefixIterator(store, iteratorPrefix) - defer iterator.Close() - - slashFound = false - slashData = ccvtypes.SlashPacketData{} - vscMaturedData = []ccvtypes.VSCMaturedPacketData{} - ibcSeqNums = []uint64{} - - for ; iterator.Valid(); iterator.Next() { - - bz := iterator.Value() - if bz[0] == slashPacketData { - if slashFound { - // Break for-loop, we've already found first slash packet data instance. - break - } else { - if err := slashData.Unmarshal(bz[1:]); err != nil { - // An error here would indicate something is very wrong, - // slash packet data is assumed to be correctly serialized in QueueThrottledPacketData. - panic(fmt.Sprintf("failed to unmarshal slash packet data: %v", err)) - } - slashFound = true - } - } else if bz[0] == vscMaturedPacketData { - vscMData := ccvtypes.VSCMaturedPacketData{} - if err := vscMData.Unmarshal(bz[1:]); err != nil { - // An error here would indicate something is very wrong, - // vsc matured packet data is assumed to be correctly serialized in QueueThrottledPacketData. - panic(fmt.Sprintf("failed to unmarshal vsc matured packet data: %v", err)) - } - vscMaturedData = append(vscMaturedData, vscMData) - } else { - // This case would indicate a developer error or store corruption, - // since QueueThrottledPacketData should only queue slash packet data or vsc matured packet data. - panic("invalid packet data type") - } - // The below func should not panic, since we should be iterating over keys that're - // assumed to be correctly serialized in QueueThrottledPacketData. - _, ibcSeqNum := providertypes.MustParseThrottledPacketDataKey(iterator.Key()) - ibcSeqNums = append(ibcSeqNums, ibcSeqNum) - } - return slashFound, slashData, vscMaturedData, ibcSeqNums -} - -// GetAllThrottledPacketData returns all throttled packet data for a specific consumer chain. -// -// Note: This method is only used by tests and queries, hence why it returns redundant data as different types. -// Since this method executes on query, no panics are explicitly included. -func (k Keeper) GetAllThrottledPacketData(ctx sdktypes.Context, consumerChainID string) ( - slashData []ccvtypes.SlashPacketData, vscMaturedData []ccvtypes.VSCMaturedPacketData, - rawOrderedData []interface{}, ibcSeqNums []uint64, -) { - slashData = []ccvtypes.SlashPacketData{} - vscMaturedData = []ccvtypes.VSCMaturedPacketData{} - rawOrderedData = []interface{}{} - ibcSeqNums = []uint64{} - - store := ctx.KVStore(k.storeKey) - iteratorPrefix := providertypes.ChainIdWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) - iterator := sdktypes.KVStorePrefixIterator(store, iteratorPrefix) - defer iterator.Close() - - for ; iterator.Valid(); iterator.Next() { - bz := iterator.Value() - switch bz[0] { - case slashPacketData: - d := ccvtypes.SlashPacketData{} - if err := d.Unmarshal(bz[1:]); err != nil { - k.Logger(ctx).Error(fmt.Sprintf("failed to unmarshal slash packet data: %v", err)) - continue - } - slashData = append(slashData, d) - rawOrderedData = append(rawOrderedData, d) - case vscMaturedPacketData: - d := ccvtypes.VSCMaturedPacketData{} - if err := d.Unmarshal(bz[1:]); err != nil { - k.Logger(ctx).Error(fmt.Sprintf("failed to unmarshal vsc matured packet data: %v", err)) - continue - } - vscMaturedData = append(vscMaturedData, d) - rawOrderedData = append(rawOrderedData, d) - default: - k.Logger(ctx).Error(fmt.Sprintf("invalid packet data type: %v", bz[0])) - continue - } - _, ibcSeqNum, err := providertypes.ParseThrottledPacketDataKey(iterator.Key()) - if err != nil { - k.Logger(ctx).Error(fmt.Sprintf("failed to parse throttled packet data key: %v", err)) - continue - } - ibcSeqNums = append(ibcSeqNums, ibcSeqNum) - } - - return slashData, vscMaturedData, rawOrderedData, ibcSeqNums -} - -// DeleteAllPacketDataForConsumer deletes all queued packet data for the given consumer chain. -func (k Keeper) DeleteThrottledPacketDataForConsumer(ctx sdktypes.Context, consumerChainID string) { - store := ctx.KVStore(k.storeKey) - iteratorPrefix := providertypes.ChainIdWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) - iterator := sdktypes.KVStorePrefixIterator(store, iteratorPrefix) - defer iterator.Close() - - keysToDel := [][]byte{} - for ; iterator.Valid(); iterator.Next() { - keysToDel = append(keysToDel, iterator.Key()) - } - // Delete data for this consumer - for _, key := range keysToDel { - store.Delete(key) - } - - // Delete size of data queue for this consumer - store.Delete(providertypes.ThrottledPacketDataSizeKey(consumerChainID)) -} - -// DeleteThrottledPacketData deletes the given throttled packet data instances -// (specified by their ibc seq number) from the chain-specific throttled packet data queue. -func (k Keeper) DeleteThrottledPacketData(ctx sdktypes.Context, consumerChainID string, ibcSeqNumbers ...uint64) { - store := ctx.KVStore(k.storeKey) - for _, ibcSeqNum := range ibcSeqNumbers { - store.Delete(providertypes.ThrottledPacketDataKey(consumerChainID, ibcSeqNum)) - } - // Decrement the size of the pending packet data queue - sizeBeforeDeletion := k.GetThrottledPacketDataSize(ctx, consumerChainID) - k.SetThrottledPacketDataSize(ctx, consumerChainID, sizeBeforeDeletion-uint64(len(ibcSeqNumbers))) -} - // GetSlashMeter returns a meter (persisted as a signed int) which stores an amount of voting power, corresponding // to an allowance of validators that can be jailed/tombstoned over time. // diff --git a/x/ccv/provider/keeper/throttle_test.go b/x/ccv/provider/keeper/throttle_test.go index a5356b0dc0..24e8c0ddde 100644 --- a/x/ccv/provider/keeper/throttle_test.go +++ b/x/ccv/provider/keeper/throttle_test.go @@ -1,13 +1,11 @@ package keeper_test import ( - "math/rand" "testing" "time" "github.com/golang/mock/gomock" "github.com/stretchr/testify/require" - "golang.org/x/exp/slices" "cosmossdk.io/math" @@ -15,168 +13,10 @@ import ( tmtypes "github.com/cometbft/cometbft/types" - cryptoutil "github.com/cosmos/interchain-security/v3/testutil/crypto" testkeeper "github.com/cosmos/interchain-security/v3/testutil/keeper" - "github.com/cosmos/interchain-security/v3/x/ccv/provider/keeper" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) -// TestHandlePacketDataForChain tests the HandlePacketDataForChain function. Note: Only one consumer is tested here, -// but multiple consumers are tested in TestPendingPacketData. -func TestHandlePacketDataForChain(t *testing.T) { - testCases := []struct { - name string - chainID string - // Pending packet data that will be queued in the order specified by the slice - dataToQueue []interface{} - // Indexes of packet data from dataToQueue that are expected to be handled and deleted from store - expectedHandledIndexes []int - }{ - { - "no packets", - "my-cool-chain", - []interface{}{}, - []int{}, - }, - { - "one slash packet should be handled", - "chain-37", - []interface{}{ - testkeeper.GetNewSlashPacketData(), - }, - []int{0}, - }, - { - "one slash packet followed by one vsc matured packet should all be handled", - "chain-222", - []interface{}{ - testkeeper.GetNewSlashPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - }, - []int{0, 1}, - }, - { - "one slash packet followed by multiple vsc matured packets should all be handled", - "chain-2223", - []interface{}{ - testkeeper.GetNewSlashPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - }, - []int{0, 1, 2, 3, 4, 5}, - }, - { - "multiple slash packets followed by multiple vsc matured packets should only handle first slash packet", - "chain-9", - []interface{}{ - testkeeper.GetNewSlashPacketData(), - testkeeper.GetNewSlashPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - }, - []int{0}, - }, - { - "vsc matured packets sandwiched between slash packets should handle everything but the last slash packet", - "chain-000", - []interface{}{ - testkeeper.GetNewSlashPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewSlashPacketData(), // 10th index not included in expectedHandledIndexes - }, - []int{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}, - }, - { - "alternating slash and vsc matured packets should handle only the first slash, and trailing vsc matured packets", - "chain-00000", - []interface{}{ - testkeeper.GetNewSlashPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewSlashPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewSlashPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewSlashPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - testkeeper.GetNewSlashPacketData(), - testkeeper.GetNewVSCMaturedPacketData(), - }, - []int{0, 1, 2}, - }, - } - - for _, tc := range testCases { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - providerKeeper.SetParams(ctx, providertypes.DefaultParams()) - - // Queue throttled packet data, where chainID is arbitrary, and ibc seq number is index of the data instance - for i, data := range tc.dataToQueue { - err := providerKeeper.QueueThrottledPacketData(ctx, tc.chainID, uint64(i), data) - require.NoError(t, err) - } - - // Define our handler callbacks to simply store the data instances that are handled - handledData := []interface{}{} - slashHandleCounter := func(ctx sdktypes.Context, chainID string, data ccvtypes.SlashPacketData) { - handledData = append(handledData, data) - } - vscMaturedHandleCounter := func(ctx sdktypes.Context, chainID string, data ccvtypes.VSCMaturedPacketData) { - handledData = append(handledData, data) - } - - providerKeeper.HandlePacketDataForChain(ctx, tc.chainID, slashHandleCounter, vscMaturedHandleCounter, 0) - - // Assert number of handled data instances matches expected number - require.Equal(t, len(tc.expectedHandledIndexes), len(handledData)) - - // Assert handled data instances match expected value - for i, expectedIndex := range tc.expectedHandledIndexes { - require.Equal(t, tc.dataToQueue[expectedIndex], handledData[i]) - } - - // Sanity check, Assert that only the first handled packet is a slash packet, and the rest are vsc matured packets - for idx, instance := range handledData { - switch instance.(type) { - case ccvtypes.SlashPacketData: - require.Equal(t, 0, idx) - case ccvtypes.VSCMaturedPacketData: - default: - require.Fail(t, "unexpected data instance type") - } - } - - // Assert that the unhandled queued data instances are as expected (i.e no unexpected deletions) - expectedDataThatsLeft := []interface{}{} - for idx, data := range tc.dataToQueue { - if !slices.Contains(tc.expectedHandledIndexes, idx) { - expectedDataThatsLeft = append(expectedDataThatsLeft, data) - } - } - - _, _, dataThatsLeft, _ := providerKeeper.GetAllThrottledPacketData(ctx, tc.chainID) - require.Equal(t, expectedDataThatsLeft, dataThatsLeft) - - // Assert that each instance of handled data is deleted from the persisted queue (i.e deletions where expected) - for _, dataInstance := range handledData { - require.NotContains(t, dataThatsLeft, dataInstance) - } - } -} - // TestSlashMeterReplenishment tests the CheckForSlashMeterReplenishment, ReplenishSlashMeter, // and InitializeSlashMeter methods. func TestSlashMeterReplenishment(t *testing.T) { @@ -627,628 +467,6 @@ func TestGetSlashMeterAllowance(t *testing.T) { } } -// TestGlobalSlashEntries tests the queue and iteration functions for global slash entries, -// with assertion of FIFO ordering -func TestGlobalSlashEntries(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - // Consistent time for "now" - now := time.Now().UTC() - - globalEntries := providerKeeper.GetAllGlobalSlashEntries(ctx) - require.Equal(t, 0, len(globalEntries)) - - // Queue 3 entries for chainIDs 0, 1, 2, note their respective ibc seq nums are - // ordered differently than the chainIDs would be iterated. - providerKeeper.QueueGlobalSlashEntry(ctx, providertypes.NewGlobalSlashEntry( - now.Local(), "chain-0", 15, cryptoutil.NewCryptoIdentityFromIntSeed(10).ProviderConsAddress())) - providerKeeper.QueueGlobalSlashEntry(ctx, providertypes.NewGlobalSlashEntry( - now.Local(), "chain-1", 10, cryptoutil.NewCryptoIdentityFromIntSeed(11).ProviderConsAddress())) - providerKeeper.QueueGlobalSlashEntry(ctx, providertypes.NewGlobalSlashEntry( - now.Local(), "chain-2", 5, cryptoutil.NewCryptoIdentityFromIntSeed(12).ProviderConsAddress())) - - globalEntries = providerKeeper.GetAllGlobalSlashEntries(ctx) - require.Equal(t, 3, len(globalEntries)) - - // Queue 3 entries for chainIDs 0, 1, 2 an hour later, with incremented ibc seq nums - providerKeeper.QueueGlobalSlashEntry(ctx, providertypes.NewGlobalSlashEntry( - now.Add(time.Hour).Local(), "chain-0", 16, // should appear last for this recv time - cryptoutil.NewCryptoIdentityFromIntSeed(20).ProviderConsAddress())) - providerKeeper.QueueGlobalSlashEntry(ctx, providertypes.NewGlobalSlashEntry( - now.Add(time.Hour).Local(), "chain-1", 11, // should appear middle for this recv time - cryptoutil.NewCryptoIdentityFromIntSeed(21).ProviderConsAddress())) - providerKeeper.QueueGlobalSlashEntry(ctx, providertypes.NewGlobalSlashEntry( - now.Add(time.Hour).Local(), "chain-2", 6, // should appear first for this recv time - cryptoutil.NewCryptoIdentityFromIntSeed(22).ProviderConsAddress())) - - // Retrieve entries from store - globalEntries = providerKeeper.GetAllGlobalSlashEntries(ctx) - require.Equal(t, 6, len(globalEntries)) - - // Assert that entries are obtained in FIFO order according to block time, then ibc seq num - require.Equal(t, "chain-2", globalEntries[0].ConsumerChainID) - require.Equal(t, "chain-1", globalEntries[1].ConsumerChainID) - require.Equal(t, "chain-0", globalEntries[2].ConsumerChainID) - require.Equal(t, "chain-2", globalEntries[3].ConsumerChainID) - require.Equal(t, "chain-1", globalEntries[4].ConsumerChainID) - require.Equal(t, "chain-0", globalEntries[5].ConsumerChainID) - - // Queue 3 entries for chainIDs 5, 6, 7 another hour later - providerKeeper.QueueGlobalSlashEntry(ctx, - providertypes.NewGlobalSlashEntry(now.Add(2*time.Hour).Local(), "chain-5", 50, // should appear middle for this recv time - cryptoutil.NewCryptoIdentityFromIntSeed(96).ProviderConsAddress())) - providerKeeper.QueueGlobalSlashEntry(ctx, - providertypes.NewGlobalSlashEntry(now.Add(2*time.Hour).Local(), "chain-6", 60, // should appear last for this recv time - cryptoutil.NewCryptoIdentityFromIntSeed(97).ProviderConsAddress())) - providerKeeper.QueueGlobalSlashEntry(ctx, - providertypes.NewGlobalSlashEntry(now.Add(2*time.Hour).Local(), "chain-7", 40, // should appear first for this recv time - cryptoutil.NewCryptoIdentityFromIntSeed(98).ProviderConsAddress())) - // Retrieve entries from store - globalEntries = providerKeeper.GetAllGlobalSlashEntries(ctx) - require.Equal(t, 9, len(globalEntries)) - - // Assert that entries are obtained in FIFO order according to block time, then ibc seq num - require.Equal(t, "chain-2", globalEntries[0].ConsumerChainID) - require.Equal(t, "chain-1", globalEntries[1].ConsumerChainID) - require.Equal(t, "chain-0", globalEntries[2].ConsumerChainID) - require.Equal(t, "chain-2", globalEntries[3].ConsumerChainID) - require.Equal(t, "chain-1", globalEntries[4].ConsumerChainID) - require.Equal(t, "chain-0", globalEntries[5].ConsumerChainID) - require.Equal(t, "chain-7", globalEntries[6].ConsumerChainID) - require.Equal(t, "chain-5", globalEntries[7].ConsumerChainID) - require.Equal(t, "chain-6", globalEntries[8].ConsumerChainID) - - // Assert each field is as expected for all 9 entries - require.Equal(t, uint64(5), globalEntries[0].IbcSeqNum) - require.Equal(t, uint64(10), globalEntries[1].IbcSeqNum) - require.Equal(t, uint64(15), globalEntries[2].IbcSeqNum) - require.Equal(t, uint64(6), globalEntries[3].IbcSeqNum) - require.Equal(t, uint64(11), globalEntries[4].IbcSeqNum) - require.Equal(t, uint64(16), globalEntries[5].IbcSeqNum) - require.Equal(t, uint64(40), globalEntries[6].IbcSeqNum) - require.Equal(t, uint64(50), globalEntries[7].IbcSeqNum) - require.Equal(t, uint64(60), globalEntries[8].IbcSeqNum) - - require.Equal(t, now, globalEntries[0].RecvTime) - require.Equal(t, now, globalEntries[1].RecvTime) - require.Equal(t, now, globalEntries[2].RecvTime) - require.Equal(t, now.Add(time.Hour).UTC(), globalEntries[3].RecvTime) - require.Equal(t, now.Add(time.Hour).UTC(), globalEntries[4].RecvTime) - require.Equal(t, now.Add(time.Hour).UTC(), globalEntries[5].RecvTime) - require.Equal(t, now.Add(2*time.Hour).UTC(), globalEntries[6].RecvTime) - require.Equal(t, now.Add(2*time.Hour).UTC(), globalEntries[7].RecvTime) - require.Equal(t, now.Add(2*time.Hour).UTC(), globalEntries[8].RecvTime) -} - -// Tests DeleteGlobalSlashEntriesForConsumer. -func TestDeleteGlobalSlashEntriesForConsumer(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx( - t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - // Queue 2 global entries for a consumer chain ID - providerKeeper.QueueGlobalSlashEntry(ctx, - providertypes.NewGlobalSlashEntry(time.Now().Add(time.Hour), "chain-78", 1, - cryptoutil.NewCryptoIdentityFromIntSeed(78).ProviderConsAddress())) - providerKeeper.QueueGlobalSlashEntry(ctx, - providertypes.NewGlobalSlashEntry(time.Now().Add(time.Hour), "chain-78", 2, - cryptoutil.NewCryptoIdentityFromIntSeed(79).ProviderConsAddress())) - - // Queue 1 global entry for two other consumer chain IDs - providerKeeper.QueueGlobalSlashEntry(ctx, - providertypes.NewGlobalSlashEntry(time.Now().Add(2*time.Hour), "chain-79", 1, - cryptoutil.NewCryptoIdentityFromIntSeed(80).ProviderConsAddress())) - - providerKeeper.QueueGlobalSlashEntry(ctx, - providertypes.NewGlobalSlashEntry(time.Now().Add(3*time.Hour), "chain-80", 1, - cryptoutil.NewCryptoIdentityFromIntSeed(81).ProviderConsAddress())) - - // Delete entries for chain-78, confirm those are deleted, and the other two remain - providerKeeper.DeleteGlobalSlashEntriesForConsumer(ctx, "chain-78") - allEntries := providerKeeper.GetAllGlobalSlashEntries(ctx) - require.Equal(t, 2, len(allEntries)) - require.Equal(t, "chain-79", allEntries[0].ConsumerChainID) - require.Equal(t, "chain-80", allEntries[1].ConsumerChainID) -} - -// TestGlobalSlashEntryDeletion tests the deletion function for -// global slash entries with assertion of FIFO ordering. -func TestGlobalSlashEntryDeletion(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - now := time.Now() - - entries := providerKeeper.GetAllGlobalSlashEntries(ctx) - require.Equal(t, 0, len(entries)) - - providerConsAddrs := []providertypes.ProviderConsAddress{ - cryptoutil.NewCryptoIdentityFromIntSeed(1).ProviderConsAddress(), - cryptoutil.NewCryptoIdentityFromIntSeed(2).ProviderConsAddress(), - cryptoutil.NewCryptoIdentityFromIntSeed(3).ProviderConsAddress(), - cryptoutil.NewCryptoIdentityFromIntSeed(4).ProviderConsAddress(), - cryptoutil.NewCryptoIdentityFromIntSeed(5).ProviderConsAddress(), - cryptoutil.NewCryptoIdentityFromIntSeed(6).ProviderConsAddress(), - cryptoutil.NewCryptoIdentityFromIntSeed(7).ProviderConsAddress(), - } - - // Instantiate entries in the expected order we wish to get them back as (ordered by recv time) - entries = []providertypes.GlobalSlashEntry{} - entries = append(entries, providertypes.NewGlobalSlashEntry(now, "chain-0", 1, providerConsAddrs[0])) - entries = append(entries, providertypes.NewGlobalSlashEntry(now.Add(time.Hour).UTC(), "chain-1", 178, providerConsAddrs[1])) - entries = append(entries, providertypes.NewGlobalSlashEntry(now.Add(2*time.Hour).Local(), "chain-2", 89, providerConsAddrs[2])) - entries = append(entries, providertypes.NewGlobalSlashEntry(now.Add(3*time.Hour).In(time.FixedZone("UTC-8", -8*60*60)), "chain-3", 23423, providerConsAddrs[3])) - entries = append(entries, providertypes.NewGlobalSlashEntry(now.Add(4*time.Hour).Local(), "chain-4", 323, providerConsAddrs[4])) - entries = append(entries, providertypes.NewGlobalSlashEntry(now.Add(5*time.Hour).UTC(), "chain-5", 18, providerConsAddrs[5])) - entries = append(entries, providertypes.NewGlobalSlashEntry(now.Add(6*time.Hour).Local(), "chain-6", 2, providerConsAddrs[6])) - - // Instantiate shuffled copy of above slice - shuffledEntries := append([]providertypes.GlobalSlashEntry{}, entries...) - seed := time.Now().UnixNano() - rng := rand.New(rand.NewSource(seed)) - rng.Shuffle(len(shuffledEntries), func(i, j int) { - shuffledEntries[i], shuffledEntries[j] = shuffledEntries[j], shuffledEntries[i] - }) - - // Queue 7 slash packets with various block times in random order - for _, entry := range shuffledEntries { - providerKeeper.QueueGlobalSlashEntry(ctx, entry) - } - - gotEntries := providerKeeper.GetAllGlobalSlashEntries(ctx) - require.Equal(t, 7, len(gotEntries)) - - // Assert obtained order is decided upon via packet recvTime, not insertion order - for i, gotEntry := range gotEntries { - expectedEntry := entries[i] - require.Equal(t, expectedEntry, gotEntry) - } - - // Confirm no mutations have occurred from test helper - gotEntries = providerKeeper.GetAllGlobalSlashEntries(ctx) - require.Equal(t, 7, len(gotEntries)) - - // Delete packets 1, 3, 5 (0-indexed) - providerKeeper.DeleteGlobalSlashEntries(ctx, gotEntries[1], gotEntries[3], gotEntries[5]) - - // Assert deletion and ordering - gotEntries = providerKeeper.GetAllGlobalSlashEntries(ctx) - require.Equal(t, 4, len(gotEntries)) - require.Equal(t, "chain-0", gotEntries[0].ConsumerChainID) - // entry 1 was deleted - require.Equal(t, "chain-2", gotEntries[1].ConsumerChainID) - // entry 3 was deleted - require.Equal(t, "chain-4", gotEntries[2].ConsumerChainID) - // entry 5 was deleted - require.Equal(t, "chain-6", gotEntries[3].ConsumerChainID) -} - -// TestThrottledPacketData tests chain-specific throttled packet data queuing, -// iteration and deletion functionality. -func TestThrottledPacketData(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - providerKeeper.SetParams(ctx, providertypes.DefaultParams()) - - packetDataForMultipleConsumers := []struct { - chainID string - instances []throttledPacketDataInstance - - // Expected order of data instances after retrieval from store, before deletion (specified by instance index) - expectedOrder []int - // Data instances to delete (specified by instance index) - toDelete []int - // Expected order of data instances after deletion (specified by instance index) - expectedOrderAfterDeletion []int - }{ - // Note, duplicate ibc sequence numbers are not tested, as we assume ibc behaves correctly - { - chainID: "chain-0", - instances: []throttledPacketDataInstance{ - {IbcSeqNum: 0, Data: testkeeper.GetNewSlashPacketData()}, - {IbcSeqNum: 1, Data: testkeeper.GetNewVSCMaturedPacketData()}, - {IbcSeqNum: 2, Data: testkeeper.GetNewSlashPacketData()}, - {IbcSeqNum: 3, Data: testkeeper.GetNewVSCMaturedPacketData()}, - {IbcSeqNum: 4, Data: testkeeper.GetNewSlashPacketData()}, - }, - expectedOrder: []int{0, 1, 2, 3, 4}, - toDelete: []int{0, 2, 4}, - expectedOrderAfterDeletion: []int{1, 3}, - }, - { - chainID: "chain-7", - instances: []throttledPacketDataInstance{ - {IbcSeqNum: 96, Data: testkeeper.GetNewSlashPacketData()}, - {IbcSeqNum: 78, Data: testkeeper.GetNewVSCMaturedPacketData()}, - {IbcSeqNum: 12, Data: testkeeper.GetNewSlashPacketData()}, - {IbcSeqNum: 0, Data: testkeeper.GetNewVSCMaturedPacketData()}, - {IbcSeqNum: 1, Data: testkeeper.GetNewSlashPacketData()}, - {IbcSeqNum: 78972, Data: testkeeper.GetNewVSCMaturedPacketData()}, - {IbcSeqNum: 9999999999999999999, Data: testkeeper.GetNewSlashPacketData()}, - }, - expectedOrder: []int{3, 4, 2, 1, 0, 5, 6}, - toDelete: []int{0, 1, 2, 3, 4, 5}, - expectedOrderAfterDeletion: []int{6}, - }, - { - chainID: "chain-thats-not-0-or-7", - instances: []throttledPacketDataInstance{ - {IbcSeqNum: 9, Data: testkeeper.GetNewSlashPacketData()}, - {IbcSeqNum: 8, Data: testkeeper.GetNewSlashPacketData()}, - {IbcSeqNum: 7, Data: testkeeper.GetNewSlashPacketData()}, - {IbcSeqNum: 6, Data: testkeeper.GetNewSlashPacketData()}, - {IbcSeqNum: 5, Data: testkeeper.GetNewVSCMaturedPacketData()}, - {IbcSeqNum: 1, Data: testkeeper.GetNewVSCMaturedPacketData()}, - }, - expectedOrder: []int{5, 4, 3, 2, 1, 0}, - toDelete: []int{1, 2, 3, 4, 5}, - expectedOrderAfterDeletion: []int{0}, - }, - } - - // Queue all packet data at once - for _, chainData := range packetDataForMultipleConsumers { - for _, dataInstance := range chainData.instances { - err := providerKeeper.QueueThrottledPacketData(ctx, chainData.chainID, dataInstance.IbcSeqNum, dataInstance.Data) - require.NoError(t, err) - } - } - - // Assert retrieval ordering for each chain - for _, chainData := range packetDataForMultipleConsumers { - expectedInstances := getOrderedInstances(chainData.instances, chainData.expectedOrder) - assertPendingPacketDataOrdering(t, &providerKeeper, ctx, chainData.chainID, expectedInstances) - } - - // Delete specified data all at once - for _, chainData := range packetDataForMultipleConsumers { - for _, i := range chainData.toDelete { - providerKeeper.DeleteThrottledPacketData(ctx, chainData.chainID, chainData.instances[i].IbcSeqNum) - } - } - - // Assert retrieval ordering after deletion for each chain - for _, chainData := range packetDataForMultipleConsumers { - expectedInstances := getOrderedInstances(chainData.instances, chainData.expectedOrderAfterDeletion) - assertPendingPacketDataOrdering(t, &providerKeeper, ctx, chainData.chainID, expectedInstances) - } -} - -func TestGetLeadingVSCMaturedData(t *testing.T) { - // Instantiate some sample data - slashData := getTenSampleSlashPacketData() - vscMaturedData := getTenSampleVSCMaturedPacketData() - - testCases := []struct { - name string - dataToQueue []throttledPacketDataInstance - expectedReturnData []ccvtypes.VSCMaturedPacketData - expectedReturnSeqs []uint64 - }{ - { - name: "no data", - dataToQueue: []throttledPacketDataInstance{}, - expectedReturnData: []ccvtypes.VSCMaturedPacketData{}, - expectedReturnSeqs: []uint64{}, - }, - { - name: "one slash", - dataToQueue: []throttledPacketDataInstance{ - {IbcSeqNum: 889, Data: slashData[0]}, - }, - expectedReturnData: []ccvtypes.VSCMaturedPacketData{}, - expectedReturnSeqs: []uint64{}, - }, - { - name: "one vsc matured", - dataToQueue: []throttledPacketDataInstance{ - {IbcSeqNum: 54, Data: vscMaturedData[0]}, - }, - expectedReturnData: []ccvtypes.VSCMaturedPacketData{vscMaturedData[0]}, - expectedReturnSeqs: []uint64{54}, - }, - { - name: "one vsc matured trailing one slash", - dataToQueue: []throttledPacketDataInstance{ - {IbcSeqNum: 87, Data: slashData[0]}, - {IbcSeqNum: 88, Data: vscMaturedData[0]}, - }, - expectedReturnData: []ccvtypes.VSCMaturedPacketData{}, // Nothing returned - expectedReturnSeqs: []uint64{}, // Nothing returned - }, - { - name: "one vsc matured trailing multiple slash", - dataToQueue: []throttledPacketDataInstance{ - {IbcSeqNum: 87, Data: slashData[0]}, - {IbcSeqNum: 88, Data: slashData[1]}, - {IbcSeqNum: 89, Data: slashData[2]}, - {IbcSeqNum: 90, Data: vscMaturedData[0]}, - }, - expectedReturnData: []ccvtypes.VSCMaturedPacketData{}, // Nothing returned - expectedReturnSeqs: []uint64{}, // Nothing returned - }, - { - name: "one vsc matured leading multiple slash", - dataToQueue: []throttledPacketDataInstance{ - {IbcSeqNum: 87, Data: vscMaturedData[0]}, - {IbcSeqNum: 88, Data: slashData[0]}, - {IbcSeqNum: 89, Data: slashData[1]}, - {IbcSeqNum: 90, Data: slashData[2]}, - }, - expectedReturnData: []ccvtypes.VSCMaturedPacketData{vscMaturedData[0]}, - expectedReturnSeqs: []uint64{87}, - }, - { - name: "multiple vsc matured leading multiple slash", - dataToQueue: []throttledPacketDataInstance{ - {IbcSeqNum: 102, Data: vscMaturedData[0]}, - {IbcSeqNum: 103, Data: vscMaturedData[1]}, - {IbcSeqNum: 104, Data: vscMaturedData[2]}, - {IbcSeqNum: 105, Data: slashData[0]}, - {IbcSeqNum: 106, Data: slashData[1]}, - {IbcSeqNum: 107, Data: slashData[2]}, - }, - expectedReturnData: []ccvtypes.VSCMaturedPacketData{vscMaturedData[0], vscMaturedData[1], vscMaturedData[2]}, - expectedReturnSeqs: []uint64{102, 103, 104}, - }, - } - - for _, tc := range testCases { - - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - providerKeeper.SetParams(ctx, providertypes.DefaultParams()) - - // Queue a slash and vsc matured packet data for some random chain. - // These values should never be returned. - err := providerKeeper.QueueThrottledSlashPacketData(ctx, "some-rando-chain", 77, testkeeper.GetNewSlashPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "some-rando-chain", 97, testkeeper.GetNewVSCMaturedPacketData()) - require.NoError(t, err) - - // Queue the data to test against - for _, dataInstance := range tc.dataToQueue { - err := providerKeeper.QueueThrottledPacketData(ctx, "chain-99", dataInstance.IbcSeqNum, dataInstance.Data) - require.NoError(t, err) - } - - // Obtain data from iterator - returnedData, ibcSeqNums := providerKeeper.GetLeadingVSCMaturedData(ctx, "chain-99") - - // Assert the returned data is as expected - require.Equal(t, tc.expectedReturnData, returnedData) - require.Equal(t, tc.expectedReturnSeqs, ibcSeqNums) - } -} - -func TestGetSlashAndTrailingData(t *testing.T) { - // Instantiate some data to test against - someSlashData := getTenSampleSlashPacketData() - someVSCMaturedData := getTenSampleVSCMaturedPacketData() - - testCases := []struct { - name string - dataToQueue []throttledPacketDataInstance - expectedSlashFound bool - expectedSlashData ccvtypes.SlashPacketData - expectedVSCMaturedData []ccvtypes.VSCMaturedPacketData - expectedIBCSeqNums []uint64 - }{ - { - name: "Empty queue", - dataToQueue: []throttledPacketDataInstance{}, - expectedSlashFound: false, - expectedSlashData: ccvtypes.SlashPacketData{}, // single zero value returned. - expectedVSCMaturedData: []ccvtypes.VSCMaturedPacketData{}, - expectedIBCSeqNums: []uint64{}, - }, - { - name: "Queue only one slash data", - dataToQueue: []throttledPacketDataInstance{ - {IbcSeqNum: 1, Data: someSlashData[0]}, - }, - expectedSlashFound: true, - expectedSlashData: someSlashData[0], - expectedVSCMaturedData: []ccvtypes.VSCMaturedPacketData{}, - expectedIBCSeqNums: []uint64{1}, - }, - { - name: "Queue two vsc matured behind slash data", - dataToQueue: []throttledPacketDataInstance{ - {IbcSeqNum: 80, Data: someSlashData[3]}, - {IbcSeqNum: 82, Data: someVSCMaturedData[0]}, - {IbcSeqNum: 83, Data: someVSCMaturedData[1]}, - }, - expectedSlashFound: true, - expectedSlashData: someSlashData[3], - expectedVSCMaturedData: []ccvtypes.VSCMaturedPacketData{someVSCMaturedData[0], someVSCMaturedData[1]}, - expectedIBCSeqNums: []uint64{80, 82, 83}, - }, - { - name: "Queue two vsc matured behind 4 slash data", - dataToQueue: []throttledPacketDataInstance{ - {IbcSeqNum: 80, Data: someSlashData[1]}, // Only returned value - {IbcSeqNum: 82, Data: someSlashData[2]}, - {IbcSeqNum: 83, Data: someSlashData[3]}, - {IbcSeqNum: 84, Data: someSlashData[4]}, - {IbcSeqNum: 85, Data: someVSCMaturedData[1]}, - {IbcSeqNum: 86, Data: someVSCMaturedData[2]}, - }, - expectedSlashFound: true, - expectedSlashData: someSlashData[1], - expectedVSCMaturedData: []ccvtypes.VSCMaturedPacketData{}, - expectedIBCSeqNums: []uint64{80}, - }, - { - name: "Queue vsc matured data behind slash data, ending with another slash data", - dataToQueue: []throttledPacketDataInstance{ - {IbcSeqNum: 47238, Data: someSlashData[1]}, - {IbcSeqNum: 47239, Data: someVSCMaturedData[0]}, - {IbcSeqNum: 47240, Data: someVSCMaturedData[1]}, - {IbcSeqNum: 47241, Data: someVSCMaturedData[2]}, - {IbcSeqNum: 47242, Data: someVSCMaturedData[3]}, - {IbcSeqNum: 47243, Data: someSlashData[2]}, // Not returned - }, - expectedSlashFound: true, - expectedSlashData: someSlashData[1], - expectedVSCMaturedData: []ccvtypes.VSCMaturedPacketData{ - someVSCMaturedData[0], someVSCMaturedData[1], someVSCMaturedData[2], someVSCMaturedData[3], - }, - expectedIBCSeqNums: []uint64{47238, 47239, 47240, 47241, 47242}, - }, - } - - for _, tc := range testCases { - - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - providerKeeper.SetParams(ctx, providertypes.DefaultParams()) - - // Queue a slash and vsc matured packet data for some random chain. - // These values should never be returned. - err := providerKeeper.QueueThrottledSlashPacketData(ctx, "some-rando-chain", 77, testkeeper.GetNewSlashPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "some-rando-chain", 97, testkeeper.GetNewVSCMaturedPacketData()) - require.NoError(t, err) - - // Queue the data to test - for _, dataInstance := range tc.dataToQueue { - err := providerKeeper.QueueThrottledPacketData(ctx, "chain-49", dataInstance.IbcSeqNum, dataInstance.Data) - require.NoError(t, err) - } - - // Retrieve the data, and assert that it is correct - slashFound, slashData, vscMaturedData, ibcSeqNums := providerKeeper.GetSlashAndTrailingData(ctx, "chain-49") - require.Equal(t, tc.expectedSlashFound, slashFound, tc.name) - require.Equal(t, tc.expectedSlashData, slashData, tc.name) - require.Equal(t, tc.expectedVSCMaturedData, vscMaturedData, tc.name) - require.Equal(t, tc.expectedIBCSeqNums, ibcSeqNums, tc.name) - } -} - -// TestDeleteThrottledPacketDataForConsumer tests the DeleteThrottledPacketDataForConsumer method. -func TestDeleteThrottledPacketDataForConsumer(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - providerKeeper.SetParams(ctx, providertypes.DefaultParams()) - - // Queue slash and a VSC matured packet data for chain-48 - err := providerKeeper.QueueThrottledSlashPacketData(ctx, "chain-48", 0, testkeeper.GetNewSlashPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-48", 1, testkeeper.GetNewVSCMaturedPacketData()) - require.NoError(t, err) - - // Queue 3 slash, and 4 vsc matured packet data instances for chain-49 - err = providerKeeper.QueueThrottledSlashPacketData(ctx, "chain-49", 0, testkeeper.GetNewSlashPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledSlashPacketData(ctx, "chain-49", 1, testkeeper.GetNewSlashPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledSlashPacketData(ctx, "chain-49", 2, testkeeper.GetNewSlashPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-49", 3, testkeeper.GetNewVSCMaturedPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-49", 4, testkeeper.GetNewVSCMaturedPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-49", 5, testkeeper.GetNewVSCMaturedPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledVSCMaturedPacketData(ctx, "chain-49", 6, testkeeper.GetNewVSCMaturedPacketData()) - require.NoError(t, err) - - // Delete all packet data for chain-49, confirm they are deleted - providerKeeper.DeleteThrottledPacketDataForConsumer(ctx, "chain-49") - slashData, vscMaturedData, _, _ := providerKeeper.GetAllThrottledPacketData(ctx, "chain-49") - require.Empty(t, slashData) - require.Empty(t, vscMaturedData) - - // Confirm size of queue is now 0 - require.Equal(t, uint64(0), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-49")) - - // Confirm packet data for chain-48 is not deleted - slashData, vscMaturedData, _, _ = providerKeeper.GetAllThrottledPacketData(ctx, "chain-48") - require.Len(t, slashData, 1) - require.Len(t, vscMaturedData, 1) -} - -// TestPanicIfTooMuchThrottledPacketData tests that the provider panics -// when the number of throttled (queued) packets exceeds the max allowed by params. -func TestPanicIfTooMuchThrottledPacketData(t *testing.T) { - testCases := []struct { - max int64 - }{ - {max: 3}, // Max must be greater than 2 since we queue 2 packets for another chain in the test - {max: 5}, - {max: 10}, - {max: 15}, - {max: 25}, - {max: 100}, - } - - for _, tc := range testCases { - - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - // Set max throttled packets param - defaultParams := providertypes.DefaultParams() - defaultParams.MaxThrottledPackets = tc.max - providerKeeper.SetParams(ctx, defaultParams) - - seed := time.Now().UnixNano() - rng := rand.New(rand.NewSource(seed)) - - // Queuing up a couple data instances for another chain shouldn't matter - err := providerKeeper.QueueThrottledPacketData(ctx, "chain-17", 0, testkeeper.GetNewSlashPacketData()) - require.NoError(t, err) - err = providerKeeper.QueueThrottledPacketData(ctx, "chain-17", 1, testkeeper.GetNewVSCMaturedPacketData()) - require.NoError(t, err) - - // Queue packet data instances until we reach the max (some slash packets, some VSC matured packets) - reachedMax := false - for i := 0; i < int(tc.max); i++ { - randBool := rng.Intn(2) == 0 - var data interface{} - if randBool { - data = testkeeper.GetNewSlashPacketData() - } else { - data = testkeeper.GetNewVSCMaturedPacketData() - } - // Panic only if we've reached the max - if i == int(tc.max-1) { - require.Panics(t, func() { - _ = providerKeeper.QueueThrottledPacketData(ctx, "chain-88", uint64(i), data) - }) - reachedMax = true - } else { - err := providerKeeper.QueueThrottledPacketData(ctx, "chain-88", uint64(i), data) - require.NoError(t, err) - } - } - require.True(t, reachedMax) - } -} - -// TestThrottledPacketDataSize tests the getter, setter and incrementer for throttled packet data size. -func TestThrottledPacketDataSize(t *testing.T) { - providerKeeper, ctx, ctrl, _ := testkeeper.GetProviderKeeperAndCtx(t, testkeeper.NewInMemKeeperParams(t)) - defer ctrl.Finish() - - // Set params so we can use the default max throttled packet data size - params := providertypes.DefaultParams() - providerKeeper.SetParams(ctx, params) - - // Confirm initial size is 0 - require.Equal(t, uint64(0), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-0")) - - // Set throttled packet data size and confirm it was set - providerKeeper.SetThrottledPacketDataSize(ctx, "chain-0", 10) - require.Equal(t, uint64(10), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-0")) - - // Increment throttled packet data size and confirm it was incremented - providerKeeper.IncrementThrottledPacketDataSize(ctx, "chain-0") - require.Equal(t, uint64(11), providerKeeper.GetThrottledPacketDataSize(ctx, "chain-0")) -} - // TestSlashMeter tests the getter and setter for the slash gas meter func TestSlashMeter(t *testing.T) { testCases := []struct { @@ -1320,65 +538,3 @@ func TestSlashMeterReplenishTimeCandidate(t *testing.T) { require.Equal(t, tc.blockTime.Add(tc.replenishPeriod).UTC(), gotTime) } } - -// Struct used for TestPendingPacketData and helpers -type throttledPacketDataInstance struct { - IbcSeqNum uint64 - Data interface{} -} - -// getAllThrottledPacketDataInstances returns all throttled packet data instances in order -// from the chain-specific packet data queue. -func getAllThrottledPacketDataInstances(ctx sdktypes.Context, k *keeper.Keeper, consumerChainId string) (instances []throttledPacketDataInstance) { - _, _, allData, ibcSeqNums := k.GetAllThrottledPacketData(ctx, consumerChainId) - instances = []throttledPacketDataInstance{} - for idx, data := range allData { - instances = append(instances, throttledPacketDataInstance{ - IbcSeqNum: ibcSeqNums[idx], - Data: data, - }) - } - return instances -} - -// getOrderedInstances returns the given instances in order, specified by the given indexes -func getOrderedInstances(instances []throttledPacketDataInstance, orderbyIdx []int) (orderedInstances []throttledPacketDataInstance) { - toReturn := []throttledPacketDataInstance{} - for _, idx := range orderbyIdx { - toReturn = append(toReturn, instances[idx]) - } - return toReturn -} - -// Asserts that the throttled packet data retrieved for this consumer chain matches what's expected -func assertPendingPacketDataOrdering(t *testing.T, k *keeper.Keeper, ctx sdktypes.Context, - consumerChainId string, expectedInstances []throttledPacketDataInstance, -) { - t.Helper() - // Get all packet data for this chain - obtainedInstances := getAllThrottledPacketDataInstances(ctx, k, consumerChainId) - // No extra data should be present - require.Equal(t, len(expectedInstances), len(obtainedInstances)) - // Assert order and correct serialization/deserialization for each data instance - for i, obtainedInstance := range obtainedInstances { - require.Equal(t, expectedInstances[i], obtainedInstance) - } -} - -// getTenSampleSlashPacketData returns 10 randomized slash packet data instances for testing -func getTenSampleSlashPacketData() []ccvtypes.SlashPacketData { - sampleData := []ccvtypes.SlashPacketData{} - for i := 0; i < 10; i++ { - sampleData = append(sampleData, testkeeper.GetNewSlashPacketData()) - } - return sampleData -} - -// getTenSampleVSCMaturedPacketData returns 10 randomized VSC matured packet data instances for testing -func getTenSampleVSCMaturedPacketData() []ccvtypes.VSCMaturedPacketData { - sampleData := []ccvtypes.VSCMaturedPacketData{} - for i := 0; i < 10; i++ { - sampleData = append(sampleData, testkeeper.GetNewVSCMaturedPacketData()) - } - return sampleData -} diff --git a/x/ccv/provider/module.go b/x/ccv/provider/module.go index 82891c27c7..5aa743ec2d 100644 --- a/x/ccv/provider/module.go +++ b/x/ccv/provider/module.go @@ -137,6 +137,8 @@ func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { am.keeper.BeginBlockInit(ctx) // Stop and remove state for any consumer chains that are due to be stopped via pending consumer removal proposals am.keeper.BeginBlockCCR(ctx) + // Check for replenishing slash meter before any slash packets are processed for this block + am.keeper.BeginBlockCIS(ctx) } // EndBlock implements the AppModule interface diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 9fc9178e09..0ff8aba62c 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -637,8 +637,6 @@ type QueryThrottleStateResponse struct { // next time the slash meter could potentially be replenished, iff it's not // full NextReplenishCandidate time.Time `protobuf:"bytes,3,opt,name=next_replenish_candidate,json=nextReplenishCandidate,proto3,stdtime" json:"next_replenish_candidate"` - // data relevant to currently throttled slash packets - Packets []*ThrottledSlashPacket `protobuf:"bytes,4,rep,name=packets,proto3" json:"packets,omitempty"` } func (m *QueryThrottleStateResponse) Reset() { *m = QueryThrottleStateResponse{} } @@ -695,262 +693,6 @@ func (m *QueryThrottleStateResponse) GetNextReplenishCandidate() time.Time { return time.Time{} } -func (m *QueryThrottleStateResponse) GetPackets() []*ThrottledSlashPacket { - if m != nil { - return m.Packets - } - return nil -} - -type QueryThrottledConsumerPacketDataRequest struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` -} - -func (m *QueryThrottledConsumerPacketDataRequest) Reset() { - *m = QueryThrottledConsumerPacketDataRequest{} -} -func (m *QueryThrottledConsumerPacketDataRequest) String() string { return proto.CompactTextString(m) } -func (*QueryThrottledConsumerPacketDataRequest) ProtoMessage() {} -func (*QueryThrottledConsumerPacketDataRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_422512d7b7586cd7, []int{15} -} -func (m *QueryThrottledConsumerPacketDataRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryThrottledConsumerPacketDataRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryThrottledConsumerPacketDataRequest.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryThrottledConsumerPacketDataRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryThrottledConsumerPacketDataRequest.Merge(m, src) -} -func (m *QueryThrottledConsumerPacketDataRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryThrottledConsumerPacketDataRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryThrottledConsumerPacketDataRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryThrottledConsumerPacketDataRequest proto.InternalMessageInfo - -func (m *QueryThrottledConsumerPacketDataRequest) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -type QueryThrottledConsumerPacketDataResponse struct { - ChainId string `protobuf:"bytes,1,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` - Size_ uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` - PacketDataInstances []ThrottledPacketDataWrapper `protobuf:"bytes,3,rep,name=packetDataInstances,proto3" json:"packetDataInstances"` -} - -func (m *QueryThrottledConsumerPacketDataResponse) Reset() { - *m = QueryThrottledConsumerPacketDataResponse{} -} -func (m *QueryThrottledConsumerPacketDataResponse) String() string { return proto.CompactTextString(m) } -func (*QueryThrottledConsumerPacketDataResponse) ProtoMessage() {} -func (*QueryThrottledConsumerPacketDataResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_422512d7b7586cd7, []int{16} -} -func (m *QueryThrottledConsumerPacketDataResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryThrottledConsumerPacketDataResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryThrottledConsumerPacketDataResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *QueryThrottledConsumerPacketDataResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryThrottledConsumerPacketDataResponse.Merge(m, src) -} -func (m *QueryThrottledConsumerPacketDataResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryThrottledConsumerPacketDataResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryThrottledConsumerPacketDataResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryThrottledConsumerPacketDataResponse proto.InternalMessageInfo - -func (m *QueryThrottledConsumerPacketDataResponse) GetChainId() string { - if m != nil { - return m.ChainId - } - return "" -} - -func (m *QueryThrottledConsumerPacketDataResponse) GetSize_() uint64 { - if m != nil { - return m.Size_ - } - return 0 -} - -func (m *QueryThrottledConsumerPacketDataResponse) GetPacketDataInstances() []ThrottledPacketDataWrapper { - if m != nil { - return m.PacketDataInstances - } - return nil -} - -// A query wrapper type for the global entry and data relevant to a throttled -// slash packet. -type ThrottledSlashPacket struct { - GlobalEntry GlobalSlashEntry `protobuf:"bytes,1,opt,name=global_entry,json=globalEntry,proto3" json:"global_entry"` - Data types.SlashPacketData `protobuf:"bytes,2,opt,name=data,proto3" json:"data"` -} - -func (m *ThrottledSlashPacket) Reset() { *m = ThrottledSlashPacket{} } -func (m *ThrottledSlashPacket) String() string { return proto.CompactTextString(m) } -func (*ThrottledSlashPacket) ProtoMessage() {} -func (*ThrottledSlashPacket) Descriptor() ([]byte, []int) { - return fileDescriptor_422512d7b7586cd7, []int{17} -} -func (m *ThrottledSlashPacket) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ThrottledSlashPacket) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ThrottledSlashPacket.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ThrottledSlashPacket) XXX_Merge(src proto.Message) { - xxx_messageInfo_ThrottledSlashPacket.Merge(m, src) -} -func (m *ThrottledSlashPacket) XXX_Size() int { - return m.Size() -} -func (m *ThrottledSlashPacket) XXX_DiscardUnknown() { - xxx_messageInfo_ThrottledSlashPacket.DiscardUnknown(m) -} - -var xxx_messageInfo_ThrottledSlashPacket proto.InternalMessageInfo - -func (m *ThrottledSlashPacket) GetGlobalEntry() GlobalSlashEntry { - if m != nil { - return m.GlobalEntry - } - return GlobalSlashEntry{} -} - -func (m *ThrottledSlashPacket) GetData() types.SlashPacketData { - if m != nil { - return m.Data - } - return types.SlashPacketData{} -} - -// ThrottledPacketDataWrapper contains either SlashPacketData or -// VSCMaturedPacketData -type ThrottledPacketDataWrapper struct { - // Types that are valid to be assigned to Data: - // *ThrottledPacketDataWrapper_SlashPacket - // *ThrottledPacketDataWrapper_VscMaturedPacket - Data isThrottledPacketDataWrapper_Data `protobuf_oneof:"data"` -} - -func (m *ThrottledPacketDataWrapper) Reset() { *m = ThrottledPacketDataWrapper{} } -func (m *ThrottledPacketDataWrapper) String() string { return proto.CompactTextString(m) } -func (*ThrottledPacketDataWrapper) ProtoMessage() {} -func (*ThrottledPacketDataWrapper) Descriptor() ([]byte, []int) { - return fileDescriptor_422512d7b7586cd7, []int{18} -} -func (m *ThrottledPacketDataWrapper) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *ThrottledPacketDataWrapper) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_ThrottledPacketDataWrapper.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *ThrottledPacketDataWrapper) XXX_Merge(src proto.Message) { - xxx_messageInfo_ThrottledPacketDataWrapper.Merge(m, src) -} -func (m *ThrottledPacketDataWrapper) XXX_Size() int { - return m.Size() -} -func (m *ThrottledPacketDataWrapper) XXX_DiscardUnknown() { - xxx_messageInfo_ThrottledPacketDataWrapper.DiscardUnknown(m) -} - -var xxx_messageInfo_ThrottledPacketDataWrapper proto.InternalMessageInfo - -type isThrottledPacketDataWrapper_Data interface { - isThrottledPacketDataWrapper_Data() - MarshalTo([]byte) (int, error) - Size() int -} - -type ThrottledPacketDataWrapper_SlashPacket struct { - SlashPacket *types.SlashPacketData `protobuf:"bytes,1,opt,name=slash_packet,json=slashPacket,proto3,oneof" json:"slash_packet,omitempty"` -} -type ThrottledPacketDataWrapper_VscMaturedPacket struct { - VscMaturedPacket *types.VSCMaturedPacketData `protobuf:"bytes,2,opt,name=vsc_matured_packet,json=vscMaturedPacket,proto3,oneof" json:"vsc_matured_packet,omitempty"` -} - -func (*ThrottledPacketDataWrapper_SlashPacket) isThrottledPacketDataWrapper_Data() {} -func (*ThrottledPacketDataWrapper_VscMaturedPacket) isThrottledPacketDataWrapper_Data() {} - -func (m *ThrottledPacketDataWrapper) GetData() isThrottledPacketDataWrapper_Data { - if m != nil { - return m.Data - } - return nil -} - -func (m *ThrottledPacketDataWrapper) GetSlashPacket() *types.SlashPacketData { - if x, ok := m.GetData().(*ThrottledPacketDataWrapper_SlashPacket); ok { - return x.SlashPacket - } - return nil -} - -func (m *ThrottledPacketDataWrapper) GetVscMaturedPacket() *types.VSCMaturedPacketData { - if x, ok := m.GetData().(*ThrottledPacketDataWrapper_VscMaturedPacket); ok { - return x.VscMaturedPacket - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*ThrottledPacketDataWrapper) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*ThrottledPacketDataWrapper_SlashPacket)(nil), - (*ThrottledPacketDataWrapper_VscMaturedPacket)(nil), - } -} - type QueryRegisteredConsumerRewardDenomsRequest struct { } @@ -962,7 +704,7 @@ func (m *QueryRegisteredConsumerRewardDenomsRequest) String() string { } func (*QueryRegisteredConsumerRewardDenomsRequest) ProtoMessage() {} func (*QueryRegisteredConsumerRewardDenomsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_422512d7b7586cd7, []int{19} + return fileDescriptor_422512d7b7586cd7, []int{15} } func (m *QueryRegisteredConsumerRewardDenomsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1003,7 +745,7 @@ func (m *QueryRegisteredConsumerRewardDenomsResponse) String() string { } func (*QueryRegisteredConsumerRewardDenomsResponse) ProtoMessage() {} func (*QueryRegisteredConsumerRewardDenomsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_422512d7b7586cd7, []int{20} + return fileDescriptor_422512d7b7586cd7, []int{16} } func (m *QueryRegisteredConsumerRewardDenomsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1055,10 +797,6 @@ func init() { proto.RegisterType((*QueryValidatorProviderAddrResponse)(nil), "interchain_security.ccv.provider.v1.QueryValidatorProviderAddrResponse") proto.RegisterType((*QueryThrottleStateRequest)(nil), "interchain_security.ccv.provider.v1.QueryThrottleStateRequest") proto.RegisterType((*QueryThrottleStateResponse)(nil), "interchain_security.ccv.provider.v1.QueryThrottleStateResponse") - proto.RegisterType((*QueryThrottledConsumerPacketDataRequest)(nil), "interchain_security.ccv.provider.v1.QueryThrottledConsumerPacketDataRequest") - proto.RegisterType((*QueryThrottledConsumerPacketDataResponse)(nil), "interchain_security.ccv.provider.v1.QueryThrottledConsumerPacketDataResponse") - proto.RegisterType((*ThrottledSlashPacket)(nil), "interchain_security.ccv.provider.v1.ThrottledSlashPacket") - proto.RegisterType((*ThrottledPacketDataWrapper)(nil), "interchain_security.ccv.provider.v1.ThrottledPacketDataWrapper") proto.RegisterType((*QueryRegisteredConsumerRewardDenomsRequest)(nil), "interchain_security.ccv.provider.v1.QueryRegisteredConsumerRewardDenomsRequest") proto.RegisterType((*QueryRegisteredConsumerRewardDenomsResponse)(nil), "interchain_security.ccv.provider.v1.QueryRegisteredConsumerRewardDenomsResponse") } @@ -1068,90 +806,74 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1323 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 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, 0x93, 0x86, 0x61, 0x13, 0xd6, 0x20, 0xac, 0xab, 0xdf, 0x3b, 0xed, 0x7e, 0xad, 0x8b, - 0xc6, 0x83, 0x5d, 0xf3, 0xb7, 0x15, 0x60, 0xb6, 0x31, 0x25, 0xbe, 0x56, 0x2e, 0xfe, 0x17, 0x00, - 0x00, 0xff, 0xff, 0x84, 0xab, 0xda, 0x7b, 0x39, 0x13, 0x00, 0x00, + // 1059 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0x5e, 0x27, 0x34, 0x24, 0x13, 0x20, 0xd5, 0xb4, 0x94, 0xad, 0x13, 0xed, 0x16, 0x57, 0xc0, + 0xb6, 0x80, 0xdd, 0xdd, 0x5c, 0xda, 0xa2, 0x74, 0xb3, 0x1b, 0x42, 0xa8, 0xda, 0xaa, 0xc1, 0xa9, + 0x40, 0x02, 0x84, 0x35, 0xb1, 0x87, 0x5d, 0x4b, 0x5e, 0x8f, 0x3b, 0x33, 0xeb, 0x34, 0x42, 0x1c, + 0xe0, 0x00, 0x3d, 0x56, 0x42, 0x70, 0xee, 0x9f, 0xd3, 0x1b, 0x45, 0xbd, 0x70, 0x2a, 0x28, 0xe1, + 0xc0, 0x11, 0x71, 0x47, 0x42, 0x1e, 0x8f, 0xbd, 0xbf, 0x9c, 0x5d, 0x67, 0x9b, 0x5b, 0xf6, 0xcd, + 0x7b, 0xdf, 0xfb, 0xbe, 0xa7, 0x37, 0xf3, 0x39, 0xc0, 0x70, 0x7d, 0x8e, 0xa9, 0xdd, 0x46, 0xae, + 0x6f, 0x31, 0x6c, 0x77, 0xa9, 0xcb, 0xf7, 0x0d, 0xdb, 0x0e, 0x8d, 0x80, 0x92, 0xd0, 0x75, 0x30, + 0x35, 0xc2, 0xaa, 0x71, 0xbf, 0x8b, 0xe9, 0xbe, 0x1e, 0x50, 0xc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ff, 0xff, 0x94, 0x26, 0xbd, 0x0a, 0x28, + 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1185,9 +907,6 @@ type QueryClient interface { // QueryThrottleState returns the main on-chain state relevant to currently // throttled slash packets QueryThrottleState(ctx context.Context, in *QueryThrottleStateRequest, opts ...grpc.CallOption) (*QueryThrottleStateResponse, error) - // QueryThrottledConsumerPacketData returns a list of pending packet data - // instances (slash packet and vsc matured) for a single consumer chain - QueryThrottledConsumerPacketData(ctx context.Context, in *QueryThrottledConsumerPacketDataRequest, opts ...grpc.CallOption) (*QueryThrottledConsumerPacketDataResponse, error) // QueryRegisteredConsumerRewardDenoms returns a list of consumer reward // denoms that are registered QueryRegisteredConsumerRewardDenoms(ctx context.Context, in *QueryRegisteredConsumerRewardDenomsRequest, opts ...grpc.CallOption) (*QueryRegisteredConsumerRewardDenomsResponse, error) @@ -1264,15 +983,6 @@ func (c *queryClient) QueryThrottleState(ctx context.Context, in *QueryThrottleS return out, nil } -func (c *queryClient) QueryThrottledConsumerPacketData(ctx context.Context, in *QueryThrottledConsumerPacketDataRequest, opts ...grpc.CallOption) (*QueryThrottledConsumerPacketDataResponse, error) { - out := new(QueryThrottledConsumerPacketDataResponse) - err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Query/QueryThrottledConsumerPacketData", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - func (c *queryClient) QueryRegisteredConsumerRewardDenoms(ctx context.Context, in *QueryRegisteredConsumerRewardDenomsRequest, opts ...grpc.CallOption) (*QueryRegisteredConsumerRewardDenomsResponse, error) { out := new(QueryRegisteredConsumerRewardDenomsResponse) err := c.cc.Invoke(ctx, "/interchain_security.ccv.provider.v1.Query/QueryRegisteredConsumerRewardDenoms", in, out, opts...) @@ -1303,9 +1013,6 @@ type QueryServer interface { // QueryThrottleState returns the main on-chain state relevant to currently // throttled slash packets QueryThrottleState(context.Context, *QueryThrottleStateRequest) (*QueryThrottleStateResponse, error) - // QueryThrottledConsumerPacketData returns a list of pending packet data - // instances (slash packet and vsc matured) for a single consumer chain - QueryThrottledConsumerPacketData(context.Context, *QueryThrottledConsumerPacketDataRequest) (*QueryThrottledConsumerPacketDataResponse, error) // QueryRegisteredConsumerRewardDenoms returns a list of consumer reward // denoms that are registered QueryRegisteredConsumerRewardDenoms(context.Context, *QueryRegisteredConsumerRewardDenomsRequest) (*QueryRegisteredConsumerRewardDenomsResponse, error) @@ -1336,9 +1043,6 @@ func (*UnimplementedQueryServer) QueryValidatorProviderAddr(ctx context.Context, func (*UnimplementedQueryServer) QueryThrottleState(ctx context.Context, req *QueryThrottleStateRequest) (*QueryThrottleStateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryThrottleState not implemented") } -func (*UnimplementedQueryServer) QueryThrottledConsumerPacketData(ctx context.Context, req *QueryThrottledConsumerPacketDataRequest) (*QueryThrottledConsumerPacketDataResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method QueryThrottledConsumerPacketData not implemented") -} func (*UnimplementedQueryServer) QueryRegisteredConsumerRewardDenoms(ctx context.Context, req *QueryRegisteredConsumerRewardDenomsRequest) (*QueryRegisteredConsumerRewardDenomsResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryRegisteredConsumerRewardDenoms not implemented") } @@ -1473,24 +1177,6 @@ func _Query_QueryThrottleState_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } -func _Query_QueryThrottledConsumerPacketData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryThrottledConsumerPacketDataRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).QueryThrottledConsumerPacketData(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/interchain_security.ccv.provider.v1.Query/QueryThrottledConsumerPacketData", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).QueryThrottledConsumerPacketData(ctx, req.(*QueryThrottledConsumerPacketDataRequest)) - } - return interceptor(ctx, in, info, handler) -} - func _Query_QueryRegisteredConsumerRewardDenoms_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(QueryRegisteredConsumerRewardDenomsRequest) if err := dec(in); err != nil { @@ -1541,10 +1227,6 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryThrottleState", Handler: _Query_QueryThrottleState_Handler, }, - { - MethodName: "QueryThrottledConsumerPacketData", - Handler: _Query_QueryThrottledConsumerPacketData_Handler, - }, { MethodName: "QueryRegisteredConsumerRewardDenoms", Handler: _Query_QueryRegisteredConsumerRewardDenoms_Handler, @@ -2007,20 +1689,6 @@ func (m *QueryThrottleStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l - if len(m.Packets) > 0 { - for iNdEx := len(m.Packets) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Packets[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x22 - } - } n4, err4 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.NextReplenishCandidate, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.NextReplenishCandidate):]) if err4 != nil { return 0, err4 @@ -2042,7 +1710,7 @@ func (m *QueryThrottleStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *QueryThrottledConsumerPacketDataRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryRegisteredConsumerRewardDenomsRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2052,27 +1720,20 @@ func (m *QueryThrottledConsumerPacketDataRequest) Marshal() (dAtA []byte, err er return dAtA[:n], nil } -func (m *QueryThrottledConsumerPacketDataRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryRegisteredConsumerRewardDenomsRequest) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryThrottledConsumerPacketDataRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryRegisteredConsumerRewardDenomsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *QueryThrottledConsumerPacketDataResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryRegisteredConsumerRewardDenomsResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2082,245 +1743,56 @@ func (m *QueryThrottledConsumerPacketDataResponse) Marshal() (dAtA []byte, err e return dAtA[:n], nil } -func (m *QueryThrottledConsumerPacketDataResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryRegisteredConsumerRewardDenomsResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryThrottledConsumerPacketDataResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryRegisteredConsumerRewardDenomsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.PacketDataInstances) > 0 { - for iNdEx := len(m.PacketDataInstances) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.PacketDataInstances[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } + if len(m.Denoms) > 0 { + for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Denoms[iNdEx]) + copy(dAtA[i:], m.Denoms[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Denoms[iNdEx]))) i-- - dAtA[i] = 0x1a + dAtA[i] = 0xa } } - if m.Size_ != 0 { - i = encodeVarintQuery(dAtA, i, uint64(m.Size_)) - i-- - dAtA[i] = 0x10 - } - if len(m.ChainId) > 0 { - i -= len(m.ChainId) - copy(dAtA[i:], m.ChainId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ChainId))) - i-- - dAtA[i] = 0xa - } return len(dAtA) - i, nil } -func (m *ThrottledSlashPacket) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ } - return dAtA[:n], nil + dAtA[offset] = uint8(v) + return base } - -func (m *ThrottledSlashPacket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) +func (m *QueryConsumerGenesisRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ChainId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n } -func (m *ThrottledSlashPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Data.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - { - size, err := m.GlobalEntry.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func (m *ThrottledPacketDataWrapper) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *ThrottledPacketDataWrapper) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ThrottledPacketDataWrapper) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Data != nil { - { - size := m.Data.Size() - i -= size - if _, err := m.Data.MarshalTo(dAtA[i:]); err != nil { - return 0, err - } - } - } - return len(dAtA) - i, nil -} - -func (m *ThrottledPacketDataWrapper_SlashPacket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ThrottledPacketDataWrapper_SlashPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.SlashPacket != nil { - { - size, err := m.SlashPacket.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} -func (m *ThrottledPacketDataWrapper_VscMaturedPacket) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *ThrottledPacketDataWrapper_VscMaturedPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - if m.VscMaturedPacket != nil { - { - size, err := m.VscMaturedPacket.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - return len(dAtA) - i, nil -} -func (m *QueryRegisteredConsumerRewardDenomsRequest) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryRegisteredConsumerRewardDenomsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRegisteredConsumerRewardDenomsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryRegisteredConsumerRewardDenomsResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *QueryRegisteredConsumerRewardDenomsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryRegisteredConsumerRewardDenomsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Denoms) > 0 { - for iNdEx := len(m.Denoms) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Denoms[iNdEx]) - copy(dAtA[i:], m.Denoms[iNdEx]) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Denoms[iNdEx]))) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryConsumerGenesisRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryConsumerGenesisResponse) Size() (n int) { - if m == nil { - return 0 - } +func (m *QueryConsumerGenesisResponse) Size() (n int) { + if m == nil { + return 0 + } var l int _ = l l = m.GenesisState.Size() @@ -2496,99 +1968,9 @@ func (m *QueryThrottleStateResponse) Size() (n int) { } l = github_com_cosmos_gogoproto_types.SizeOfStdTime(m.NextReplenishCandidate) n += 1 + l + sovQuery(uint64(l)) - if len(m.Packets) > 0 { - for _, e := range m.Packets { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *QueryThrottledConsumerPacketDataRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryThrottledConsumerPacketDataResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.ChainId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - if m.Size_ != 0 { - n += 1 + sovQuery(uint64(m.Size_)) - } - if len(m.PacketDataInstances) > 0 { - for _, e := range m.PacketDataInstances { - l = e.Size() - n += 1 + l + sovQuery(uint64(l)) - } - } - return n -} - -func (m *ThrottledSlashPacket) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.GlobalEntry.Size() - n += 1 + l + sovQuery(uint64(l)) - l = m.Data.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func (m *ThrottledPacketDataWrapper) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Data != nil { - n += m.Data.Size() - } return n } -func (m *ThrottledPacketDataWrapper_SlashPacket) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.SlashPacket != nil { - l = m.SlashPacket.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} -func (m *ThrottledPacketDataWrapper_VscMaturedPacket) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.VscMaturedPacket != nil { - l = m.VscMaturedPacket.Size() - n += 1 + l + sovQuery(uint64(l)) - } - return n -} func (m *QueryRegisteredConsumerRewardDenomsRequest) Size() (n int) { if m == nil { return 0 @@ -3846,493 +3228,6 @@ func (m *QueryThrottleStateResponse) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Packets", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Packets = append(m.Packets, &ThrottledSlashPacket{}) - if err := m.Packets[len(m.Packets)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryThrottledConsumerPacketDataRequest) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryThrottledConsumerPacketDataRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryThrottledConsumerPacketDataRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryThrottledConsumerPacketDataResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: QueryThrottledConsumerPacketDataResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryThrottledConsumerPacketDataResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ChainId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ChainId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Size_", wireType) - } - m.Size_ = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Size_ |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PacketDataInstances", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.PacketDataInstances = append(m.PacketDataInstances, ThrottledPacketDataWrapper{}) - if err := m.PacketDataInstances[len(m.PacketDataInstances)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ThrottledSlashPacket) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ThrottledSlashPacket: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ThrottledSlashPacket: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GlobalEntry", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.GlobalEntry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Data.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *ThrottledPacketDataWrapper) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: ThrottledPacketDataWrapper: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: ThrottledPacketDataWrapper: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SlashPacket", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.SlashPacketData{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Data = &ThrottledPacketDataWrapper_SlashPacket{v} - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field VscMaturedPacket", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - v := &types.VSCMaturedPacketData{} - if err := v.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - m.Data = &ThrottledPacketDataWrapper_VscMaturedPacket{v} - iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/ccv/provider/types/query.pb.gw.go b/x/ccv/provider/types/query.pb.gw.go index 6a249ca2a2..1a4b418158 100644 --- a/x/ccv/provider/types/query.pb.gw.go +++ b/x/ccv/provider/types/query.pb.gw.go @@ -231,42 +231,6 @@ func local_request_Query_QueryThrottleState_0(ctx context.Context, marshaler run } -var ( - filter_Query_QueryThrottledConsumerPacketData_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_QueryThrottledConsumerPacketData_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryThrottledConsumerPacketDataRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryThrottledConsumerPacketData_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.QueryThrottledConsumerPacketData(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_QueryThrottledConsumerPacketData_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryThrottledConsumerPacketDataRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryThrottledConsumerPacketData_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.QueryThrottledConsumerPacketData(ctx, &protoReq) - return msg, metadata, err - -} - func request_Query_QueryRegisteredConsumerRewardDenoms_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq QueryRegisteredConsumerRewardDenomsRequest var metadata runtime.ServerMetadata @@ -452,29 +416,6 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_QueryThrottledConsumerPacketData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_QueryThrottledConsumerPacketData_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryThrottledConsumerPacketData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_QueryRegisteredConsumerRewardDenoms_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -679,26 +620,6 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_QueryThrottledConsumerPacketData_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_QueryThrottledConsumerPacketData_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_QueryThrottledConsumerPacketData_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - mux.Handle("GET", pattern_Query_QueryRegisteredConsumerRewardDenoms_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -737,8 +658,6 @@ var ( pattern_Query_QueryThrottleState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "throttle_state"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryThrottledConsumerPacketData_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "pending_consumer_packets"}, "", runtime.AssumeColonVerbOpt(false))) - pattern_Query_QueryRegisteredConsumerRewardDenoms_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "provider", "registered_consumer_reward_denoms"}, "", runtime.AssumeColonVerbOpt(false))) ) @@ -757,7 +676,5 @@ var ( forward_Query_QueryThrottleState_0 = runtime.ForwardResponseMessage - forward_Query_QueryThrottledConsumerPacketData_0 = runtime.ForwardResponseMessage - forward_Query_QueryRegisteredConsumerRewardDenoms_0 = runtime.ForwardResponseMessage ) From f060f48295059ebab89485ebde40c2af2c845619 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:42:18 -0700 Subject: [PATCH 03/17] feat: consumer throttle state query (#1285) * wip, tests not fixed yet * rm packet query on provider * rm unneeded UTs * rm tests from relay_test * rm query and more tests * rm more tests * builds again and rm debug tests * lint * fix handling of slash packet and integration test * Fix TestMultiConsumerSlashPacketThrottling * fix two more slashing integration tests * Update TestSlashRetries, cleanup neededc * cleaned up TestSlashRetries * UT for TestOnRecvDowntimeSlashPacket * cleans * use helper in throttle test * lintz * Revert "rm packet query on provider" This reverts commit a10a2398cc6b878a889e196252e97a1b67c65be4. * cmd file too * fully restore query * Revert "Merge branch 'main' into shawn/throttle-with-retries-provider-changes" This reverts commit 73db33b3ed906d29dac643daa8a600f191076eee, reversing changes made to 78a8269db9e041df1449be180098daab17a42f06. * make e2e test pass, with todos * clean * Revert "Revert "Merge branch 'main' into shawn/throttle-with-retries-provider-changes"" This reverts commit 5bfccc39dc130d6f4be9ed7c0932176357618296. * lint * Update CHANGELOG.md * slightly longer buffer * build(deps): bump actions/checkout from 3 to 4 (#1257) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * build(deps)!: bump github.com/cosmos/ibc-go/v7 from 7.2.0 to 7.3.0 (#1258) * build(deps): bump github.com/cosmos/ibc-go/v7 from 7.2.0 to 7.3.0 Bumps [github.com/cosmos/ibc-go/v7](https://github.com/cosmos/ibc-go) from 7.2.0 to 7.3.0. - [Release notes](https://github.com/cosmos/ibc-go/releases) - [Changelog](https://github.com/cosmos/ibc-go/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/ibc-go/compare/v7.2.0...v7.3.0) --- updated-dependencies: - dependency-name: github.com/cosmos/ibc-go/v7 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * add changelog entries --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mpoke * build(deps): bump github.com/cosmos/cosmos-sdk from 0.47.4 to 0.47.5 (#1259) * build(deps): bump github.com/cosmos/cosmos-sdk from 0.47.3 to 0.47.5 Bumps [github.com/cosmos/cosmos-sdk](https://github.com/cosmos/cosmos-sdk) from 0.47.3 to 0.47.5. - [Release notes](https://github.com/cosmos/cosmos-sdk/releases) - [Changelog](https://github.com/cosmos/cosmos-sdk/blob/main/CHANGELOG.md) - [Commits](https://github.com/cosmos/cosmos-sdk/compare/v0.47.3...v0.47.5) --- updated-dependencies: - dependency-name: github.com/cosmos/cosmos-sdk dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * add changelog entries --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mpoke * chore: Separate semver (#1217) separate semver * docs: cleanup changelog (#1260) fix changelog * fix!: validate MsgTransfer before calling Transfer() (#1244) * validate MsgTransfer * add TestSendRewardsToProvider * update DefaultConsumerUnbondingPeriod to 14 days * update changelog * fix linter * fix test * apply review suggestions * update changelog * docs: Create adr-012-separate-releasing.md (#1229) * Create adr-011-separate-releasing.md * Update docs/docs/adrs/adr-011-separate-releasing.md Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * adr 12 not 11 * correct that we use postfix not prefix * explanation on example release flow --------- Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> * fix: remove addr validation for provider fee pool addr param (#1262) * fix: remove validation for provider chain address since we cannot validate it properly on consumer * add changelog entry * Revert "Merge branch 'main' into shawn/throttle-with-retries-provider-changes" This reverts commit 6bdfff9db15da62b61244b813f045f49b56fc6c3, reversing changes made to d8f569020b45b7fa6048983a9ccef91b9c8dfc38. * fmt * protobuf gen * impl query resp * add query assertion to e2e tests * lint * add consumer to pending packets name * add panic for invalid bytes --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: mpoke Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> Co-authored-by: Dmitry Kolupaev --- .../ccv/consumer/v1/query.proto | 14 + tests/e2e/state.go | 33 +- tests/e2e/steps_downtime.go | 4 + x/ccv/consumer/client/cli/query.go | 28 + x/ccv/consumer/keeper/grpc_query.go | 23 + x/ccv/consumer/types/query.pb.go | 497 ++++++++++++++++-- x/ccv/consumer/types/query.pb.gw.go | 65 +++ 7 files changed, 617 insertions(+), 47 deletions(-) diff --git a/proto/interchain_security/ccv/consumer/v1/query.proto b/proto/interchain_security/ccv/consumer/v1/query.proto index ff2a5901fe..3ad1f24df8 100644 --- a/proto/interchain_security/ccv/consumer/v1/query.proto +++ b/proto/interchain_security/ccv/consumer/v1/query.proto @@ -7,6 +7,7 @@ option go_package = "github.com/cosmos/interchain-security/v3/x/ccv/consumer/typ import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; import "interchain_security/ccv/consumer/v1/consumer.proto"; +import "interchain_security/ccv/v1/wire.proto"; service Query { // ConsumerGenesis queries the genesis state needed to start a consumer chain @@ -24,6 +25,11 @@ service Query { rpc QueryProviderInfo(QueryProviderInfoRequest) returns (QueryProviderInfoResponse) { option (google.api.http).get = "/interchain_security/ccv/consumer/provider-info"; } + + // QueryThrottleState returns on-chain state relevant to throttled consumer packets + rpc QueryThrottleState(QueryThrottleStateRequest) returns (QueryThrottleStateResponse) { + option (google.api.http).get = "/interchain_security/ccv/consumer/throttle_state"; + } } // NextFeeDistributionEstimate holds information about next fee distribution @@ -65,6 +71,14 @@ message QueryProviderInfoResponse { ChainInfo provider = 2 [ (gogoproto.nullable) = false ]; } +message QueryThrottleStateRequest {} + +message QueryThrottleStateResponse { + SlashRecord slash_record = 1 [ (gogoproto.nullable) = true ]; + repeated interchain_security.ccv.v1.ConsumerPacketData packet_data_queue = 2 [ (gogoproto.nullable) = false ]; +} + + message ChainInfo { string chainID = 1; string clientID = 2; diff --git a/tests/e2e/state.go b/tests/e2e/state.go index 57fc06e6c9..06940d48cd 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -26,8 +26,7 @@ type ChainState struct { ConsumerChains *map[chainID]bool AssignedKeys *map[validatorID]string ProviderKeys *map[validatorID]string // validatorID: validator provider key - ConsumerChainQueueSizes *map[chainID]uint - GlobalSlashQueueSize *uint + ConsumerPendingPacketQueueSize *uint // Only relevant to consumer chains RegisteredConsumerRewardDenoms *[]string } @@ -173,6 +172,11 @@ func (tr TestRun) getChainState(chain chainID, modelState ChainState) ChainState chainState.RegisteredConsumerRewardDenoms = ®isteredConsumerRewardDenoms } + if modelState.ConsumerPendingPacketQueueSize != nil { + pendingPacketQueueSize := tr.getPendingPacketQueueSize(chain) + chainState.ConsumerPendingPacketQueueSize = &pendingPacketQueueSize + } + if *verbose { log.Println("Done getting chain state:\n" + pretty.Sprint(chainState)) } @@ -694,6 +698,27 @@ func (tr TestRun) getRegisteredConsumerRewardDenoms(chain chainID) []string { return rewardDenoms } +func (tr TestRun) getPendingPacketQueueSize(chain chainID) uint { + //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. + cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + + "query", "ccvconsumer", "throttle-state", + `--node`, tr.getQueryNode(chain), + `-o`, `json`, + ) + bz, err := cmd.CombinedOutput() + if err != nil { + log.Fatal(err, "\n", string(bz)) + } + + if !gjson.ValidBytes(bz) { + panic("invalid json response from query ccvconsumer throttle-state: " + string(bz)) + } + + packetData := gjson.Get(string(bz), "packet_data_queue").Array() + return uint(len(packetData)) +} + func (tr TestRun) getValidatorNode(chain chainID, validator validatorID) string { // for CometMock, validatorNodes are all the same address as the query node (which is CometMocks address) if tr.useCometmock { @@ -742,3 +767,7 @@ func (tr TestRun) curlJsonRPCRequest(method, params, address string) { verbosity := false executeCommandWithVerbosity(cmd, "curlJsonRPCRequest", verbosity) } + +func uintPtr(i uint) *uint { + return &i +} diff --git a/tests/e2e/steps_downtime.go b/tests/e2e/steps_downtime.go index f79b945ec0..d5f994879c 100644 --- a/tests/e2e/steps_downtime.go +++ b/tests/e2e/steps_downtime.go @@ -293,6 +293,7 @@ func stepsThrottledDowntime(consumerName string) []Step { validatorID("bob"): 500, validatorID("carol"): 500, }, + ConsumerPendingPacketQueueSize: uintPtr(1), // bob's downtime slash packet is queued }, }, }, @@ -321,6 +322,7 @@ func stepsThrottledDowntime(consumerName string) []Step { validatorID("bob"): 500, validatorID("carol"): 500, }, + ConsumerPendingPacketQueueSize: uintPtr(0), // slash packet handled ack clears consumer queue }, }, }, @@ -344,6 +346,7 @@ func stepsThrottledDowntime(consumerName string) []Step { validatorID("bob"): 500, // VSC packet jailing bob is not yet relayed to consumer validatorID("carol"): 500, }, + ConsumerPendingPacketQueueSize: uintPtr(1), // carol's downtime slash packet is queued }, }, }, @@ -368,6 +371,7 @@ func stepsThrottledDowntime(consumerName string) []Step { validatorID("bob"): 0, // VSC packet applying bob jailing is also relayed and recv by consumer validatorID("carol"): 500, }, + ConsumerPendingPacketQueueSize: uintPtr(1), // slash packet bounced ack keeps carol's downtime slash packet queued }, }, }, diff --git a/x/ccv/consumer/client/cli/query.go b/x/ccv/consumer/client/cli/query.go index dc1ecfc2f4..f1a0c0f258 100644 --- a/x/ccv/consumer/client/cli/query.go +++ b/x/ccv/consumer/client/cli/query.go @@ -22,6 +22,7 @@ func NewQueryCmd() *cobra.Command { cmd.AddCommand( CmdNextFeeDistribution(), CmdProviderInfo(), + CmdThrottleState(), ) return cmd @@ -80,3 +81,30 @@ func CmdProviderInfo() *cobra.Command { return cmd } + +func CmdThrottleState() *cobra.Command { + cmd := &cobra.Command{ + Use: "throttle-state", + Short: "Query throttle state", + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + req := &types.QueryThrottleStateRequest{} + res, err := queryClient.QueryThrottleState(cmd.Context(), req) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/ccv/consumer/keeper/grpc_query.go b/x/ccv/consumer/keeper/grpc_query.go index 80e6b695a9..0d1bb78d16 100644 --- a/x/ccv/consumer/keeper/grpc_query.go +++ b/x/ccv/consumer/keeper/grpc_query.go @@ -9,6 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" + ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) var _ types.QueryServer = Keeper{} //nolint:golint @@ -51,3 +52,25 @@ func (k Keeper) QueryProviderInfo(c context.Context, //nolint:golint return k.GetProviderInfo(ctx) } + +func (k Keeper) QueryThrottleState(c context.Context, + req *types.QueryThrottleStateRequest, +) (*types.QueryThrottleStateResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + + resp := types.QueryThrottleStateResponse{} + + slashRecord, found := k.GetSlashRecord(ctx) + if found { + resp.SlashRecord = &slashRecord + } else { + resp.SlashRecord = nil + } + + resp.PacketDataQueue = make([]ccvtypes.ConsumerPacketData, 0) + pendingPackets := k.GetAllPendingPacketsWithIdx(ctx) + for _, packet := range pendingPackets { + resp.PacketDataQueue = append(resp.PacketDataQueue, packet.ConsumerPacketData) + } + return &resp, nil +} diff --git a/x/ccv/consumer/types/query.pb.go b/x/ccv/consumer/types/query.pb.go index 5ed38da3f8..282718d4e8 100644 --- a/x/ccv/consumer/types/query.pb.go +++ b/x/ccv/consumer/types/query.pb.go @@ -384,6 +384,94 @@ func (m *QueryProviderInfoResponse) GetProvider() ChainInfo { return ChainInfo{} } +type QueryThrottleStateRequest struct { +} + +func (m *QueryThrottleStateRequest) Reset() { *m = QueryThrottleStateRequest{} } +func (m *QueryThrottleStateRequest) String() string { return proto.CompactTextString(m) } +func (*QueryThrottleStateRequest) ProtoMessage() {} +func (*QueryThrottleStateRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_f627751d3cc10225, []int{7} +} +func (m *QueryThrottleStateRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryThrottleStateRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryThrottleStateRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryThrottleStateRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryThrottleStateRequest.Merge(m, src) +} +func (m *QueryThrottleStateRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryThrottleStateRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryThrottleStateRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryThrottleStateRequest proto.InternalMessageInfo + +type QueryThrottleStateResponse struct { + SlashRecord *SlashRecord `protobuf:"bytes,1,opt,name=slash_record,json=slashRecord,proto3" json:"slash_record,omitempty"` + PacketDataQueue []types.ConsumerPacketData `protobuf:"bytes,2,rep,name=packet_data_queue,json=packetDataQueue,proto3" json:"packet_data_queue"` +} + +func (m *QueryThrottleStateResponse) Reset() { *m = QueryThrottleStateResponse{} } +func (m *QueryThrottleStateResponse) String() string { return proto.CompactTextString(m) } +func (*QueryThrottleStateResponse) ProtoMessage() {} +func (*QueryThrottleStateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_f627751d3cc10225, []int{8} +} +func (m *QueryThrottleStateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryThrottleStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryThrottleStateResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryThrottleStateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryThrottleStateResponse.Merge(m, src) +} +func (m *QueryThrottleStateResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryThrottleStateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryThrottleStateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryThrottleStateResponse proto.InternalMessageInfo + +func (m *QueryThrottleStateResponse) GetSlashRecord() *SlashRecord { + if m != nil { + return m.SlashRecord + } + return nil +} + +func (m *QueryThrottleStateResponse) GetPacketDataQueue() []types.ConsumerPacketData { + if m != nil { + return m.PacketDataQueue + } + return nil +} + type ChainInfo struct { ChainID string `protobuf:"bytes,1,opt,name=chainID,proto3" json:"chainID,omitempty"` ClientID string `protobuf:"bytes,2,opt,name=clientID,proto3" json:"clientID,omitempty"` @@ -395,7 +483,7 @@ func (m *ChainInfo) Reset() { *m = ChainInfo{} } func (m *ChainInfo) String() string { return proto.CompactTextString(m) } func (*ChainInfo) ProtoMessage() {} func (*ChainInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_f627751d3cc10225, []int{7} + return fileDescriptor_f627751d3cc10225, []int{9} } func (m *ChainInfo) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -460,6 +548,8 @@ func init() { proto.RegisterType((*QueryParamsResponse)(nil), "interchain_security.ccv.consumer.v1.QueryParamsResponse") proto.RegisterType((*QueryProviderInfoRequest)(nil), "interchain_security.ccv.consumer.v1.QueryProviderInfoRequest") proto.RegisterType((*QueryProviderInfoResponse)(nil), "interchain_security.ccv.consumer.v1.QueryProviderInfoResponse") + proto.RegisterType((*QueryThrottleStateRequest)(nil), "interchain_security.ccv.consumer.v1.QueryThrottleStateRequest") + proto.RegisterType((*QueryThrottleStateResponse)(nil), "interchain_security.ccv.consumer.v1.QueryThrottleStateResponse") proto.RegisterType((*ChainInfo)(nil), "interchain_security.ccv.consumer.v1.ChainInfo") } @@ -468,50 +558,59 @@ func init() { } var fileDescriptor_f627751d3cc10225 = []byte{ - // 686 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x6b, 0x13, 0x41, - 0x14, 0xcf, 0xa6, 0x4d, 0xdb, 0x4c, 0xf5, 0xe0, 0x18, 0x21, 0xae, 0x65, 0x2d, 0xab, 0x60, 0x14, - 0xb2, 0xdb, 0xb4, 0x87, 0xea, 0xa1, 0x5a, 0x6c, 0x2c, 0x06, 0x54, 0xea, 0x22, 0x14, 0xbc, 0x94, - 0xe9, 0x64, 0x9a, 0x0c, 0x24, 0x33, 0xe9, 0xcc, 0xec, 0xd2, 0xde, 0x44, 0xf1, 0x2a, 0x82, 0xdf, - 0xc4, 0x2f, 0xe0, 0xb5, 0xe0, 0xa5, 0xe0, 0xc5, 0x93, 0x48, 0xeb, 0x87, 0xf0, 0x28, 0x3b, 0x3b, - 0x9b, 0x6e, 0xe8, 0xbf, 0xad, 0x7a, 0x9b, 0x79, 0xbf, 0xf7, 0x7e, 0xef, 0xf7, 0xde, 0xbc, 0xb7, - 0x0b, 0x7c, 0xca, 0x14, 0x11, 0xb8, 0x8b, 0x28, 0xdb, 0x90, 0x04, 0x87, 0x82, 0xaa, 0x5d, 0x1f, - 0xe3, 0xc8, 0xc7, 0x9c, 0xc9, 0xb0, 0x4f, 0x84, 0x1f, 0x35, 0xfc, 0xed, 0x90, 0x88,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2, - 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x18, 0x69, 0x59, 0x43, 0x6b, 0x07, 0x00, 0x00, + // 825 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0xe3, 0x44, + 0x14, 0x8e, 0xd3, 0x36, 0xbb, 0x99, 0x2e, 0x42, 0x3b, 0x04, 0xc9, 0x78, 0x57, 0xa1, 0x32, 0x20, + 0x02, 0x52, 0xec, 0x24, 0x3d, 0x74, 0x39, 0x2c, 0x5b, 0xb5, 0xa1, 0x22, 0x12, 0xa0, 0xd4, 0xad, + 0x54, 0xc1, 0x25, 0x4c, 0x27, 0xd3, 0xc4, 0x22, 0xf1, 0xb8, 0x33, 0x63, 0xd3, 0xde, 0x10, 0xdc, + 0x11, 0x12, 0xff, 0x84, 0x3f, 0xc0, 0xb5, 0x12, 0x07, 0x2a, 0x71, 0x00, 0x2e, 0x08, 0xb5, 0xfc, + 0x08, 0x8e, 0x68, 0xc6, 0xe3, 0xd4, 0x69, 0xd3, 0xc4, 0x2d, 0x7b, 0xb3, 0xdf, 0x37, 0xef, 0x7b, + 0xdf, 0xf7, 0x3c, 0xef, 0x25, 0xc0, 0xf5, 0x03, 0x41, 0x18, 0x1e, 0x22, 0x3f, 0xe8, 0x71, 0x82, + 0x23, 0xe6, 0x8b, 0x53, 0x17, 0xe3, 0xd8, 0xc5, 0x34, 0xe0, 0xd1, 0x98, 0x30, 0x37, 0x6e, 0xba, + 0xc7, 0x11, 0x61, 0xa7, 0x4e, 0xc8, 0xa8, 0xa0, 0xf0, 0xad, 0x19, 0x09, 0x0e, 0xc6, 0xb1, 0x93, + 0x26, 0x38, 0x71, 0xd3, 0x6a, 0xdc, 0xc6, 0x1a, 0x37, 0x5d, 0x3e, 0x44, 0x8c, 0xf4, 0x7b, 0x93, + 0xe3, 0x8a, 0xd6, 0xaa, 0x0c, 0xe8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0x9a, 0xd0, 0xcd, 0x61, 0x43, 0xe7, 0xd7, 0x7d, 0xa9, + 0xfb, 0x57, 0x43, 0x2f, 0xd5, 0xa9, 0x49, 0x87, 0x77, 0xd0, 0x33, 0x6b, 0x81, 0x58, 0x2f, 0xee, + 0x9d, 0xaf, 0x0d, 0x3d, 0x53, 0x86, 0x5a, 0xb0, 0xb1, 0xd8, 0x90, 0xd0, 0x04, 0x3d, 0x2e, 0x19, + 0xb6, 0x0e, 0xce, 0x2e, 0xaa, 0xc6, 0xf9, 0x45, 0xd5, 0xf8, 0xfb, 0xa2, 0x6a, 0xfc, 0x70, 0x59, + 0x2d, 0x9c, 0x5f, 0x56, 0x0b, 0x7f, 0x5c, 0x56, 0x0b, 0x5f, 0x3c, 0x1f, 0xf8, 0x62, 0x18, 0x1d, + 0x3a, 0x98, 0x8e, 0x5d, 0x4c, 0xf9, 0x98, 0xf2, 0x0c, 0x79, 0x7d, 0x42, 0x1e, 0xaf, 0xbb, 0x27, + 0xd7, 0x2a, 0x9c, 0x86, 0x84, 0x1f, 0x96, 0xd4, 0x9f, 0x88, 0xf5, 0xff, 0x02, 0x00, 0x00, 0xff, + 0xff, 0x98, 0xfe, 0x6e, 0x83, 0x5d, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -532,6 +631,8 @@ type QueryClient interface { // QueryParams queries the ccv/consumer module parameters. QueryParams(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) QueryProviderInfo(ctx context.Context, in *QueryProviderInfoRequest, opts ...grpc.CallOption) (*QueryProviderInfoResponse, error) + // QueryThrottleState returns on-chain state relevant to throttled consumer packets + QueryThrottleState(ctx context.Context, in *QueryThrottleStateRequest, opts ...grpc.CallOption) (*QueryThrottleStateResponse, error) } type queryClient struct { @@ -569,6 +670,15 @@ func (c *queryClient) QueryProviderInfo(ctx context.Context, in *QueryProviderIn return out, nil } +func (c *queryClient) QueryThrottleState(ctx context.Context, in *QueryThrottleStateRequest, opts ...grpc.CallOption) (*QueryThrottleStateResponse, error) { + out := new(QueryThrottleStateResponse) + err := c.cc.Invoke(ctx, "/interchain_security.ccv.consumer.v1.Query/QueryThrottleState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // ConsumerGenesis queries the genesis state needed to start a consumer chain @@ -577,6 +687,8 @@ type QueryServer interface { // QueryParams queries the ccv/consumer module parameters. QueryParams(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) QueryProviderInfo(context.Context, *QueryProviderInfoRequest) (*QueryProviderInfoResponse, error) + // QueryThrottleState returns on-chain state relevant to throttled consumer packets + QueryThrottleState(context.Context, *QueryThrottleStateRequest) (*QueryThrottleStateResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -592,6 +704,9 @@ func (*UnimplementedQueryServer) QueryParams(ctx context.Context, req *QueryPara func (*UnimplementedQueryServer) QueryProviderInfo(ctx context.Context, req *QueryProviderInfoRequest) (*QueryProviderInfoResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method QueryProviderInfo not implemented") } +func (*UnimplementedQueryServer) QueryThrottleState(ctx context.Context, req *QueryThrottleStateRequest) (*QueryThrottleStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryThrottleState not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -651,6 +766,24 @@ func _Query_QueryProviderInfo_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _Query_QueryThrottleState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryThrottleStateRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).QueryThrottleState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/interchain_security.ccv.consumer.v1.Query/QueryThrottleState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).QueryThrottleState(ctx, req.(*QueryThrottleStateRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "interchain_security.ccv.consumer.v1.Query", HandlerType: (*QueryServer)(nil), @@ -667,6 +800,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "QueryProviderInfo", Handler: _Query_QueryProviderInfo_Handler, }, + { + MethodName: "QueryThrottleState", + Handler: _Query_QueryThrottleState_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "interchain_security/ccv/consumer/v1/query.proto", @@ -918,6 +1055,78 @@ func (m *QueryProviderInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *QueryThrottleStateRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryThrottleStateRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryThrottleStateRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryThrottleStateResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryThrottleStateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryThrottleStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PacketDataQueue) > 0 { + for iNdEx := len(m.PacketDataQueue) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.PacketDataQueue[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.SlashRecord != nil { + { + size, err := m.SlashRecord.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *ChainInfo) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1078,6 +1287,34 @@ func (m *QueryProviderInfoResponse) Size() (n int) { return n } +func (m *QueryThrottleStateRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryThrottleStateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.SlashRecord != nil { + l = m.SlashRecord.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.PacketDataQueue) > 0 { + for _, e := range m.PacketDataQueue { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func (m *ChainInfo) Size() (n int) { if m == nil { return 0 @@ -1779,6 +2016,176 @@ func (m *QueryProviderInfoResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryThrottleStateRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryThrottleStateRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryThrottleStateRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryThrottleStateResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryThrottleStateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryThrottleStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SlashRecord", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.SlashRecord == nil { + m.SlashRecord = &SlashRecord{} + } + if err := m.SlashRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PacketDataQueue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.PacketDataQueue = append(m.PacketDataQueue, types.ConsumerPacketData{}) + if err := m.PacketDataQueue[len(m.PacketDataQueue)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *ChainInfo) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/x/ccv/consumer/types/query.pb.gw.go b/x/ccv/consumer/types/query.pb.gw.go index 1151ab0b60..46ad461324 100644 --- a/x/ccv/consumer/types/query.pb.gw.go +++ b/x/ccv/consumer/types/query.pb.gw.go @@ -87,6 +87,24 @@ func local_request_Query_QueryProviderInfo_0(ctx context.Context, marshaler runt } +func request_Query_QueryThrottleState_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryThrottleStateRequest + var metadata runtime.ServerMetadata + + msg, err := client.QueryThrottleState(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_QueryThrottleState_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryThrottleStateRequest + var metadata runtime.ServerMetadata + + msg, err := server.QueryThrottleState(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -162,6 +180,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_QueryThrottleState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_QueryThrottleState_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryThrottleState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -263,6 +304,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_QueryThrottleState_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_QueryThrottleState_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_QueryThrottleState_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -272,6 +333,8 @@ var ( pattern_Query_QueryParams_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "consumer", "params"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_QueryProviderInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "consumer", "provider-info"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_QueryThrottleState_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"interchain_security", "ccv", "consumer", "throttle_state"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -280,4 +343,6 @@ var ( forward_Query_QueryParams_0 = runtime.ForwardResponseMessage forward_Query_QueryProviderInfo_0 = runtime.ForwardResponseMessage + + forward_Query_QueryThrottleState_0 = runtime.ForwardResponseMessage ) From c1c3fdbd31d5f04f3665a1c9164ce41af3927d0b Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:53:46 -0700 Subject: [PATCH 04/17] feat: retry delay period as param (#1308) * boilerplate * fix test * Update proposal_test.go * apply new param to keeper code * Update params_test.go --- .../ccv/v1/shared_consumer.proto | 4 + tests/difference/core/driver/setup.go | 1 + x/ccv/consumer/keeper/params.go | 7 + x/ccv/consumer/keeper/params_test.go | 3 +- x/ccv/consumer/keeper/throttle_retry.go | 6 +- x/ccv/consumer/keeper/throttle_retry_test.go | 7 +- x/ccv/consumer/types/genesis_test.go | 3 + x/ccv/consumer/types/params_test.go | 36 +-- x/ccv/provider/keeper/proposal.go | 1 + x/ccv/provider/keeper/proposal_test.go | 3 +- x/ccv/types/params.go | 14 +- x/ccv/types/shared_consumer.pb.go | 233 +++++++++++------- 12 files changed, 204 insertions(+), 114 deletions(-) diff --git a/proto/interchain_security/ccv/v1/shared_consumer.proto b/proto/interchain_security/ccv/v1/shared_consumer.proto index 825a84e346..f43f6cf65d 100644 --- a/proto/interchain_security/ccv/v1/shared_consumer.proto +++ b/proto/interchain_security/ccv/v1/shared_consumer.proto @@ -77,6 +77,10 @@ message Params { // Provider-originated reward denoms. These are denoms coming from the // provider which are allowed to be used as rewards. e.g. "uatom" repeated string provider_reward_denoms = 12; + + // The period after which a consumer can retry sending a throttled packet. + google.protobuf.Duration retry_delay_period = 13 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; } // GenesisState defines the CCV consumer chain genesis state. diff --git a/tests/difference/core/driver/setup.go b/tests/difference/core/driver/setup.go index 9ca6d00b9f..ebeb9e1876 100644 --- a/tests/difference/core/driver/setup.go +++ b/tests/difference/core/driver/setup.go @@ -537,6 +537,7 @@ func (b *Builder) createConsumerGenesis(client *ibctmtypes.ClientState) *ccv.Gen "0", // disable soft opt-out []string{}, []string{}, + ccv.DefaultRetryDelayPeriod, ) return ccv.NewInitialGenesisState(client, providerConsState, valUpdates, params) } diff --git a/x/ccv/consumer/keeper/params.go b/x/ccv/consumer/keeper/params.go index 770edf229e..f3863a0a64 100644 --- a/x/ccv/consumer/keeper/params.go +++ b/x/ccv/consumer/keeper/params.go @@ -25,6 +25,7 @@ func (k Keeper) GetConsumerParams(ctx sdk.Context) ccvtypes.Params { k.GetSoftOptOutThreshold(ctx), k.GetRewardDenoms(ctx), k.GetProviderRewardDenoms(ctx), + k.GetRetryDelayPeriod(ctx), ) } @@ -138,3 +139,9 @@ func (k Keeper) GetProviderRewardDenoms(ctx sdk.Context) []string { k.paramStore.Get(ctx, ccvtypes.KeyProviderRewardDenoms, &denoms) return denoms } + +func (k Keeper) GetRetryDelayPeriod(ctx sdk.Context) time.Duration { + var period time.Duration + k.paramStore.Get(ctx, ccvtypes.KeyRetryDelayPeriod, &period) + return period +} diff --git a/x/ccv/consumer/keeper/params_test.go b/x/ccv/consumer/keeper/params_test.go index 49b1816520..e575e26185 100644 --- a/x/ccv/consumer/keeper/params_test.go +++ b/x/ccv/consumer/keeper/params_test.go @@ -31,6 +31,7 @@ func TestParams(t *testing.T) { ccv.DefaultSoftOptOutThreshold, rewardDenoms, provideRewardDenoms, + ccv.DefaultRetryDelayPeriod, ) // these are the default params, IBC suite independently sets enabled=true params := consumerKeeper.GetConsumerParams(ctx) @@ -38,7 +39,7 @@ func TestParams(t *testing.T) { newParams := ccv.NewParams(false, 1000, "channel-2", "cosmos19pe9pg5dv9k5fzgzmsrgnw9rl9asf7ddwhu7lm", - 7*24*time.Hour, 25*time.Hour, "0.5", 500, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}) + 7*24*time.Hour, 25*time.Hour, "0.5", 500, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour) consumerKeeper.SetParams(ctx, newParams) params = consumerKeeper.GetConsumerParams(ctx) require.Equal(t, newParams, params) diff --git a/x/ccv/consumer/keeper/throttle_retry.go b/x/ccv/consumer/keeper/throttle_retry.go index 4c4585cb1d..7f8d85191d 100644 --- a/x/ccv/consumer/keeper/throttle_retry.go +++ b/x/ccv/consumer/keeper/throttle_retry.go @@ -2,7 +2,6 @@ package keeper import ( "fmt" - "time" sdktypes "github.com/cosmos/cosmos-sdk/types" @@ -44,9 +43,6 @@ import ( // This design is implemented below, and in relay.go under SendPackets() and OnAcknowledgementPacket(). // -// Retry delay period could be implemented as a param, but 1 hour is reasonable -const RetryDelayPeriod = time.Hour - // PacketSendingPermitted returns whether the consumer is allowed to send packets // from the pending packets queue. func (k Keeper) PacketSendingPermitted(ctx sdktypes.Context) bool { @@ -60,7 +56,7 @@ func (k Keeper) PacketSendingPermitted(ctx sdktypes.Context) bool { return false } // If retry delay period has elapsed, we can send again - return ctx.BlockTime().After(record.SendTime.Add(RetryDelayPeriod)) + return ctx.BlockTime().After(record.SendTime.Add(k.GetRetryDelayPeriod(ctx))) } func (k Keeper) UpdateSlashRecordOnSend(ctx sdktypes.Context) { diff --git a/x/ccv/consumer/keeper/throttle_retry_test.go b/x/ccv/consumer/keeper/throttle_retry_test.go index cc14ce3cdd..50157df843 100644 --- a/x/ccv/consumer/keeper/throttle_retry_test.go +++ b/x/ccv/consumer/keeper/throttle_retry_test.go @@ -7,14 +7,16 @@ import ( "github.com/stretchr/testify/require" testutil "github.com/cosmos/interchain-security/v3/testutil/keeper" - consumerkeeper "github.com/cosmos/interchain-security/v3/x/ccv/consumer/keeper" consumertypes "github.com/cosmos/interchain-security/v3/x/ccv/consumer/types" + ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) func TestPacketSendingPermitted(t *testing.T) { consumerKeeper, ctx, ctrl, _ := testutil.GetConsumerKeeperAndCtx(t, testutil.NewInMemKeeperParams(t)) defer ctrl.Finish() + consumerKeeper.SetParams(ctx, ccvtypes.DefaultParams()) + ctx = ctx.WithBlockTime(time.Now()) // No slash record exists, send is permitted @@ -42,7 +44,8 @@ func TestPacketSendingPermitted(t *testing.T) { require.False(t, consumerKeeper.PacketSendingPermitted(ctx)) // Elapse retry delay period - ctx = ctx.WithBlockTime(ctx.BlockTime().Add(2 * consumerkeeper.RetryDelayPeriod)) + period := consumerKeeper.GetRetryDelayPeriod(ctx) + ctx = ctx.WithBlockTime(ctx.BlockTime().Add(2 * period)) // Now packet sending is permitted again require.True(t, consumerKeeper.PacketSendingPermitted(ctx)) diff --git a/x/ccv/consumer/types/genesis_test.go b/x/ccv/consumer/types/genesis_test.go index 453a3aab20..88a58e5b62 100644 --- a/x/ccv/consumer/types/genesis_test.go +++ b/x/ccv/consumer/types/genesis_test.go @@ -222,6 +222,7 @@ func TestValidateInitialGenesisState(t *testing.T) { types.DefaultSoftOptOutThreshold, []string{}, []string{}, + types.DefaultRetryDelayPeriod, )), true, }, @@ -241,6 +242,7 @@ func TestValidateInitialGenesisState(t *testing.T) { types.DefaultSoftOptOutThreshold, []string{}, []string{}, + types.DefaultRetryDelayPeriod, )), true, }, @@ -442,6 +444,7 @@ func TestValidateRestartGenesisState(t *testing.T) { types.DefaultSoftOptOutThreshold, []string{}, []string{}, + types.DefaultRetryDelayPeriod, )), true, }, diff --git a/x/ccv/consumer/types/params_test.go b/x/ccv/consumer/types/params_test.go index ff5d0f325f..43c7f185cf 100644 --- a/x/ccv/consumer/types/params_test.go +++ b/x/ccv/consumer/types/params_test.go @@ -19,59 +19,67 @@ func TestValidateParams(t *testing.T) { {"default params", ccvtypes.DefaultParams(), true}, { "custom valid params", - ccvtypes.NewParams(true, 5, "", "", 1004, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), true, + ccvtypes.NewParams(true, 5, "", "", 1004, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), true, }, { "custom invalid params, block per dist transmission", - ccvtypes.NewParams(true, -5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), false, + ccvtypes.NewParams(true, -5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, dist transmission channel", - ccvtypes.NewParams(true, 5, "badchannel/", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), false, + ccvtypes.NewParams(true, 5, "badchannel/", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, ccv timeout", - ccvtypes.NewParams(true, 5, "", "", -5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), false, + ccvtypes.NewParams(true, 5, "", "", -5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, transfer timeout", - ccvtypes.NewParams(true, 5, "", "", 1004, -7, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), false, + ccvtypes.NewParams(true, 5, "", "", 1004, -7, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, consumer redist fraction is negative", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "-0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "-0.5", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, consumer redist fraction is over 1", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "1.2", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "1.2", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, bad consumer redist fraction ", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "notFrac", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "notFrac", 1000, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, negative num historical entries", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", -100, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", -100, 24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, negative unbonding period", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, -24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, -24*21*time.Hour, "0.05", []string{"untrn"}, []string{"uatom"}, 2*time.Hour), false, }, { "custom invalid params, invalid soft opt out threshold", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "-0.05", []string{"u"}, []string{}), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "-0.05", []string{"u"}, []string{}, 2*time.Hour), false, }, { "custom invalid params, invalid soft opt out threshold", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.5", []string{"u"}, []string{}), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.5", []string{"u"}, []string{}, 2*time.Hour), false, }, { "custom invalid params, invalid reward denom", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"u"}, []string{}), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{"u"}, []string{}, 2*time.Hour), false, }, { "custom invalid params, invalid provider reward denom", - ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{}, []string{"a"}), false, + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{}, []string{"a"}, 2*time.Hour), false, + }, + { + "custom invalid params, retry delay period is negative", + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{}, []string{}, -2*time.Hour), false, + }, + { + "custom invalid params, retry delay period is zero", + ccvtypes.NewParams(true, 5, "", "", 5, 1005, "0.5", 1000, 24*21*time.Hour, "0.05", []string{}, []string{}, 0), false, }, } diff --git a/x/ccv/provider/keeper/proposal.go b/x/ccv/provider/keeper/proposal.go index 80ed8af54d..a2bc358cb9 100644 --- a/x/ccv/provider/keeper/proposal.go +++ b/x/ccv/provider/keeper/proposal.go @@ -299,6 +299,7 @@ func (k Keeper) MakeConsumerGenesis( "0.05", []string{}, []string{}, + ccv.DefaultRetryDelayPeriod, ) gen = *ccv.NewInitialGenesisState( diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index f49b6d3b11..ed4249285c 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -813,7 +813,8 @@ func TestMakeConsumerGenesis(t *testing.T) { "unbonding_period": 1728000000000000, "soft_opt_out_threshold": "0.05", "reward_denoms": [], - "provider_reward_denoms": [] + "provider_reward_denoms": [], + "retry_delay_period": 3600000000000 }, "new_chain": true, "provider_client_state": { diff --git a/x/ccv/types/params.go b/x/ccv/types/params.go index 6a903c0d8f..efad72ea75 100644 --- a/x/ccv/types/params.go +++ b/x/ccv/types/params.go @@ -39,6 +39,9 @@ const ( // By default, the bottom 5% of the validator set can opt out of validating consumer chains DefaultSoftOptOutThreshold = "0.05" + + // Default retry delay period is 1 hour. + DefaultRetryDelayPeriod = time.Hour ) // Reflection based keys for params subspace @@ -54,6 +57,7 @@ var ( KeySoftOptOutThreshold = []byte("SoftOptOutThreshold") KeyRewardDenoms = []byte("RewardDenoms") KeyProviderRewardDenoms = []byte("ProviderRewardDenoms") + KeyRetryDelayPeriod = []byte("RetryDelayPeriod") ) // ParamKeyTable type declaration for parameters @@ -66,7 +70,8 @@ func NewParams(enabled bool, blocksPerDistributionTransmission int64, distributionTransmissionChannel, providerFeePoolAddrStr string, ccvTimeoutPeriod, transferTimeoutPeriod time.Duration, consumerRedistributionFraction string, historicalEntries int64, - consumerUnbondingPeriod time.Duration, softOptOutThreshold string, rewardDenoms, providerRewardDenoms []string, + consumerUnbondingPeriod time.Duration, softOptOutThreshold string, + rewardDenoms, providerRewardDenoms []string, retryDelayPeriod time.Duration, ) Params { return Params{ Enabled: enabled, @@ -81,6 +86,7 @@ func NewParams(enabled bool, blocksPerDistributionTransmission int64, SoftOptOutThreshold: softOptOutThreshold, RewardDenoms: rewardDenoms, ProviderRewardDenoms: providerRewardDenoms, + RetryDelayPeriod: retryDelayPeriod, } } @@ -101,6 +107,7 @@ func DefaultParams() Params { DefaultSoftOptOutThreshold, rewardDenoms, provideRewardDenoms, + DefaultRetryDelayPeriod, ) } @@ -142,6 +149,9 @@ func (p Params) Validate() error { if err := ValidateDenoms(p.ProviderRewardDenoms); err != nil { return err } + if err := ValidateDuration(p.RetryDelayPeriod); err != nil { + return err + } return nil } @@ -171,6 +181,8 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { p.RewardDenoms, ValidateDenoms), paramtypes.NewParamSetPair(KeyProviderRewardDenoms, p.ProviderRewardDenoms, ValidateDenoms), + paramtypes.NewParamSetPair(KeyRetryDelayPeriod, + p.RetryDelayPeriod, ValidateDuration), } } diff --git a/x/ccv/types/shared_consumer.pb.go b/x/ccv/types/shared_consumer.pb.go index 4cf8860269..36d54394cb 100644 --- a/x/ccv/types/shared_consumer.pb.go +++ b/x/ccv/types/shared_consumer.pb.go @@ -79,6 +79,8 @@ type Params struct { // Provider-originated reward denoms. These are denoms coming from the // provider which are allowed to be used as rewards. e.g. "uatom" ProviderRewardDenoms []string `protobuf:"bytes,12,rep,name=provider_reward_denoms,json=providerRewardDenoms,proto3" json:"provider_reward_denoms,omitempty"` + // The period after which a consumer can retry sending a throttled packet. + RetryDelayPeriod time.Duration `protobuf:"bytes,13,opt,name=retry_delay_period,json=retryDelayPeriod,proto3,stdduration" json:"retry_delay_period"` } func (m *Params) Reset() { *m = Params{} } @@ -198,6 +200,13 @@ func (m *Params) GetProviderRewardDenoms() []string { return nil } +func (m *Params) GetRetryDelayPeriod() time.Duration { + if m != nil { + return m.RetryDelayPeriod + } + return 0 +} + // GenesisState defines the CCV consumer chain genesis state. // // Note this type is referenced in both the consumer and provider CCV modules, @@ -621,81 +630,82 @@ func init() { } var fileDescriptor_d0a8be0efc64dfbc = []byte{ - // 1178 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4d, 0x6f, 0x1b, 0x45, - 0x18, 0x8e, 0x9b, 0x34, 0xb5, 0x27, 0x09, 0x4d, 0x27, 0xad, 0xd9, 0x26, 0xc2, 0x71, 0x0d, 0x48, - 0x96, 0xa0, 0xbb, 0x24, 0x2d, 0x42, 0xe2, 0x80, 0x68, 0x6c, 0x4a, 0x83, 0x4a, 0x13, 0x36, 0x69, - 0x0e, 0x45, 0x62, 0x34, 0x9e, 0x99, 0xd8, 0xa3, 0xae, 0x67, 0xac, 0x99, 0xd9, 0x0d, 0xb9, 0x22, - 0x7e, 0x40, 0x8f, 0xfc, 0xa4, 0x1e, 0x7b, 0xe4, 0x04, 0xa8, 0xfd, 0x23, 0x68, 0x3e, 0xd6, 0xb1, - 0xf3, 0x61, 0xca, 0x6d, 0x67, 0xde, 0xe7, 0x79, 0xbf, 0xdf, 0x79, 0x17, 0x7c, 0xc1, 0x85, 0x61, + // 1200 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4f, 0x73, 0x1b, 0x35, + 0x14, 0x8f, 0x9b, 0x34, 0xb5, 0x95, 0x84, 0xa6, 0x4a, 0x6b, 0xb6, 0xc9, 0xe0, 0xb8, 0x06, 0x66, + 0x3c, 0x03, 0xdd, 0x25, 0x69, 0x19, 0x66, 0x38, 0x30, 0x34, 0x36, 0xa5, 0x61, 0x4a, 0x93, 0x6e, + 0xd2, 0x1c, 0xca, 0x0c, 0x1a, 0x59, 0x52, 0x6c, 0x4d, 0xd7, 0x92, 0x47, 0xd2, 0x6e, 0xc8, 0x95, + 0x4f, 0xd0, 0x23, 0x1f, 0xa9, 0xc7, 0xde, 0xe0, 0x04, 0x4c, 0xfb, 0x45, 0x18, 0xfd, 0x59, 0xc7, + 0x6e, 0x12, 0xd3, 0xde, 0x56, 0x7a, 0xbf, 0xdf, 0xfb, 0xff, 0x9e, 0x16, 0x7c, 0xc5, 0x85, 0x61, 0x8a, 0x0c, 0x30, 0x17, 0x48, 0x33, 0x92, 0x2b, 0x6e, 0x4e, 0x13, 0x42, 0x8a, 0xa4, 0xd8, 0x4a, 0xf4, 0x00, 0x2b, 0x46, 0x11, 0x91, 0x42, 0xe7, 0x43, 0xa6, 0xe2, 0x91, 0x92, 0x46, 0xc2, 0xf5, - 0x4b, 0x18, 0x31, 0x21, 0x45, 0x5c, 0x6c, 0xad, 0x6f, 0x18, 0x26, 0x28, 0x53, 0x43, 0x2e, 0x4c, + 0x0b, 0x18, 0x31, 0x21, 0x45, 0x5c, 0x6c, 0xad, 0x6f, 0x18, 0x26, 0x28, 0x53, 0x43, 0x2e, 0x4c, 0x82, 0x7b, 0x84, 0x27, 0xe6, 0x74, 0xc4, 0xb4, 0x27, 0xae, 0x27, 0xbc, 0x47, 0x92, 0x8c, 0xf7, - 0x07, 0x86, 0x64, 0x9c, 0x09, 0xa3, 0x93, 0x09, 0x74, 0xb1, 0x35, 0x71, 0x0a, 0x84, 0x7b, 0x96, + 0x07, 0x86, 0x64, 0x9c, 0x09, 0xa3, 0x93, 0x09, 0x74, 0xb1, 0x35, 0x71, 0x0a, 0x84, 0x3b, 0x96, 0x40, 0xa4, 0x62, 0x09, 0x19, 0x60, 0x21, 0x58, 0x66, 0x51, 0xe1, 0x33, 0x40, 0x1a, 0x7d, 0x29, - 0xfb, 0x19, 0x4b, 0xdc, 0xa9, 0x97, 0x1f, 0x27, 0x34, 0x57, 0xd8, 0x70, 0x29, 0x82, 0xfc, 0x76, - 0x5f, 0xf6, 0xa5, 0xfb, 0x4c, 0xec, 0x57, 0xb8, 0xfd, 0x74, 0x46, 0xd0, 0x27, 0x5c, 0xb1, 0x00, - 0xdb, 0x3c, 0xaf, 0xdc, 0xf0, 0x21, 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, + 0x18, 0x1a, 0x49, 0x99, 0x21, 0x4c, 0xa9, 0x42, 0xda, 0xa8, 0x68, 0xc1, 0x29, 0xa9, 0x97, 0x88, + 0x87, 0x8c, 0xed, 0x4b, 0x99, 0x3d, 0xa0, 0x54, 0x1d, 0x18, 0x05, 0x9f, 0x02, 0x48, 0x48, 0x81, + 0x6c, 0x52, 0x64, 0x6e, 0x6c, 0x74, 0x5c, 0xd2, 0xe8, 0x6a, 0xb3, 0xd2, 0x5e, 0xda, 0xbe, 0x1d, + 0xfb, 0xdc, 0xc5, 0x65, 0xee, 0xe2, 0x6e, 0x28, 0xcc, 0x4e, 0xf5, 0xd5, 0xdf, 0x9b, 0x73, 0x7f, + 0xfc, 0xb3, 0x59, 0x49, 0x57, 0x09, 0x29, 0x0e, 0x3d, 0x7b, 0xdf, 0x91, 0xe1, 0x2f, 0xe0, 0x63, + 0x17, 0xcd, 0x31, 0x53, 0xef, 0xea, 0x5d, 0x7c, 0x7f, 0xbd, 0xb7, 0x4a, 0x1d, 0xd3, 0xca, 0x1f, + 0x81, 0x66, 0xd9, 0xca, 0x48, 0xb1, 0xa9, 0x14, 0x1e, 0x2b, 0x4c, 0xec, 0x47, 0x74, 0xcd, 0x45, + 0xdc, 0x28, 0x71, 0xe9, 0x14, 0xec, 0x61, 0x40, 0xc1, 0xbb, 0x00, 0x0e, 0xb8, 0x36, 0x52, 0x71, + 0x82, 0x33, 0xc4, 0x84, 0x51, 0x9c, 0xe9, 0xa8, 0xea, 0x0a, 0x78, 0xe3, 0x4c, 0xf2, 0x83, 0x17, + 0xc0, 0x27, 0x60, 0x35, 0x17, 0x3d, 0x29, 0x28, 0x17, 0xfd, 0x32, 0x9c, 0xda, 0xfb, 0x87, 0x73, + 0x7d, 0x4c, 0x0e, 0x81, 0xdc, 0x03, 0x75, 0x2d, 0x8f, 0x0d, 0x92, 0x23, 0x83, 0x6c, 0x86, 0xcc, + 0x40, 0x31, 0x3d, 0x90, 0x19, 0x8d, 0x80, 0x73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0xa1, 0xc9, 0x2e, 0x0d, 0x31, 0xfa, 0x03, 0xdc, 0x05, + 0x2b, 0x7e, 0xf2, 0xcc, 0xa9, 0x7b, 0x68, 0x5d, 0x7c, 0x4b, 0xdb, 0xeb, 0xe7, 0xb6, 0xf5, 0x61, + 0xf9, 0xcb, 0xe3, 0xd7, 0xf5, 0x4b, 0xbb, 0xae, 0x97, 0x4b, 0xaa, 0x15, 0xb6, 0x7a, 0xa0, 0x7e, + 0x71, 0xd3, 0xc0, 0x47, 0x60, 0x21, 0xe3, 0xda, 0x7a, 0x39, 0xef, 0x37, 0xd0, 0x87, 0xb4, 0x5d, + 0x28, 0xb9, 0xd3, 0xb0, 0xf3, 0xe4, 0xd5, 0x9b, 0x46, 0xe5, 0xf5, 0x9b, 0x46, 0xe5, 0xdf, 0x37, + 0x8d, 0xca, 0xcb, 0xb7, 0x8d, 0xb9, 0xd7, 0x6f, 0x1b, 0x73, 0x7f, 0xbd, 0x6d, 0xcc, 0x3d, 0xbf, + 0xdf, 0xe7, 0x66, 0x90, 0xf7, 0x62, 0x22, 0x87, 0x09, 0x91, 0x7a, 0x28, 0x75, 0x72, 0x66, 0xe6, + 0xee, 0xf8, 0xe7, 0xae, 0xb8, 0x97, 0xfc, 0xe6, 0xfe, 0xf0, 0xdc, 0x0f, 0x69, 0x6f, 0xd1, 0xc5, + 0x77, 0xef, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x25, 0x59, 0xfe, 0xb0, 0xfe, 0x0a, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -718,6 +728,14 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.RetryDelayPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RetryDelayPeriod):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintSharedConsumer(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x6a if len(m.ProviderRewardDenoms) > 0 { for iNdEx := len(m.ProviderRewardDenoms) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.ProviderRewardDenoms[iNdEx]) @@ -743,12 +761,12 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x52 } - n1, err1 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) - if err1 != nil { - return 0, err1 + n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.UnbondingPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.UnbondingPeriod):]) + if err2 != nil { + return 0, err2 } - i -= n1 - i = encodeVarintSharedConsumer(dAtA, i, uint64(n1)) + i -= n2 + i = encodeVarintSharedConsumer(dAtA, i, uint64(n2)) i-- dAtA[i] = 0x4a if m.HistoricalEntries != 0 { @@ -763,21 +781,21 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x3a } - n2, err2 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintSharedConsumer(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x32 - n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) + n3, err3 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.TransferTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.TransferTimeoutPeriod):]) if err3 != nil { return 0, err3 } i -= n3 i = encodeVarintSharedConsumer(dAtA, i, uint64(n3)) i-- + dAtA[i] = 0x32 + n4, err4 := github_com_cosmos_gogoproto_types.StdDurationMarshalTo(m.CcvTimeoutPeriod, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.CcvTimeoutPeriod):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintSharedConsumer(dAtA, i, uint64(n4)) + i-- dAtA[i] = 0x2a if len(m.ProviderFeePoolAddrStr) > 0 { i -= len(m.ProviderFeePoolAddrStr) @@ -1089,12 +1107,12 @@ func (m *MaturingVSCPacket) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n9, err9 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.MaturityTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.MaturityTime):]) - if err9 != nil { - return 0, err9 + n10, err10 := github_com_cosmos_gogoproto_types.StdTimeMarshalTo(m.MaturityTime, dAtA[i-github_com_cosmos_gogoproto_types.SizeOfStdTime(m.MaturityTime):]) + if err10 != nil { + return 0, err10 } - i -= n9 - i = encodeVarintSharedConsumer(dAtA, i, uint64(n9)) + i -= n10 + i = encodeVarintSharedConsumer(dAtA, i, uint64(n10)) i-- dAtA[i] = 0x12 if m.VscId != 0 { @@ -1202,6 +1220,8 @@ func (m *Params) Size() (n int) { n += 1 + l + sovSharedConsumer(uint64(l)) } } + l = github_com_cosmos_gogoproto_types.SizeOfStdDuration(m.RetryDelayPeriod) + n += 1 + l + sovSharedConsumer(uint64(l)) return n } @@ -1719,6 +1739,39 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.ProviderRewardDenoms = append(m.ProviderRewardDenoms, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RetryDelayPeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSharedConsumer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSharedConsumer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSharedConsumer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_cosmos_gogoproto_types.StdDurationUnmarshal(&m.RetryDelayPeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipSharedConsumer(dAtA[iNdEx:]) From a0b1e5e11b13d550a9220efebfb28d7e32d72cb0 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Tue, 19 Sep 2023 09:51:06 -0700 Subject: [PATCH 05/17] tests: throttle retry e2e tests (#1312) * boilerplate * fix test * Update proposal_test.go * apply new param to keeper code * wip * add action * incorporate queue assertions. Also make retry delay period 200s * correct queue size assertion * make wait time just 30 seconds * change naming --- tests/e2e/actions.go | 12 ++++++++++ tests/e2e/config.go | 3 ++- tests/e2e/main.go | 2 ++ tests/e2e/steps_downtime.go | 46 +++++++++++++++++++++++++++++++++++-- 4 files changed, 60 insertions(+), 3 deletions(-) diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index 7f31a3b451..b2614c4e5e 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -1974,6 +1974,18 @@ func (tr TestRun) waitForSlashMeterReplenishment( } } +type WaitTimeAction struct { + consumer chainID + waitTime time.Duration +} + +func (tr TestRun) waitForTime( + action WaitTimeAction, + verbose bool, +) { + tr.WaitTime(action.waitTime) +} + // GetPathNameForGorelayer returns the name of the path between two given chains used by Gorelayer. // Since paths are bidirectional, we need either chain to be able to be provided as first or second argument // and still return the same name, so we sort the chain names alphabetically. diff --git a/tests/e2e/config.go b/tests/e2e/config.go index 373281162d..093e32de81 100644 --- a/tests/e2e/config.go +++ b/tests/e2e/config.go @@ -186,7 +186,8 @@ func SlashThrottleTestRun() TestRun { ".app_state.slashing.params.signed_blocks_window = \"15\" | " + ".app_state.slashing.params.min_signed_per_window = \"0.500000000000000000\" | " + ".app_state.slashing.params.downtime_jail_duration = \"60s\" | " + - ".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\"", + ".app_state.slashing.params.slash_fraction_downtime = \"0.010000000000000000\" | " + + ".app_state.ccvconsumer.params.retry_delay_period = \"30s\"", }, }, tendermintConfigOverride: `s/timeout_commit = "5s"/timeout_commit = "1s"/;` + diff --git a/tests/e2e/main.go b/tests/e2e/main.go index c8a840f206..e6a8f7489b 100644 --- a/tests/e2e/main.go +++ b/tests/e2e/main.go @@ -244,6 +244,8 @@ func (tr *TestRun) runStep(step Step, verbose bool) { tr.assignConsumerPubKey(action, verbose) case slashMeterReplenishmentAction: tr.waitForSlashMeterReplenishment(action, verbose) + case WaitTimeAction: + tr.waitForTime(action, verbose) case startRelayerAction: tr.startRelayer(action, verbose) case registerConsumerRewardDenomAction: diff --git a/tests/e2e/steps_downtime.go b/tests/e2e/steps_downtime.go index d5f994879c..36a9716125 100644 --- a/tests/e2e/steps_downtime.go +++ b/tests/e2e/steps_downtime.go @@ -350,6 +350,7 @@ func stepsThrottledDowntime(consumerName string) []Step { }, }, }, + // Relay slash packet to provider, and ack back to consumer { action: relayPacketsAction{ chainA: chainID("provi"), @@ -375,8 +376,6 @@ func stepsThrottledDowntime(consumerName string) []Step { }, }, }, - // TODO(Shawn): Improve this test to have the consumer retry it's downtime slash, and to assert queue size on consumer. - // See https://github.com/cosmos/interchain-security/issues/1103 and https://github.com/cosmos/interchain-security/issues/1233 { action: slashMeterReplenishmentAction{ targetValue: 0, // We just want slash meter to be non-negative @@ -401,6 +400,49 @@ func stepsThrottledDowntime(consumerName string) []Step { validatorID("bob"): 0, validatorID("carol"): 500, }, + ConsumerPendingPacketQueueSize: uintPtr(1), // packet still queued + }, + }, + }, + // Wait for retry delay period to pass. + // Retry delay period is set to 30 seconds, see config.go, + // wait this amount of time to elapse the period. + { + action: WaitTimeAction{ + consumer: chainID(consumerName), + waitTime: 30 * time.Second, + }, + state: State{ + chainID("provi"): ChainState{ + ValPowers: &map[validatorID]uint{ + validatorID("alice"): 511, + validatorID("bob"): 0, + validatorID("carol"): 500, + }, + }, + chainID(consumerName): ChainState{ + ConsumerPendingPacketQueueSize: uintPtr(1), // packet still queued + }, + }, + }, + // Relay now that retry delay period has passed, confirm provider applies jailing + { + action: relayPacketsAction{ + chainA: chainID("provi"), + chainB: chainID(consumerName), + port: "provider", + channel: 0, + }, + state: State{ + chainID("provi"): ChainState{ + ValPowers: &map[validatorID]uint{ + validatorID("alice"): 511, + validatorID("bob"): 0, + validatorID("carol"): 0, // jailed! + }, + }, + chainID(consumerName): ChainState{ + ConsumerPendingPacketQueueSize: uintPtr(0), // relayed slash packet handled ack clears consumer queue }, }, }, From ead21ec4dba1ecd75b66645c8af5ff6723371311 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Wed, 20 Sep 2023 11:04:57 -0700 Subject: [PATCH 06/17] feat!: throttle v2 provider migration (#1317) * migration.go and incr consensus version * throttle v1 code for migration * old methods * finish test * register those migs * Update migration_test.go * lint * consumer keeper -> provider keeper --- x/ccv/provider/keeper/migration.go | 138 ++++++++++++++++++++++++ x/ccv/provider/keeper/migration_test.go | 117 ++++++++++++++++++++ x/ccv/provider/module.go | 6 +- 3 files changed, 260 insertions(+), 1 deletion(-) create mode 100644 x/ccv/provider/keeper/migration.go create mode 100644 x/ccv/provider/keeper/migration_test.go diff --git a/x/ccv/provider/keeper/migration.go b/x/ccv/provider/keeper/migration.go new file mode 100644 index 0000000000..3f04a49ef6 --- /dev/null +++ b/x/ccv/provider/keeper/migration.go @@ -0,0 +1,138 @@ +package keeper + +import ( + "fmt" + + sdktypes "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + + providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" + ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" +) + +// Migrator is a struct for handling in-place store migrations. +type Migrator struct { + providerKeeper Keeper + paramSpace paramtypes.Subspace +} + +// NewMigrator returns a new Migrator. +func NewMigrator(providerKeeper Keeper, paramSpace paramtypes.Subspace) Migrator { + return Migrator{providerKeeper: providerKeeper, paramSpace: paramSpace} +} + +// Migrate2to3 migrates x/ccvprovider state from consensus version 2 to 3. +func (m Migrator) Migrate2to3(ctx sdktypes.Context) error { + return m.providerKeeper.MigrateQueuedPackets(ctx) +} + +func (k Keeper) MigrateQueuedPackets(ctx sdktypes.Context) error { + for _, consumer := range k.GetAllConsumerChains(ctx) { + slashData, vscmData := k.GetAllThrottledPacketData(ctx, consumer.ChainId) + if len(slashData) > 0 { + ctx.Logger().Error(fmt.Sprintf("slash data being dropped: %v", slashData)) + } + for _, data := range vscmData { + k.HandleVSCMaturedPacket(ctx, consumer.ChainId, data) + } + k.DeleteThrottledPacketDataForConsumer(ctx, consumer.ChainId) + } + return nil +} + +// Pending packet data type enum, used to encode the type of packet data stored at each entry in the mutual queue. +// Note this type is copy/pasted from throttle v1 code. +const ( + slashPacketData byte = iota + vscMaturedPacketData +) + +// GetAllThrottledPacketData returns all throttled packet data for a given consumer chain, only used for 2 -> 3 migration. +// Note this method is adapted from throttle v1 code. +func (k Keeper) GetAllThrottledPacketData(ctx sdktypes.Context, consumerChainID string) ( + slashData []ccvtypes.SlashPacketData, vscMaturedData []ccvtypes.VSCMaturedPacketData, +) { + slashData = []ccvtypes.SlashPacketData{} + vscMaturedData = []ccvtypes.VSCMaturedPacketData{} + + store := ctx.KVStore(k.storeKey) + iteratorPrefix := providertypes.ChainIdWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) + iterator := sdktypes.KVStorePrefixIterator(store, iteratorPrefix) + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + bz := iterator.Value() + switch bz[0] { + case slashPacketData: + d := ccvtypes.SlashPacketData{} + if err := d.Unmarshal(bz[1:]); err != nil { + k.Logger(ctx).Error(fmt.Sprintf("failed to unmarshal slash packet data: %v", err)) + continue + } + slashData = append(slashData, d) + case vscMaturedPacketData: + d := ccvtypes.VSCMaturedPacketData{} + if err := d.Unmarshal(bz[1:]); err != nil { + k.Logger(ctx).Error(fmt.Sprintf("failed to unmarshal vsc matured packet data: %v", err)) + continue + } + vscMaturedData = append(vscMaturedData, d) + default: + k.Logger(ctx).Error(fmt.Sprintf("invalid packet data type: %v", bz[0])) + continue + } + } + + return slashData, vscMaturedData +} + +// Note this method is copy/pasted from throttle v1 code. +func (k Keeper) DeleteThrottledPacketDataForConsumer(ctx sdktypes.Context, consumerChainID string) { + store := ctx.KVStore(k.storeKey) + iteratorPrefix := providertypes.ChainIdWithLenKey(providertypes.ThrottledPacketDataBytePrefix, consumerChainID) + iterator := sdktypes.KVStorePrefixIterator(store, iteratorPrefix) + defer iterator.Close() + + keysToDel := [][]byte{} + for ; iterator.Valid(); iterator.Next() { + keysToDel = append(keysToDel, iterator.Key()) + } + // Delete data for this consumer + for _, key := range keysToDel { + store.Delete(key) + } + + // Delete size of data queue for this consumer + store.Delete(providertypes.ThrottledPacketDataSizeKey(consumerChainID)) +} + +// Note this method is adapted from throttle v1 code. +func (k Keeper) QueueThrottledPacketDataOnlyForTesting( + ctx sdktypes.Context, consumerChainID string, ibcSeqNum uint64, packetData interface{}, +) error { + store := ctx.KVStore(k.storeKey) + + var bz []byte + var err error + switch data := packetData.(type) { + case ccvtypes.SlashPacketData: + bz, err = data.Marshal() + if err != nil { + return fmt.Errorf("failed to marshal slash packet data: %v", err) + } + bz = append([]byte{slashPacketData}, bz...) + case ccvtypes.VSCMaturedPacketData: + bz, err = data.Marshal() + if err != nil { + return fmt.Errorf("failed to marshal vsc matured packet data: %v", err) + } + bz = append([]byte{vscMaturedPacketData}, bz...) + default: + // Indicates a developer error, this method should only be called + // by tests, QueueThrottledSlashPacketData, or QueueThrottledVSCMaturedPacketData. + panic(fmt.Sprintf("unexpected packet data type: %T", data)) + } + + store.Set(providertypes.ThrottledPacketDataKey(consumerChainID, ibcSeqNum), bz) + return nil +} diff --git a/x/ccv/provider/keeper/migration_test.go b/x/ccv/provider/keeper/migration_test.go new file mode 100644 index 0000000000..a710e3979c --- /dev/null +++ b/x/ccv/provider/keeper/migration_test.go @@ -0,0 +1,117 @@ +package keeper_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + testutil "github.com/cosmos/interchain-security/v3/testutil/keeper" +) + +func TestMigrate2To3(t *testing.T) { + providerKeeper, ctx, ctrl, _ := testutil.GetProviderKeeperAndCtx(t, testutil.NewInMemKeeperParams(t)) + defer ctrl.Finish() + + // Set consumer client ids to mock consumers being connected to provider + providerKeeper.SetConsumerClientId(ctx, "chain-1", "client-1") + providerKeeper.SetConsumerClientId(ctx, "chain-2", "client-2") + providerKeeper.SetConsumerClientId(ctx, "chain-3", "client-3") + + // Queue some data for chain-1 + providerKeeper.QueueThrottledPacketDataOnlyForTesting( + ctx, "chain-1", 66, testutil.GetNewSlashPacketData()) + providerKeeper.QueueThrottledPacketDataOnlyForTesting( + ctx, "chain-1", 67, testutil.GetNewVSCMaturedPacketData()) + providerKeeper.QueueThrottledPacketDataOnlyForTesting( + ctx, "chain-1", 68, testutil.GetNewSlashPacketData()) + providerKeeper.QueueThrottledPacketDataOnlyForTesting( + ctx, "chain-1", 69, testutil.GetNewVSCMaturedPacketData()) + + // Queue some data for chain-2 + providerKeeper.QueueThrottledPacketDataOnlyForTesting( + ctx, "chain-2", 789, testutil.GetNewVSCMaturedPacketData()) + providerKeeper.QueueThrottledPacketDataOnlyForTesting( + ctx, "chain-2", 790, testutil.GetNewSlashPacketData()) + providerKeeper.QueueThrottledPacketDataOnlyForTesting( + ctx, "chain-2", 791, testutil.GetNewVSCMaturedPacketData()) + + // Queue some data for chain-3 + providerKeeper.QueueThrottledPacketDataOnlyForTesting( + ctx, "chain-3", 123, testutil.GetNewSlashPacketData()) + providerKeeper.QueueThrottledPacketDataOnlyForTesting( + ctx, "chain-3", 124, testutil.GetNewVSCMaturedPacketData()) + providerKeeper.QueueThrottledPacketDataOnlyForTesting( + ctx, "chain-3", 125, testutil.GetNewVSCMaturedPacketData()) + + // Confirm getter methods return expected values + slash1, vscm1 := providerKeeper.GetAllThrottledPacketData(ctx, "chain-1") + require.Len(t, slash1, 2) + require.Len(t, vscm1, 2) + + slash2, vscm2 := providerKeeper.GetAllThrottledPacketData(ctx, "chain-2") + require.Len(t, slash2, 1) + require.Len(t, vscm2, 2) + + slash3, vscm3 := providerKeeper.GetAllThrottledPacketData(ctx, "chain-3") + require.Len(t, slash3, 1) + require.Len(t, vscm3, 2) + + // Set vsc send timestamp for every queued vsc matured packet, + // as a way to assert that the vsc matured packets are handled in the migration. + // + // That is, timestamp should exist before a vsc matured packet is handled, + // and deleted after handling. + for _, data := range vscm1 { + providerKeeper.SetVscSendTimestamp(ctx, "chain-1", data.ValsetUpdateId, time.Now()) + } + for _, data := range vscm2 { + providerKeeper.SetVscSendTimestamp(ctx, "chain-2", data.ValsetUpdateId, time.Now()) + } + for _, data := range vscm3 { + providerKeeper.SetVscSendTimestamp(ctx, "chain-3", data.ValsetUpdateId, time.Now()) + } + + // Confirm timestamps are set + for _, data := range vscm1 { + _, found := providerKeeper.GetVscSendTimestamp(ctx, "chain-1", data.ValsetUpdateId) + require.True(t, found) + } + for _, data := range vscm2 { + _, found := providerKeeper.GetVscSendTimestamp(ctx, "chain-2", data.ValsetUpdateId) + require.True(t, found) + } + for _, data := range vscm3 { + _, found := providerKeeper.GetVscSendTimestamp(ctx, "chain-3", data.ValsetUpdateId) + require.True(t, found) + } + + // Run migration + err := providerKeeper.MigrateQueuedPackets(ctx) + require.NoError(t, err) + + // Confirm throttled data is now deleted + slash1, vscm1 = providerKeeper.GetAllThrottledPacketData(ctx, "chain-1") + require.Empty(t, slash1) + require.Empty(t, vscm1) + slash2, vscm2 = providerKeeper.GetAllThrottledPacketData(ctx, "chain-2") + require.Empty(t, slash2) + require.Empty(t, vscm2) + slash3, vscm3 = providerKeeper.GetAllThrottledPacketData(ctx, "chain-3") + require.Empty(t, slash3) + require.Empty(t, vscm3) + + // Confirm timestamps are deleted, meaning vsc matured packets were handled + for _, data := range vscm1 { + _, found := providerKeeper.GetVscSendTimestamp(ctx, "chain-1", data.ValsetUpdateId) + require.False(t, found) + } + for _, data := range vscm2 { + _, found := providerKeeper.GetVscSendTimestamp(ctx, "chain-2", data.ValsetUpdateId) + require.False(t, found) + } + for _, data := range vscm3 { + _, found := providerKeeper.GetVscSendTimestamp(ctx, "chain-3", data.ValsetUpdateId) + require.False(t, found) + } +} diff --git a/x/ccv/provider/module.go b/x/ccv/provider/module.go index 5aa743ec2d..c70fdeafa7 100644 --- a/x/ccv/provider/module.go +++ b/x/ccv/provider/module.go @@ -107,6 +107,10 @@ func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) { func (am AppModule) RegisterServices(cfg module.Configurator) { providertypes.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) providertypes.RegisterQueryServer(cfg.QueryServer(), am.keeper) + m := keeper.NewMigrator(*am.keeper, am.paramSpace) + if err := cfg.RegisterMigration(providertypes.ModuleName, 2, m.Migrate2to3); err != nil { + panic(fmt.Sprintf("failed to register migrator for %s: %s", providertypes.ModuleName, err)) + } } // InitGenesis performs genesis initialization for the provider module. It returns no validator updates. @@ -129,7 +133,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw } // ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 2 } +func (AppModule) ConsensusVersion() uint64 { return 3 } // BeginBlock implements the AppModule interface func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { From 01b001f5cbd04b5edc9d47fd3b633a060297277d Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:36:14 -0700 Subject: [PATCH 07/17] some fixes --- tests/e2e/actions.go | 20 +- tests/e2e/main.go | 2 +- tests/e2e/state.go | 14 +- tests/e2e/steps_downtime.go | 120 ++++++------ tests/integration/slashing.go | 4 +- x/ccv/consumer/types/query.pb.go | 110 +++++------ x/ccv/provider/types/query.pb.go | 138 ++++++------- x/ccv/types/params.go | 4 +- x/ccv/types/shared_consumer.pb.go | 315 +++++++++++++++--------------- 9 files changed, 362 insertions(+), 365 deletions(-) diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index 6982ea0df0..9ebc50221d 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -2047,16 +2047,16 @@ func (tr TestRun) assignConsumerPubKey(action assignConsumerPubKeyAction, verbos // slashMeterReplenishmentAction polls the slash meter on provider until value is achieved type slashMeterReplenishmentAction struct { - targetValue int64 + TargetValue int64 // panic if timeout is exceeded - timeout time.Duration + Timeout time.Duration } func (tr TestRun) waitForSlashMeterReplenishment( action slashMeterReplenishmentAction, verbose bool, ) { - timeout := time.Now().Add(action.timeout) + timeout := time.Now().Add(action.Timeout) initialSlashMeter := tr.getSlashMeter() if initialSlashMeter >= 0 { @@ -2070,28 +2070,28 @@ func (tr TestRun) waitForSlashMeterReplenishment( } // check if meter has reached target value - if slashMeter >= action.targetValue { + if slashMeter >= action.TargetValue { break } if time.Now().After(timeout) { - panic(fmt.Sprintf("\n\nwaitForSlashMeterReplenishment has timed out after: %s\n\n", action.timeout)) + panic(fmt.Sprintf("\n\nwaitForSlashMeterReplenishment has timed out after: %s\n\n", action.Timeout)) } tr.WaitTime(5 * time.Second) } } -type WaitTimeAction struct { - consumer chainID - waitTime time.Duration +type waitTimeAction struct { + Consumer ChainID + WaitTime time.Duration } func (tr TestRun) waitForTime( - action WaitTimeAction, + action waitTimeAction, verbose bool, ) { - tr.WaitTime(action.waitTime) + tr.WaitTime(action.WaitTime) } // GetPathNameForGorelayer returns the name of the path between two given chains used by Gorelayer. diff --git a/tests/e2e/main.go b/tests/e2e/main.go index 3f28c557a5..73d9b786c0 100644 --- a/tests/e2e/main.go +++ b/tests/e2e/main.go @@ -256,7 +256,7 @@ func (tr *TestRun) runStep(step Step, verbose bool) { tr.assignConsumerPubKey(action, verbose) case slashMeterReplenishmentAction: tr.waitForSlashMeterReplenishment(action, verbose) - case WaitTimeAction: + case waitTimeAction: tr.waitForTime(action, verbose) case startRelayerAction: tr.startRelayer(action, verbose) diff --git a/tests/e2e/state.go b/tests/e2e/state.go index 7746ae7508..0cda18c6a3 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -23,9 +23,9 @@ type ChainState struct { RepresentativePowers *map[ValidatorID]uint Params *[]Param Rewards *Rewards - ConsumerChains *map[chainID]bool - AssignedKeys *map[validatorID]string - ProviderKeys *map[validatorID]string // validatorID: validator provider key + ConsumerChains *map[ChainID]bool + AssignedKeys *map[ValidatorID]string + ProviderKeys *map[ValidatorID]string // validatorID: validator provider key ConsumerPendingPacketQueueSize *uint // Only relevant to consumer chains RegisteredConsumerRewardDenoms *[]string } @@ -661,7 +661,7 @@ func (tr TestRun) getProviderAddressFromConsumer(consumerChain ChainID, validato func (tr TestRun) getSlashMeter() int64 { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", - tr.containerConfig.instanceName, tr.chainConfigs[chainID("provi")].binaryName, + tr.containerConfig.InstanceName, tr.chainConfigs[ChainID("provi")].BinaryName, "query", "provider", "throttle-state", `--node`, tr.getQueryNode(ChainID("provi")), @@ -698,9 +698,9 @@ func (tr TestRun) getRegisteredConsumerRewardDenoms(chain ChainID) []string { return rewardDenoms } -func (tr TestRun) getPendingPacketQueueSize(chain chainID) uint { +func (tr TestRun) getPendingPacketQueueSize(chain ChainID) uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. - cmd := exec.Command("docker", "exec", tr.containerConfig.instanceName, tr.chainConfigs[chain].binaryName, + cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, "query", "ccvconsumer", "throttle-state", `--node`, tr.getQueryNode(chain), @@ -719,7 +719,7 @@ func (tr TestRun) getPendingPacketQueueSize(chain chainID) uint { return uint(len(packetData)) } -func (tr TestRun) getValidatorNode(chain chainID, validator validatorID) string { +func (tr TestRun) getValidatorNode(chain ChainID, validator ValidatorID) string { // for CometMock, validatorNodes are all the same address as the query node (which is CometMocks address) if tr.useCometmock { return tr.getQueryNode(chain) diff --git a/tests/e2e/steps_downtime.go b/tests/e2e/steps_downtime.go index 17cdc5dbdd..01f277eea8 100644 --- a/tests/e2e/steps_downtime.go +++ b/tests/e2e/steps_downtime.go @@ -53,12 +53,12 @@ func stepsDowntime(consumerName string) []Step { ValidatorID("carol"): 501, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 509, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 509, // Bob's stake may or may not be slashed at this point depending on comet vs cometmock // See https://github.com/cosmos/interchain-security/issues/1304 - validatorID("carol"): 501, + ValidatorID("carol"): 501, }, }, }, @@ -278,13 +278,13 @@ func stepsThrottledDowntime(consumerName string) []Step { Chain: ChainID(consumerName), Validator: ValidatorID("bob"), }, - state: State{ + State: State{ // slash packet queued for bob on consumer, but powers not affected on either chain yet - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, - validatorID("carol"): 500, + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, + ValidatorID("carol"): 500, }, }, ChainID(consumerName): ChainState{ @@ -332,19 +332,19 @@ func stepsThrottledDowntime(consumerName string) []Step { Chain: ChainID(consumerName), Validator: ValidatorID("carol"), }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 500, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 500, // VSC packet jailing bob is not yet relayed to consumer - validatorID("carol"): 500, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 500, // VSC packet jailing bob is not yet relayed to consumer + ValidatorID("carol"): 500, }, ConsumerPendingPacketQueueSize: uintPtr(1), // carol's downtime slash packet is queued }, @@ -358,39 +358,39 @@ func stepsThrottledDowntime(consumerName string) []Step { Port: "provider", Channel: 0, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 500, // slash packet for carol recv by provider, carol not slashed due to throttling + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, // slash packet for carol recv by provider, carol not slashed due to throttling }, }, - chainID(consumerName): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, // VSC packet applying bob jailing is also relayed and recv by consumer - validatorID("carol"): 500, + ChainID(consumerName): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, // VSC packet applying bob jailing is also relayed and recv by consumer + ValidatorID("carol"): 500, }, ConsumerPendingPacketQueueSize: uintPtr(1), // slash packet bounced ack keeps carol's downtime slash packet queued }, }, }, { - action: slashMeterReplenishmentAction{ - targetValue: 0, // We just want slash meter to be non-negative + Action: slashMeterReplenishmentAction{ + TargetValue: 0, // We just want slash meter to be non-negative // Slash meter replenish fraction is set to 10%, replenish period is 20 seconds, see config.go // Meter is initially at 10%, decremented to -23% from bob being jailed. It'll then take three replenishments // for meter to become positive again. 3*20 = 60 seconds + buffer = 100 seconds - timeout: 100 * time.Second, - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 500, // Carol still not slashed, packet must be retried + Timeout: 100 * time.Second, + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, // Carol still not slashed, packet must be retried }, }, ChainID(consumerName): ChainState{ @@ -408,19 +408,19 @@ func stepsThrottledDowntime(consumerName string) []Step { // Retry delay period is set to 30 seconds, see config.go, // wait this amount of time to elapse the period. { - action: WaitTimeAction{ - consumer: chainID(consumerName), - waitTime: 30 * time.Second, - }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 500, + Action: waitTimeAction{ + Consumer: ChainID(consumerName), + WaitTime: 30 * time.Second, + }, + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 500, }, }, - chainID(consumerName): ChainState{ + ChainID(consumerName): ChainState{ ConsumerPendingPacketQueueSize: uintPtr(1), // packet still queued }, }, @@ -433,15 +433,15 @@ func stepsThrottledDowntime(consumerName string) []Step { Port: "provider", Channel: 0, }, - state: State{ - chainID("provi"): ChainState{ - ValPowers: &map[validatorID]uint{ - validatorID("alice"): 511, - validatorID("bob"): 0, - validatorID("carol"): 0, // jailed! + State: State{ + ChainID("provi"): ChainState{ + ValPowers: &map[ValidatorID]uint{ + ValidatorID("alice"): 511, + ValidatorID("bob"): 0, + ValidatorID("carol"): 0, // jailed! }, }, - chainID(consumerName): ChainState{ + ChainID(consumerName): ChainState{ ConsumerPendingPacketQueueSize: uintPtr(0), // relayed slash packet handled ack clears consumer queue }, }, diff --git a/tests/integration/slashing.go b/tests/integration/slashing.go index 4dc3c0aa91..e80775f1c2 100644 --- a/tests/integration/slashing.go +++ b/tests/integration/slashing.go @@ -72,8 +72,8 @@ func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { timeoutHeight = clienttypes.Height{} timeoutTimestamp = uint64(s.getFirstBundle().GetCtx().BlockTime().Add(ccv.DefaultCCVTimeoutPeriod).UnixNano()) ) - slashPacket := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmVal, stakingtypes.Infraction_INFRACTION_DOWNTIME) - sequence, err := s.getFirstBundle().Path.EndpointA.SendPacket(timeoutHeight, timeoutTimestamp, slashPacket.GetBytes()) + slashPacket := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmVal, stakingtypes.Infraction_INFRACTION_DOWNTIME, 1) + sequence, err := s.getFirstBundle().Path.EndpointA.SendPacket(timeoutHeight, timeoutTimestamp, slashPacket.GetData()) s.Require().NoError(err) // Set outstanding slashing flag for first consumer, it's important to use the consumer's cons addr here diff --git a/x/ccv/consumer/types/query.pb.go b/x/ccv/consumer/types/query.pb.go index 282718d4e8..e1dd01af4b 100644 --- a/x/ccv/consumer/types/query.pb.go +++ b/x/ccv/consumer/types/query.pb.go @@ -253,7 +253,7 @@ var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo // QueryParamsResponse is response type for the Query/Params RPC method. type QueryParamsResponse struct { // params holds all the parameters of this module. - Params types.Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + Params types.ConsumerParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } @@ -289,11 +289,11 @@ func (m *QueryParamsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo -func (m *QueryParamsResponse) GetParams() types.Params { +func (m *QueryParamsResponse) GetParams() types.ConsumerParams { if m != nil { return m.Params } - return types.Params{} + return types.ConsumerParams{} } type QueryProviderInfoRequest struct { @@ -559,58 +559,58 @@ func init() { var fileDescriptor_f627751d3cc10225 = []byte{ // 825 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0xe3, 0x44, - 0x14, 0x8e, 0xd3, 0x36, 0xbb, 0x99, 0x2e, 0x42, 0x3b, 0x04, 0xc9, 0x78, 0x57, 0xa1, 0x32, 0x20, - 0x02, 0x52, 0xec, 0x24, 0x3d, 0x74, 0x39, 0x2c, 0x5b, 0xb5, 0xa1, 0x22, 0x12, 0xa0, 0xd4, 0xad, - 0x54, 0xc1, 0x25, 0x4c, 0x27, 0xd3, 0xc4, 0x22, 0xf1, 0xb8, 0x33, 0x63, 0xd3, 0xde, 0x10, 0xdc, - 0x11, 0x12, 0xff, 0x84, 0x3f, 0xc0, 0xb5, 0x12, 0x07, 0x2a, 0x71, 0x00, 0x2e, 0x08, 0xb5, 0xfc, - 0x08, 0x8e, 0x68, 0xc6, 0xe3, 0xd4, 0x69, 0xd3, 0xc4, 0x2d, 0x7b, 0xb3, 0xdf, 0x37, 0xef, 0x7b, - 0xdf, 0xf7, 0x3c, 0xef, 0x25, 0xc0, 0xf5, 0x03, 0x41, 0x18, 0x1e, 0x22, 0x3f, 0xe8, 0x71, 0x82, - 0x23, 0xe6, 0x8b, 0x53, 0x17, 0xe3, 0xd8, 0xc5, 0x34, 0xe0, 0xd1, 0x98, 0x30, 0x37, 0x6e, 0xba, - 0xc7, 0x11, 0x61, 0xa7, 0x4e, 0xc8, 0xa8, 0xa0, 0xf0, 0xad, 0x19, 0x09, 0x0e, 0xc6, 0xb1, 0x93, - 0x26, 0x38, 0x71, 0xd3, 0x6a, 0xdc, 0xc6, 0x1a, 0x37, 0x5d, 0x3e, 0x44, 0x8c, 0xf4, 0x7b, 0x93, - 0xe3, 0x8a, 0xd6, 0xaa, 0x0c, 0xe8, 0x80, 0xaa, 0x47, 0x57, 0x3e, 0xe9, 0xe8, 0xd3, 0x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8, 0x20, 0xd4, 0xf2, + 0x21, 0x38, 0xa2, 0x19, 0x8f, 0x53, 0xa7, 0x4d, 0x13, 0xb7, 0xec, 0xcd, 0xf3, 0xfe, 0xfc, 0xde, + 0xef, 0xf7, 0x66, 0xde, 0x4b, 0x80, 0x1b, 0x84, 0x82, 0x30, 0x3c, 0x44, 0x41, 0xe8, 0x73, 0x82, + 0x63, 0x16, 0x88, 0x13, 0x17, 0xe3, 0xc4, 0xc5, 0x34, 0xe4, 0xf1, 0x98, 0x30, 0x37, 0x69, 0xbb, + 0x47, 0x31, 0x61, 0x27, 0x4e, 0xc4, 0xa8, 0xa0, 0xf0, 0xad, 0x19, 0x09, 0x0e, 0xc6, 0x89, 0x93, + 0x25, 0x38, 0x49, 0xdb, 0x6a, 0xdd, 0x84, 0x9a, 0xb4, 0x5d, 0x3e, 0x44, 0x8c, 0xf4, 0xfd, 0x49, + 0xb8, 0x82, 0xb5, 0x6a, 0x03, 0x3a, 0xa0, 0xea, 0xd3, 0x95, 0x5f, 0xda, 0xfa, 0x78, 0x40, 0xe9, + 0x60, 0x44, 0x5c, 0x14, 0x05, 0x2e, 0x0a, 0x43, 0x2a, 0x90, 0x08, 0x68, 0xc8, 0xb5, 0xb7, 0x53, + 0x84, 0xfb, 0x95, 0x3a, 0xef, 0xcc, 0x61, 0xf6, 0x75, 0xc0, 0x48, 0x1a, 0x66, 0x7f, 0x5f, 0x06, + 0x8f, 0x3e, 0x25, 0xc7, 0x62, 0x8b, 0x90, 0x6e, 0xc0, 0x05, 0x0b, 0x0e, 0x62, 0x59, 0xf9, 0x23, + 0x2e, 0x82, 0x31, 0x12, 0x04, 0xbe, 0x0d, 0x5e, 0xc1, 0x31, 0x63, 0x24, 0x14, 0xdb, 0x24, 0x18, + 0x0c, 0x85, 0x69, 0xac, 0x19, 0x8d, 0x25, 0x6f, 0xda, 0x08, 0xeb, 0x00, 0x8c, 0x10, 0xcf, 0x42, + 0xca, 0x2a, 0x24, 0x67, 0x91, 0xfe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45, 0xfd, 0x99, 0x58, 0xff, 0x2f, 0x00, 0x00, 0xff, + 0xff, 0x0e, 0x14, 0x5a, 0xa9, 0x65, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/ccv/provider/types/query.pb.go b/x/ccv/provider/types/query.pb.go index 0ff8aba62c..37ef05d20f 100644 --- a/x/ccv/provider/types/query.pb.go +++ b/x/ccv/provider/types/query.pb.go @@ -79,7 +79,7 @@ func (m *QueryConsumerGenesisRequest) GetChainId() string { } type QueryConsumerGenesisResponse struct { - GenesisState types.GenesisState `protobuf:"bytes,1,opt,name=genesis_state,json=genesisState,proto3" json:"genesis_state"` + GenesisState types.ConsumerGenesisState `protobuf:"bytes,1,opt,name=genesis_state,json=genesisState,proto3" json:"genesis_state"` } func (m *QueryConsumerGenesisResponse) Reset() { *m = QueryConsumerGenesisResponse{} } @@ -115,11 +115,11 @@ func (m *QueryConsumerGenesisResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryConsumerGenesisResponse proto.InternalMessageInfo -func (m *QueryConsumerGenesisResponse) GetGenesisState() types.GenesisState { +func (m *QueryConsumerGenesisResponse) GetGenesisState() types.ConsumerGenesisState { if m != nil { return m.GenesisState } - return types.GenesisState{} + return types.ConsumerGenesisState{} } type QueryConsumerChainsRequest struct { @@ -806,74 +806,74 @@ func init() { } var fileDescriptor_422512d7b7586cd7 = []byte{ - // 1059 bytes of a gzipped FileDescriptorProto + // 1060 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0xcf, 0x6f, 0xdc, 0x44, - 0x14, 0x5e, 0x27, 0x34, 0x24, 0x13, 0x20, 0xd5, 0xb4, 0x94, 0xad, 0x13, 0xed, 0x16, 0x57, 0xc0, - 0xb6, 0x80, 0xdd, 0xdd, 0x5c, 0xda, 0xa2, 0x74, 0xb3, 0x1b, 0x42, 0xa8, 0xda, 0xaa, 0xc1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, 0x62, 0xd8, 0xee, 0x50, 0x97, 0xef, 0x19, 0xb6, 0x1d, 0x1a, 0x01, 0x25, 0xa1, 0xeb, 0x60, + 0x6a, 0x84, 0x15, 0xe3, 0x7e, 0x07, 0xd3, 0x3d, 0x3d, 0xa0, 0x84, 0x13, 0x78, 0x31, 0x23, 0x41, + 0xb7, 0xed, 0x50, 0x4f, 0x12, 0xf4, 0xb0, 0xa2, 0x2e, 0x35, 0x09, 0x69, 0x7a, 0xd8, 0x40, 0x81, + 0x6b, 0x20, 0xdf, 0x27, 0x1c, 0x71, 0x97, 0xf8, 0x2c, 0x86, 0x50, 0xcf, 0x36, 0x49, 0x93, 0x88, + 0x47, 0x23, 0x7a, 0x92, 0xab, 0x65, 0x99, 0x23, 0xde, 0x76, 0x3a, 0xdf, 0x1a, 0xdc, 0x6d, 0x63, + 0xc6, 0x51, 0x3b, 0x90, 0x01, 0xd5, 0x3c, 0x54, 0x53, 0x16, 0x71, 0xce, 0xca, 0x61, 0x39, 0x61, + 0xc5, 0x60, 0x2d, 0x44, 0xb1, 0x63, 0xd9, 0xc4, 0x67, 0x9d, 0x76, 0x9a, 0xf1, 0xce, 0x88, 0x8c, + 0x5d, 0x97, 0xe2, 0x38, 0x4c, 0xbb, 0x02, 0x16, 0x3f, 0x8b, 0xba, 0xb2, 0x21, 0xb3, 0xb7, 0xb0, + 0x8f, 0x99, 0xcb, 0x4c, 0x7c, 0xbf, 0x83, 0x19, 0x87, 0xe7, 0xc1, 0x6c, 0x0c, 0xe1, 0x3a, 0x45, + 0xe5, 0x82, 0xb2, 0x3c, 0x67, 0xbe, 0x2a, 0xde, 0x6f, 0x38, 0xda, 0x43, 0xb0, 0x94, 0x9d, 0xc9, + 0x02, 0xe2, 0x33, 0x0c, 0xbf, 0x02, 0xaf, 0x37, 0xe3, 0x25, 0x8b, 0x71, 0xc4, 0xb1, 0xc8, 0x9f, + 0xaf, 0xae, 0xe8, 0x87, 0x35, 0x3e, 0xac, 0xe8, 0x03, 0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 0x4f, 0xbd, 0x0f, 0xd3, 0x7a, 0xe1, 0xaa, 0xf1, 0x60, 0xa0, 0xf3, 0x7b, 0x01, 0x66, + 0x3b, 0x33, 0xe2, 0xe3, 0x64, 0xf5, 0x65, 0x00, 0x00, 0x00, 0xff, 0xff, 0xad, 0x57, 0x98, 0xb7, + 0x30, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/ccv/types/params.go b/x/ccv/types/params.go index 82e8e84361..c80e353d66 100644 --- a/x/ccv/types/params.go +++ b/x/ccv/types/params.go @@ -72,8 +72,8 @@ func NewParams(enabled bool, blocksPerDistributionTransmission int64, consumerRedistributionFraction string, historicalEntries int64, consumerUnbondingPeriod time.Duration, softOptOutThreshold string, rewardDenoms, providerRewardDenoms []string, retryDelayPeriod time.Duration, -) Params { - return Params{ +) ConsumerParams { + return ConsumerParams{ Enabled: enabled, BlocksPerDistributionTransmission: blocksPerDistributionTransmission, DistributionTransmissionChannel: distributionTransmissionChannel, diff --git a/x/ccv/types/shared_consumer.pb.go b/x/ccv/types/shared_consumer.pb.go index 36d54394cb..e979c70f4b 100644 --- a/x/ccv/types/shared_consumer.pb.go +++ b/x/ccv/types/shared_consumer.pb.go @@ -31,13 +31,11 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// Params defines the parameters for CCV consumer module. +// ConsumerParams defines the parameters for CCV consumer module. // // Note this type is referenced in both the consumer and provider CCV modules, // and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis. -// -// TODO: Rename to ConsumerParams. See https://github.com/cosmos/interchain-security/issues/1206 -type Params struct { +type ConsumerParams struct { // TODO: Remove enabled flag and find a better way to setup integration tests // See: https://github.com/cosmos/interchain-security/issues/339 Enabled bool `protobuf:"varint,1,opt,name=enabled,proto3" json:"enabled,omitempty"` @@ -83,18 +81,18 @@ type Params struct { RetryDelayPeriod time.Duration `protobuf:"bytes,13,opt,name=retry_delay_period,json=retryDelayPeriod,proto3,stdduration" json:"retry_delay_period"` } -func (m *Params) Reset() { *m = Params{} } -func (m *Params) String() string { return proto.CompactTextString(m) } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { +func (m *ConsumerParams) Reset() { *m = ConsumerParams{} } +func (m *ConsumerParams) String() string { return proto.CompactTextString(m) } +func (*ConsumerParams) ProtoMessage() {} +func (*ConsumerParams) Descriptor() ([]byte, []int) { return fileDescriptor_d0a8be0efc64dfbc, []int{0} } -func (m *Params) XXX_Unmarshal(b []byte) error { +func (m *ConsumerParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ConsumerParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) + return xxx_messageInfo_ConsumerParams.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -104,120 +102,118 @@ func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { return b[:n], nil } } -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) +func (m *ConsumerParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsumerParams.Merge(m, src) } -func (m *Params) XXX_Size() int { +func (m *ConsumerParams) XXX_Size() int { return m.Size() } -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) +func (m *ConsumerParams) XXX_DiscardUnknown() { + xxx_messageInfo_ConsumerParams.DiscardUnknown(m) } -var xxx_messageInfo_Params proto.InternalMessageInfo +var xxx_messageInfo_ConsumerParams proto.InternalMessageInfo -func (m *Params) GetEnabled() bool { +func (m *ConsumerParams) GetEnabled() bool { if m != nil { return m.Enabled } return false } -func (m *Params) GetBlocksPerDistributionTransmission() int64 { +func (m *ConsumerParams) GetBlocksPerDistributionTransmission() int64 { if m != nil { return m.BlocksPerDistributionTransmission } return 0 } -func (m *Params) GetDistributionTransmissionChannel() string { +func (m *ConsumerParams) GetDistributionTransmissionChannel() string { if m != nil { return m.DistributionTransmissionChannel } return "" } -func (m *Params) GetProviderFeePoolAddrStr() string { +func (m *ConsumerParams) GetProviderFeePoolAddrStr() string { if m != nil { return m.ProviderFeePoolAddrStr } return "" } -func (m *Params) GetCcvTimeoutPeriod() time.Duration { +func (m *ConsumerParams) GetCcvTimeoutPeriod() time.Duration { if m != nil { return m.CcvTimeoutPeriod } return 0 } -func (m *Params) GetTransferTimeoutPeriod() time.Duration { +func (m *ConsumerParams) GetTransferTimeoutPeriod() time.Duration { if m != nil { return m.TransferTimeoutPeriod } return 0 } -func (m *Params) GetConsumerRedistributionFraction() string { +func (m *ConsumerParams) GetConsumerRedistributionFraction() string { if m != nil { return m.ConsumerRedistributionFraction } return "" } -func (m *Params) GetHistoricalEntries() int64 { +func (m *ConsumerParams) GetHistoricalEntries() int64 { if m != nil { return m.HistoricalEntries } return 0 } -func (m *Params) GetUnbondingPeriod() time.Duration { +func (m *ConsumerParams) GetUnbondingPeriod() time.Duration { if m != nil { return m.UnbondingPeriod } return 0 } -func (m *Params) GetSoftOptOutThreshold() string { +func (m *ConsumerParams) GetSoftOptOutThreshold() string { if m != nil { return m.SoftOptOutThreshold } return "" } -func (m *Params) GetRewardDenoms() []string { +func (m *ConsumerParams) GetRewardDenoms() []string { if m != nil { return m.RewardDenoms } return nil } -func (m *Params) GetProviderRewardDenoms() []string { +func (m *ConsumerParams) GetProviderRewardDenoms() []string { if m != nil { return m.ProviderRewardDenoms } return nil } -func (m *Params) GetRetryDelayPeriod() time.Duration { +func (m *ConsumerParams) GetRetryDelayPeriod() time.Duration { if m != nil { return m.RetryDelayPeriod } return 0 } -// GenesisState defines the CCV consumer chain genesis state. +// ConsumerGenesisState defines the CCV consumer chain genesis state. // // Note this type is referenced in both the consumer and provider CCV modules, // and persisted on the provider, see MakeConsumerGenesis and SetConsumerGenesis. -// -// TODO: Rename to ConsumerGenesisState. See https://github.com/cosmos/interchain-security/issues/1206 -type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` - ProviderClientId string `protobuf:"bytes,2,opt,name=provider_client_id,json=providerClientId,proto3" json:"provider_client_id,omitempty"` - ProviderChannelId string `protobuf:"bytes,3,opt,name=provider_channel_id,json=providerChannelId,proto3" json:"provider_channel_id,omitempty"` - NewChain bool `protobuf:"varint,4,opt,name=new_chain,json=newChain,proto3" json:"new_chain,omitempty"` +type ConsumerGenesisState struct { + Params ConsumerParams `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + ProviderClientId string `protobuf:"bytes,2,opt,name=provider_client_id,json=providerClientId,proto3" json:"provider_client_id,omitempty"` + ProviderChannelId string `protobuf:"bytes,3,opt,name=provider_channel_id,json=providerChannelId,proto3" json:"provider_channel_id,omitempty"` + NewChain bool `protobuf:"varint,4,opt,name=new_chain,json=newChain,proto3" json:"new_chain,omitempty"` // ProviderClientState filled in on new chain, nil on restart. ProviderClientState *_07_tendermint.ClientState `protobuf:"bytes,5,opt,name=provider_client_state,json=providerClientState,proto3" json:"provider_client_state,omitempty"` // ProviderConsensusState filled in on new chain, nil on restart. @@ -237,18 +233,18 @@ type GenesisState struct { PreCCV bool `protobuf:"varint,13,opt,name=preCCV,proto3" json:"preCCV,omitempty"` } -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { +func (m *ConsumerGenesisState) Reset() { *m = ConsumerGenesisState{} } +func (m *ConsumerGenesisState) String() string { return proto.CompactTextString(m) } +func (*ConsumerGenesisState) ProtoMessage() {} +func (*ConsumerGenesisState) Descriptor() ([]byte, []int) { return fileDescriptor_d0a8be0efc64dfbc, []int{1} } -func (m *GenesisState) XXX_Unmarshal(b []byte) error { +func (m *ConsumerGenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *ConsumerGenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + return xxx_messageInfo_ConsumerGenesisState.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -258,103 +254,103 @@ func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) return b[:n], nil } } -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) +func (m *ConsumerGenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsumerGenesisState.Merge(m, src) } -func (m *GenesisState) XXX_Size() int { +func (m *ConsumerGenesisState) XXX_Size() int { return m.Size() } -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) +func (m *ConsumerGenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_ConsumerGenesisState.DiscardUnknown(m) } -var xxx_messageInfo_GenesisState proto.InternalMessageInfo +var xxx_messageInfo_ConsumerGenesisState proto.InternalMessageInfo -func (m *GenesisState) GetParams() Params { +func (m *ConsumerGenesisState) GetParams() ConsumerParams { if m != nil { return m.Params } - return Params{} + return ConsumerParams{} } -func (m *GenesisState) GetProviderClientId() string { +func (m *ConsumerGenesisState) GetProviderClientId() string { if m != nil { return m.ProviderClientId } return "" } -func (m *GenesisState) GetProviderChannelId() string { +func (m *ConsumerGenesisState) GetProviderChannelId() string { if m != nil { return m.ProviderChannelId } return "" } -func (m *GenesisState) GetNewChain() bool { +func (m *ConsumerGenesisState) GetNewChain() bool { if m != nil { return m.NewChain } return false } -func (m *GenesisState) GetProviderClientState() *_07_tendermint.ClientState { +func (m *ConsumerGenesisState) GetProviderClientState() *_07_tendermint.ClientState { if m != nil { return m.ProviderClientState } return nil } -func (m *GenesisState) GetProviderConsensusState() *_07_tendermint.ConsensusState { +func (m *ConsumerGenesisState) GetProviderConsensusState() *_07_tendermint.ConsensusState { if m != nil { return m.ProviderConsensusState } return nil } -func (m *GenesisState) GetMaturingPackets() []MaturingVSCPacket { +func (m *ConsumerGenesisState) GetMaturingPackets() []MaturingVSCPacket { if m != nil { return m.MaturingPackets } return nil } -func (m *GenesisState) GetInitialValSet() []types.ValidatorUpdate { +func (m *ConsumerGenesisState) GetInitialValSet() []types.ValidatorUpdate { if m != nil { return m.InitialValSet } return nil } -func (m *GenesisState) GetHeightToValsetUpdateId() []HeightToValsetUpdateID { +func (m *ConsumerGenesisState) GetHeightToValsetUpdateId() []HeightToValsetUpdateID { if m != nil { return m.HeightToValsetUpdateId } return nil } -func (m *GenesisState) GetOutstandingDowntimeSlashing() []OutstandingDowntime { +func (m *ConsumerGenesisState) GetOutstandingDowntimeSlashing() []OutstandingDowntime { if m != nil { return m.OutstandingDowntimeSlashing } return nil } -func (m *GenesisState) GetPendingConsumerPackets() ConsumerPacketDataList { +func (m *ConsumerGenesisState) GetPendingConsumerPackets() ConsumerPacketDataList { if m != nil { return m.PendingConsumerPackets } return ConsumerPacketDataList{} } -func (m *GenesisState) GetLastTransmissionBlockHeight() LastTransmissionBlockHeight { +func (m *ConsumerGenesisState) GetLastTransmissionBlockHeight() LastTransmissionBlockHeight { if m != nil { return m.LastTransmissionBlockHeight } return LastTransmissionBlockHeight{} } -func (m *GenesisState) GetPreCCV() bool { +func (m *ConsumerGenesisState) GetPreCCV() bool { if m != nil { return m.PreCCV } @@ -616,8 +612,8 @@ func (m *ConsumerPacketDataList) GetList() []ConsumerPacketData { } func init() { - proto.RegisterType((*Params)(nil), "interchain_security.ccv.v1.Params") - proto.RegisterType((*GenesisState)(nil), "interchain_security.ccv.v1.GenesisState") + proto.RegisterType((*ConsumerParams)(nil), "interchain_security.ccv.v1.ConsumerParams") + proto.RegisterType((*ConsumerGenesisState)(nil), "interchain_security.ccv.v1.ConsumerGenesisState") proto.RegisterType((*HeightToValsetUpdateID)(nil), "interchain_security.ccv.v1.HeightToValsetUpdateID") proto.RegisterType((*OutstandingDowntime)(nil), "interchain_security.ccv.v1.OutstandingDowntime") proto.RegisterType((*LastTransmissionBlockHeight)(nil), "interchain_security.ccv.v1.LastTransmissionBlockHeight") @@ -630,85 +626,86 @@ func init() { } var fileDescriptor_d0a8be0efc64dfbc = []byte{ - // 1200 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4f, 0x73, 0x1b, 0x35, - 0x14, 0x8f, 0x9b, 0x34, 0xb5, 0x95, 0x84, 0xa6, 0x4a, 0x6b, 0xb6, 0xc9, 0xe0, 0xb8, 0x06, 0x66, - 0x3c, 0x03, 0xdd, 0x25, 0x69, 0x19, 0x66, 0x38, 0x30, 0x34, 0x36, 0xa5, 0x61, 0x4a, 0x93, 0x6e, - 0xd2, 0x1c, 0xca, 0x0c, 0x1a, 0x59, 0x52, 0x6c, 0x4d, 0xd7, 0x92, 0x47, 0xd2, 0x6e, 0xc8, 0x95, - 0x4f, 0xd0, 0x23, 0x1f, 0xa9, 0xc7, 0xde, 0xe0, 0x04, 0x4c, 0xfb, 0x45, 0x18, 0xfd, 0x59, 0xc7, - 0x6e, 0x12, 0xd3, 0xde, 0x56, 0x7a, 0xbf, 0xdf, 0xfb, 0xff, 0x9e, 0x16, 0x7c, 0xc5, 0x85, 0x61, - 0x8a, 0x0c, 0x30, 0x17, 0x48, 0x33, 0x92, 0x2b, 0x6e, 0x4e, 0x13, 0x42, 0x8a, 0xa4, 0xd8, 0x4a, - 0xf4, 0x00, 0x2b, 0x46, 0x11, 0x91, 0x42, 0xe7, 0x43, 0xa6, 0xe2, 0x91, 0x92, 0x46, 0xc2, 0xf5, - 0x0b, 0x18, 0x31, 0x21, 0x45, 0x5c, 0x6c, 0xad, 0x6f, 0x18, 0x26, 0x28, 0x53, 0x43, 0x2e, 0x4c, - 0x82, 0x7b, 0x84, 0x27, 0xe6, 0x74, 0xc4, 0xb4, 0x27, 0xae, 0x27, 0xbc, 0x47, 0x92, 0x8c, 0xf7, - 0x07, 0x86, 0x64, 0x9c, 0x09, 0xa3, 0x93, 0x09, 0x74, 0xb1, 0x35, 0x71, 0x0a, 0x84, 0x3b, 0x96, - 0x40, 0xa4, 0x62, 0x09, 0x19, 0x60, 0x21, 0x58, 0x66, 0x51, 0xe1, 0x33, 0x40, 0x1a, 0x7d, 0x29, - 0xfb, 0x19, 0x4b, 0xdc, 0xa9, 0x97, 0x1f, 0x27, 0x34, 0x57, 0xd8, 0x70, 0x29, 0x82, 0xfc, 0x66, - 0x5f, 0xf6, 0xa5, 0xfb, 0x4c, 0xec, 0x57, 0xb8, 0xfd, 0x7c, 0x46, 0xd0, 0x27, 0x5c, 0xb1, 0x00, - 0xdb, 0x7c, 0x57, 0xb9, 0xe1, 0x43, 0xa6, 0x0d, 0x1e, 0x8e, 0x3c, 0xa0, 0xf5, 0xe7, 0x22, 0x58, - 0xdc, 0xc7, 0x0a, 0x0f, 0x35, 0x8c, 0xc0, 0x35, 0x26, 0x70, 0x2f, 0x63, 0x34, 0xaa, 0x34, 0x2b, - 0xed, 0x6a, 0x5a, 0x1e, 0xe1, 0x1e, 0xf8, 0xac, 0x97, 0x49, 0xf2, 0x42, 0xa3, 0x11, 0x53, 0x88, - 0x72, 0x6d, 0x14, 0xef, 0xe5, 0xd6, 0x47, 0x64, 0x14, 0x16, 0x7a, 0xc8, 0xb5, 0xe6, 0x52, 0x44, - 0x57, 0x9a, 0x95, 0xf6, 0x7c, 0x7a, 0xc7, 0x63, 0xf7, 0x99, 0xea, 0x4e, 0x20, 0x0f, 0x27, 0x80, - 0xf0, 0x27, 0x70, 0xe7, 0x52, 0x2d, 0x28, 0xa4, 0x27, 0x9a, 0x6f, 0x56, 0xda, 0xb5, 0x74, 0x93, - 0x5e, 0xa2, 0xa4, 0xe3, 0x61, 0xf0, 0x5b, 0xb0, 0x3e, 0x52, 0xb2, 0xe0, 0x94, 0x29, 0x74, 0xcc, - 0x18, 0x1a, 0x49, 0x99, 0x21, 0x4c, 0xa9, 0x42, 0xda, 0xa8, 0x68, 0xc1, 0x29, 0xa9, 0x97, 0x88, - 0x87, 0x8c, 0xed, 0x4b, 0x99, 0x3d, 0xa0, 0x54, 0x1d, 0x18, 0x05, 0x9f, 0x02, 0x48, 0x48, 0x81, - 0x6c, 0x52, 0x64, 0x6e, 0x6c, 0x74, 0x5c, 0xd2, 0xe8, 0x6a, 0xb3, 0xd2, 0x5e, 0xda, 0xbe, 0x1d, - 0xfb, 0xdc, 0xc5, 0x65, 0xee, 0xe2, 0x6e, 0x28, 0xcc, 0x4e, 0xf5, 0xd5, 0xdf, 0x9b, 0x73, 0x7f, - 0xfc, 0xb3, 0x59, 0x49, 0x57, 0x09, 0x29, 0x0e, 0x3d, 0x7b, 0xdf, 0x91, 0xe1, 0x2f, 0xe0, 0x63, - 0x17, 0xcd, 0x31, 0x53, 0xef, 0xea, 0x5d, 0x7c, 0x7f, 0xbd, 0xb7, 0x4a, 0x1d, 0xd3, 0xca, 0x1f, - 0x81, 0x66, 0xd9, 0xca, 0x48, 0xb1, 0xa9, 0x14, 0x1e, 0x2b, 0x4c, 0xec, 0x47, 0x74, 0xcd, 0x45, - 0xdc, 0x28, 0x71, 0xe9, 0x14, 0xec, 0x61, 0x40, 0xc1, 0xbb, 0x00, 0x0e, 0xb8, 0x36, 0x52, 0x71, - 0x82, 0x33, 0xc4, 0x84, 0x51, 0x9c, 0xe9, 0xa8, 0xea, 0x0a, 0x78, 0xe3, 0x4c, 0xf2, 0x83, 0x17, - 0xc0, 0x27, 0x60, 0x35, 0x17, 0x3d, 0x29, 0x28, 0x17, 0xfd, 0x32, 0x9c, 0xda, 0xfb, 0x87, 0x73, - 0x7d, 0x4c, 0x0e, 0x81, 0xdc, 0x03, 0x75, 0x2d, 0x8f, 0x0d, 0x92, 0x23, 0x83, 0x6c, 0x86, 0xcc, - 0x40, 0x31, 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0x9c, 0xc1, 0x9b, 0xe0, 0x6a, 0xa1, 0xc9, 0x2e, 0x0d, 0x31, 0xfa, 0x03, 0xdc, 0x05, - 0x2b, 0x7e, 0xf2, 0xcc, 0xa9, 0x7b, 0x68, 0x5d, 0x7c, 0x4b, 0xdb, 0xeb, 0xe7, 0xb6, 0xf5, 0x61, - 0xf9, 0xcb, 0xe3, 0xd7, 0xf5, 0x4b, 0xbb, 0xae, 0x97, 0x4b, 0xaa, 0x15, 0xb6, 0x7a, 0xa0, 0x7e, - 0x71, 0xd3, 0xc0, 0x47, 0x60, 0x21, 0xe3, 0xda, 0x7a, 0x39, 0xef, 0x37, 0xd0, 0x87, 0xb4, 0x5d, - 0x28, 0xb9, 0xd3, 0xb0, 0xf3, 0xe4, 0xd5, 0x9b, 0x46, 0xe5, 0xf5, 0x9b, 0x46, 0xe5, 0xdf, 0x37, - 0x8d, 0xca, 0xcb, 0xb7, 0x8d, 0xb9, 0xd7, 0x6f, 0x1b, 0x73, 0x7f, 0xbd, 0x6d, 0xcc, 0x3d, 0xbf, - 0xdf, 0xe7, 0x66, 0x90, 0xf7, 0x62, 0x22, 0x87, 0x09, 0x91, 0x7a, 0x28, 0x75, 0x72, 0x66, 0xe6, - 0xee, 0xf8, 0xe7, 0xae, 0xb8, 0x97, 0xfc, 0xe6, 0xfe, 0xf0, 0xdc, 0x0f, 0x69, 0x6f, 0xd1, 0xc5, - 0x77, 0xef, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x25, 0x59, 0xfe, 0xb0, 0xfe, 0x0a, 0x00, 0x00, -} - -func (m *Params) Marshal() (dAtA []byte, err error) { + // 1203 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x56, 0x4d, 0x73, 0x13, 0x37, + 0x18, 0x8e, 0x49, 0x08, 0xb6, 0x92, 0x40, 0x50, 0x82, 0xbb, 0x24, 0x53, 0xc7, 0xb8, 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 0x4f, 0x69, 0xbb, 0x50, 0x72, 0xa7, 0x61, 0xeb, 0xc9, 0xab, 0x77, 0x8d, 0xca, 0xeb, 0x77, 0x8d, + 0xca, 0xbf, 0xef, 0x1a, 0x95, 0x97, 0xef, 0x1b, 0x33, 0xaf, 0xdf, 0x37, 0x66, 0xde, 0xbc, 0x6f, + 0xcc, 0x3c, 0x7f, 0xd0, 0xe7, 0x66, 0x90, 0xf7, 0x62, 0x22, 0x87, 0x09, 0x91, 0x7a, 0x28, 0x75, + 0x72, 0x6a, 0xe6, 0xee, 0xf8, 0xa7, 0xaf, 0xb8, 0x9f, 0xfc, 0xe9, 0xfe, 0xfc, 0xdc, 0x8f, 0x6a, + 0x6f, 0xde, 0xc5, 0x77, 0xff, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x49, 0x54, 0x31, 0x16, + 0x0b, 0x00, 0x00, +} + +func (m *ConsumerParams) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -718,12 +715,12 @@ func (m *Params) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *Params) MarshalTo(dAtA []byte) (int, error) { +func (m *ConsumerParams) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ConsumerParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -829,7 +826,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *GenesisState) Marshal() (dAtA []byte, err error) { +func (m *ConsumerGenesisState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -839,12 +836,12 @@ func (m *GenesisState) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { +func (m *ConsumerGenesisState) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *ConsumerGenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -1171,7 +1168,7 @@ func encodeVarintSharedConsumer(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *Params) Size() (n int) { +func (m *ConsumerParams) Size() (n int) { if m == nil { return 0 } @@ -1225,7 +1222,7 @@ func (m *Params) Size() (n int) { return n } -func (m *GenesisState) Size() (n int) { +func (m *ConsumerGenesisState) Size() (n int) { if m == nil { return 0 } @@ -1361,7 +1358,7 @@ func sovSharedConsumer(x uint64) (n int) { func sozSharedConsumer(x uint64) (n int) { return sovSharedConsumer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *Params) Unmarshal(dAtA []byte) error { +func (m *ConsumerParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1384,10 +1381,10 @@ func (m *Params) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: Params: wiretype end group for non-group") + return fmt.Errorf("proto: ConsumerParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsumerParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1793,7 +1790,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } -func (m *GenesisState) Unmarshal(dAtA []byte) error { +func (m *ConsumerGenesisState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1816,10 +1813,10 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + return fmt.Errorf("proto: ConsumerGenesisState: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: ConsumerGenesisState: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: From cb21ebde769d9e2cd796a1292ff75dcdf0b17fd3 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Wed, 20 Sep 2023 12:50:41 -0700 Subject: [PATCH 08/17] fix the rest o the shit --- tests/integration/slashing.go | 6 ++-- tests/integration/throttle.go | 54 +++++++++++++++++++++-------------- 2 files changed, 35 insertions(+), 25 deletions(-) diff --git a/tests/integration/slashing.go b/tests/integration/slashing.go index e80775f1c2..2feedf2fff 100644 --- a/tests/integration/slashing.go +++ b/tests/integration/slashing.go @@ -89,7 +89,7 @@ func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { valsetUpdateIdN := providerKeeper.GetValidatorSetUpdateId(s.providerCtx()) // receive the slash packet on the provider chain. RecvPacket() calls the provider endblocker twice - packet := s.newPacketFromConsumer(slashPacket.GetBytes(), sequence, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp) + packet := s.newPacketFromConsumer(slashPacket.GetData(), sequence, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp) err = s.path.EndpointB.RecvPacket(packet) s.Require().NoError(err) @@ -202,8 +202,8 @@ func (s *CCVTestSuite) TestRelayAndApplyDoubleSignPacket() { timeoutHeight = clienttypes.Height{} timeoutTimestamp = uint64(s.getFirstBundle().GetCtx().BlockTime().Add(ccv.DefaultCCVTimeoutPeriod).UnixNano()) ) - slashPacket := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmVal, stakingtypes.Infraction_INFRACTION_DOUBLE_SIGN) - packet := sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, slashPacket.GetBytes()) + slashPacket := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmVal, stakingtypes.Infraction_INFRACTION_DOUBLE_SIGN, 1) + packet := sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, slashPacket.GetData()) // Advance a few more blocks to make sure any voting power changes would be reflected s.providerChain.NextBlock() diff --git a/tests/integration/throttle.go b/tests/integration/throttle.go index a3c6e0f10e..19ac4c8462 100644 --- a/tests/integration/throttle.go +++ b/tests/integration/throttle.go @@ -13,6 +13,8 @@ import ( icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" "github.com/cosmos/interchain-security/v3/x/ccv/provider" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" + ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" + ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) const fullSlashMeterString = "1.0" @@ -66,8 +68,8 @@ func (s *CCVTestSuite) TestBasicSlashPacketThrottling() { // Send a slash packet from consumer to provider s.setDefaultValSigningInfo(*s.providerChain.Vals.Validators[0]) tmVal := s.providerChain.Vals.Validators[0] - slashPacket := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmVal, stakingtypes.Infraction_INFRACTION_DOWNTIME) - sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, slashPacket.GetBytes()) + slashPacket := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmVal, stakingtypes.Infraction_INFRACTION_DOWNTIME, 1) + sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, slashPacket.GetData()) // Assert validator 0 is jailed and has no power vals = providerStakingKeeper.GetAllValidators(s.providerCtx()) @@ -85,8 +87,8 @@ func (s *CCVTestSuite) TestBasicSlashPacketThrottling() { // Now send a second slash packet from consumer to provider for a different validator. s.setDefaultValSigningInfo(*s.providerChain.Vals.Validators[2]) tmVal = s.providerChain.Vals.Validators[2] - slashPacket = s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmVal, stakingtypes.Infraction_INFRACTION_DOWNTIME) - sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, slashPacket.GetBytes()) + slashPacket = s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmVal, stakingtypes.Infraction_INFRACTION_DOWNTIME, 2) + sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, slashPacket.GetData()) // Require that slash packet has not been handled, a bounce result would have // been returned, but the IBC helper throws out acks. @@ -141,9 +143,9 @@ func (s *CCVTestSuite) TestBasicSlashPacketThrottling() { // Assert validator 2 is jailed once slash packet is retried. tmVal2 := s.providerChain.Vals.Validators[2] - packet = s.constructSlashPacketFromConsumer(s.getFirstBundle(), + packet := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmVal2, stakingtypes.Infraction_INFRACTION_DOWNTIME, 3) // make sure to use a new seq num - sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, packet) + sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, packet.GetData()) stakingVal2 := s.mustGetStakingValFromTmVal(*tmVal2) s.Require().True(stakingVal2.IsJailed()) @@ -163,6 +165,11 @@ func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { s.SetupAllCCVChannels() s.setupValidatorPowers() + var ( + timeoutHeight = clienttypes.Height{} + timeoutTimestamp = uint64(s.getFirstBundle().GetCtx().BlockTime().Add(ccv.DefaultCCVTimeoutPeriod).UnixNano()) + ) + providerStakingKeeper := s.providerApp.GetTestStakingKeeper() // Choose 3 consumer bundles. It doesn't matter which ones. @@ -194,7 +201,7 @@ func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { stakingtypes.Infraction_INFRACTION_DOWNTIME, 1, // all consumers use 1 seq num ) - sendOnConsumerRecvOnProvider(s, bundle.Path, timeoutHeight, timeoutTimestamp, slashPacket.GetBytes()) + sendOnConsumerRecvOnProvider(s, bundle.Path, timeoutHeight, timeoutTimestamp, slashPacket.GetData()) idx++ } @@ -222,7 +229,7 @@ func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { stakingtypes.Infraction_INFRACTION_DOWNTIME, 2, // seq number is incremented since last try ) - sendOnConsumerRecvOnProvider(s, bundle.Path, packet) + sendOnConsumerRecvOnProvider(s, bundle.Path, timeoutHeight, timeoutTimestamp, packet.GetData()) // retry from consumer with idx 2 bundle = senderBundles[2] @@ -232,7 +239,7 @@ func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { stakingtypes.Infraction_INFRACTION_DOWNTIME, 2, // seq number is incremented since last try ) - sendOnConsumerRecvOnProvider(s, bundle.Path, packet) + sendOnConsumerRecvOnProvider(s, bundle.Path, timeoutHeight, timeoutTimestamp, packet.GetData()) // Call NextBlocks to update staking module val powers s.providerChain.NextBlock() @@ -253,7 +260,7 @@ func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { stakingtypes.Infraction_INFRACTION_DOWNTIME, 3, // seq number is incremented since last try ) - sendOnConsumerRecvOnProvider(s, bundle.Path, packet) + sendOnConsumerRecvOnProvider(s, bundle.Path, timeoutHeight, timeoutTimestamp, packet.GetData()) // Call NextBlocks to update staking module val powers s.providerChain.NextBlock() @@ -311,8 +318,8 @@ func (s *CCVTestSuite) TestPacketSpam() { infractionType = stakingtypes.Infraction_INFRACTION_DOUBLE_SIGN } valToJail := s.providerChain.Vals.Validators[ibcSeqNum%3] - slashPacket := s.constructSlashPacketFromConsumer(firstBundle, *valToJail, infractionType) - packetsData = append(packetsData, slashPacket.GetBytes()) + slashPacket := s.constructSlashPacketFromConsumer(firstBundle, *valToJail, infractionType, ibcSeqNum) + packetsData = append(packetsData, slashPacket.GetData()) } // Recv 500 packets from consumer to provider in same block @@ -368,8 +375,8 @@ func (s *CCVTestSuite) TestDoubleSignDoesNotAffectThrottling() { // Increment ibc seq num for each packet (starting at 1) ibcSeqNum++ valToJail := s.providerChain.Vals.Validators[ibcSeqNum%3] - slashPacket := s.constructSlashPacketFromConsumer(firstBundle, *valToJail, stakingtypes.Infraction_INFRACTION_DOUBLE_SIGN) - packetsData = append(packetsData, slashPacket.GetBytes()) + slashPacket := s.constructSlashPacketFromConsumer(firstBundle, *valToJail, stakingtypes.Infraction_INFRACTION_DOUBLE_SIGN, ibcSeqNum) + packetsData = append(packetsData, slashPacket.GetData()) } // Recv 500 packets from consumer to provider in same block @@ -452,12 +459,12 @@ func (s *CCVTestSuite) TestSlashingSmallValidators() { tmval1 := s.providerChain.Vals.Validators[1] tmval2 := s.providerChain.Vals.Validators[2] tmval3 := s.providerChain.Vals.Validators[3] - slashPacket1 := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval1, stakingtypes.Infraction_INFRACTION_DOWNTIME) - slashPacket2 := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval2, stakingtypes.Infraction_INFRACTION_DOWNTIME) - slashPacket3 := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval3, stakingtypes.Infraction_INFRACTION_DOWNTIME) - sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, slashPacket1.GetBytes()) - sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, slashPacket2.GetBytes()) - sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, slashPacket3.GetBytes()) + slashPacket1 := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval1, stakingtypes.Infraction_INFRACTION_DOWNTIME, 1) + slashPacket2 := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval2, stakingtypes.Infraction_INFRACTION_DOWNTIME, 2) + slashPacket3 := s.constructSlashPacketFromConsumer(s.getFirstBundle(), *tmval3, stakingtypes.Infraction_INFRACTION_DOWNTIME, 3) + sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, slashPacket1.GetData()) + sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, slashPacket2.GetData()) + sendOnConsumerRecvOnProvider(s, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp, slashPacket3.GetData()) // Default slash meter replenish fraction is 0.05, so all sent packets should be handled immediately. vals = providerStakingKeeper.GetAllValidators(s.providerCtx()) @@ -524,17 +531,20 @@ func (s CCVTestSuite) TestSlashAllValidators() { //nolint:govet // this is a tes // Instantiate a slash packet for each validator, // these first 4 packets should jail 100% of the total power. + ibcSeqNum := uint64(1) for _, val := range s.providerChain.Vals.Validators { s.setDefaultValSigningInfo(*val) packetsData = append(packetsData, s.constructSlashPacketFromConsumer( - s.getFirstBundle(), *val, stakingtypes.Infraction_INFRACTION_DOWNTIME).GetBytes()) + s.getFirstBundle(), *val, stakingtypes.Infraction_INFRACTION_DOWNTIME, ibcSeqNum).GetData()) + ibcSeqNum++ } // add 5 more slash packets for each validator, that will be handled in the same block. for _, val := range s.providerChain.Vals.Validators { for i := 0; i < 5; i++ { packetsData = append(packetsData, s.constructSlashPacketFromConsumer( - s.getFirstBundle(), *val, stakingtypes.Infraction_INFRACTION_DOWNTIME).GetBytes()) + s.getFirstBundle(), *val, stakingtypes.Infraction_INFRACTION_DOWNTIME, ibcSeqNum).GetData()) + ibcSeqNum++ } } From a3a3ccd4de1a7ee0c9d4ef8c1ce055ef19cf2b11 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Wed, 20 Sep 2023 13:02:37 -0700 Subject: [PATCH 09/17] lint --- tests/integration/throttle.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/integration/throttle.go b/tests/integration/throttle.go index 19ac4c8462..71ee3f606b 100644 --- a/tests/integration/throttle.go +++ b/tests/integration/throttle.go @@ -13,7 +13,6 @@ import ( icstestingutils "github.com/cosmos/interchain-security/v3/testutil/ibc_testing" "github.com/cosmos/interchain-security/v3/x/ccv/provider" providertypes "github.com/cosmos/interchain-security/v3/x/ccv/provider/types" - ccv "github.com/cosmos/interchain-security/v3/x/ccv/types" ccvtypes "github.com/cosmos/interchain-security/v3/x/ccv/types" ) @@ -167,7 +166,7 @@ func (s *CCVTestSuite) TestMultiConsumerSlashPacketThrottling() { var ( timeoutHeight = clienttypes.Height{} - timeoutTimestamp = uint64(s.getFirstBundle().GetCtx().BlockTime().Add(ccv.DefaultCCVTimeoutPeriod).UnixNano()) + timeoutTimestamp = uint64(s.getFirstBundle().GetCtx().BlockTime().Add(ccvtypes.DefaultCCVTimeoutPeriod).UnixNano()) ) providerStakingKeeper := s.providerApp.GetTestStakingKeeper() From ca39b1d827c9078a41fa12ff722e4060927f302d Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Fri, 22 Sep 2023 09:21:08 -0700 Subject: [PATCH 10/17] Addressing simon's comments --- tests/e2e/actions.go | 1 - tests/integration/common.go | 12 ++---------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index 9ebc50221d..20550255a7 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -2083,7 +2083,6 @@ func (tr TestRun) waitForSlashMeterReplenishment( } type waitTimeAction struct { - Consumer ChainID WaitTime time.Duration } diff --git a/tests/integration/common.go b/tests/integration/common.go index 9ffd8e047f..413cdaa810 100644 --- a/tests/integration/common.go +++ b/tests/integration/common.go @@ -1,7 +1,6 @@ package integration import ( - "bytes" "fmt" "time" @@ -617,14 +616,7 @@ func (s *CCVTestSuite) setupValidatorPowers() { // mustGetStakingValFromTmVal returns the staking validator from the current state of the staking keeper, // corresponding to a given tendermint validator. Note this func will fail the test if the validator is not found. func (s *CCVTestSuite) mustGetStakingValFromTmVal(tmVal tmtypes.Validator) (stakingVal stakingtypes.Validator) { - vals := s.providerApp.GetTestStakingKeeper().GetAllValidators(s.providerCtx()) - for i, val := range vals { - consAddr, err := val.GetConsAddr() - s.Require().NoError(err) - if bytes.Equal(consAddr.Bytes(), tmVal.Address.Bytes()) { - stakingVal = vals[i] - } - } - s.Require().NotZero(stakingVal) + stakingVal, found := s.providerApp.GetTestStakingKeeper().GetValidatorByConsAddr(s.providerCtx(), sdk.ConsAddress(tmVal.Address)) + s.Require().True(found) return stakingVal } From f0ffb471bed6bb36afd83d1014416fc175c94eb5 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:39:31 -0700 Subject: [PATCH 11/17] whoopies --- tests/e2e/steps_downtime.go | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/e2e/steps_downtime.go b/tests/e2e/steps_downtime.go index 01f277eea8..f8a610052d 100644 --- a/tests/e2e/steps_downtime.go +++ b/tests/e2e/steps_downtime.go @@ -409,7 +409,6 @@ func stepsThrottledDowntime(consumerName string) []Step { // wait this amount of time to elapse the period. { Action: waitTimeAction{ - Consumer: ChainID(consumerName), WaitTime: 30 * time.Second, }, State: State{ From 3cb1f47d536b13c4e4384c4972445d241056cd2c Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:41:25 -0700 Subject: [PATCH 12/17] height assertion --- tests/integration/slashing.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/integration/slashing.go b/tests/integration/slashing.go index 2feedf2fff..4058494974 100644 --- a/tests/integration/slashing.go +++ b/tests/integration/slashing.go @@ -90,8 +90,11 @@ func (s *CCVTestSuite) TestRelayAndApplyDowntimePacket() { // receive the slash packet on the provider chain. RecvPacket() calls the provider endblocker twice packet := s.newPacketFromConsumer(slashPacket.GetData(), sequence, s.getFirstBundle().Path, timeoutHeight, timeoutTimestamp) + heightBefore := s.providerCtx().BlockHeight() err = s.path.EndpointB.RecvPacket(packet) + heightAfter := s.providerCtx().BlockHeight() s.Require().NoError(err) + s.Require().Equal(heightBefore+2, heightAfter) // We've now advanced two blocks. From a1e1b63b638b0567ffd3ebb08009117450cd2f8d Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Tue, 26 Sep 2023 12:43:52 -0700 Subject: [PATCH 13/17] Update x/ccv/provider/keeper/migration.go Co-authored-by: Simon Noetzlin --- x/ccv/provider/keeper/migration.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/ccv/provider/keeper/migration.go b/x/ccv/provider/keeper/migration.go index 3f04a49ef6..5d739c8bef 100644 --- a/x/ccv/provider/keeper/migration.go +++ b/x/ccv/provider/keeper/migration.go @@ -30,7 +30,7 @@ func (k Keeper) MigrateQueuedPackets(ctx sdktypes.Context) error { for _, consumer := range k.GetAllConsumerChains(ctx) { slashData, vscmData := k.GetAllThrottledPacketData(ctx, consumer.ChainId) if len(slashData) > 0 { - ctx.Logger().Error(fmt.Sprintf("slash data being dropped: %v", slashData)) + k.Logger(ctx).Error(fmt.Sprintf("slash data being dropped: %v", slashData)) } for _, data := range vscmData { k.HandleVSCMaturedPacket(ctx, consumer.ChainId, data) From 0d0709c6c9061f0c1ed81495cc321a1ff8a28cf8 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Tue, 26 Sep 2023 14:07:10 -0700 Subject: [PATCH 14/17] action boilerplate --- tests/e2e/action_rapid_test.go | 23 +++++++++++++++-------- tests/e2e/json_utils.go | 10 ++++++++-- tests/e2e/state_rapid_test.go | 12 +++++------- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/tests/e2e/action_rapid_test.go b/tests/e2e/action_rapid_test.go index 005f52610d..09d28abacf 100644 --- a/tests/e2e/action_rapid_test.go +++ b/tests/e2e/action_rapid_test.go @@ -84,8 +84,9 @@ func GetActionGen() *rapid.Generator[any] { GetRegisterRepresentativeActionGen().AsAny(), GetDoublesignSlashActionGen().AsAny(), GetAssignConsumerPubKeyActionGen().AsAny(), - GetSlashThrottleDequeueActionGen().AsAny(), GetCreateIbcClientsActionGen().AsAny(), + GetSlashMeterReplenishmentAction().AsAny(), + GetWaitTimeAction().AsAny(), CreateCancelUnbondTokensActionGen().AsAny(), CreateLightClientEquivocationAttackActionGen().AsAny(), CreateLightClientAmnesiaAttackActionGen().AsAny(), @@ -489,13 +490,19 @@ func GetAssignConsumerPubKeyActionGen() *rapid.Generator[assignConsumerPubKeyAct }) } -func GetSlashThrottleDequeueActionGen() *rapid.Generator[slashThrottleDequeueAction] { - return rapid.Custom(func(t *rapid.T) slashThrottleDequeueAction { - return slashThrottleDequeueAction{ - Chain: GetChainIDGen().Draw(t, "Chain"), - CurrentQueueSize: rapid.Int().Draw(t, "CurrentQueueSize"), - NextQueueSize: rapid.Int().Draw(t, "NextQueueSize"), - Timeout: time.Duration(rapid.Int().Draw(t, "Timeout")) * time.Millisecond, +func GetSlashMeterReplenishmentAction() *rapid.Generator[slashMeterReplenishmentAction] { + return rapid.Custom(func(t *rapid.T) slashMeterReplenishmentAction { + return slashMeterReplenishmentAction{ + TargetValue: rapid.Int64().Draw(t, "TargetValue"), + Timeout: time.Duration(rapid.Int().Draw(t, "Timeout")) * time.Millisecond, + } + }) +} + +func GetWaitTimeAction() *rapid.Generator[waitTimeAction] { + return rapid.Custom(func(t *rapid.T) waitTimeAction { + return waitTimeAction{ + WaitTime: time.Duration(rapid.Int().Draw(t, "Timeout")) * time.Millisecond, } }) } diff --git a/tests/e2e/json_utils.go b/tests/e2e/json_utils.go index 692c34a14f..3d5867d42a 100644 --- a/tests/e2e/json_utils.go +++ b/tests/e2e/json_utils.go @@ -221,8 +221,14 @@ func UnmarshalMapToActionType(rawAction json.RawMessage, actionTypeString string if err == nil { return a, nil } - case "main.slashThrottleDequeueAction": - var a slashThrottleDequeueAction + case "main.slashMeterReplenishmentAction": + var a slashMeterReplenishmentAction + err := json.Unmarshal(rawAction, &a) + if err == nil { + return a, nil + } + case "main.waitTimeAction": + var a waitTimeAction err := json.Unmarshal(rawAction, &a) if err == nil { return a, nil diff --git a/tests/e2e/state_rapid_test.go b/tests/e2e/state_rapid_test.go index 6c82c2e7fb..fd7fe20459 100644 --- a/tests/e2e/state_rapid_test.go +++ b/tests/e2e/state_rapid_test.go @@ -45,8 +45,7 @@ func GetChainStateGen() *rapid.Generator[ChainState] { consumerChains := GetConsumerChainsGen().Draw(t, "ConsumerChains") assignedKeys := GetAssignedKeysGen().Draw(t, "AssignedKeys") providerKeys := GetProviderKeysGen().Draw(t, "ProviderKeys") - consumerChainQueueSizes := GetConsumerChainQueueSizesGen().Draw(t, "ConsumerChainQueueSizes") - globalSlashQueueSize := rapid.Uint().Draw(t, "GlobalSlashQueueSize") + consumerPacketQueueSize := GetConsumerChainQueueSizesGen().Draw(t, "ConsumerChainQueueSizes") registeredConsumerRewardDenoms := GetRegisteredConsumerRewardDenomsGen().Draw(t, "RegisteredConsumerRewardDenoms") return ChainState{ @@ -59,8 +58,7 @@ func GetChainStateGen() *rapid.Generator[ChainState] { ConsumerChains: &consumerChains, AssignedKeys: &assignedKeys, ProviderKeys: &providerKeys, - ConsumerChainQueueSizes: &consumerChainQueueSizes, - GlobalSlashQueueSize: &globalSlashQueueSize, + ConsumerPendingPacketQueueSize: &consumerPacketQueueSize, RegisteredConsumerRewardDenoms: ®isteredConsumerRewardDenoms, } }) @@ -72,9 +70,9 @@ func GetRegisteredConsumerRewardDenomsGen() *rapid.Generator[[]string] { }) } -func GetConsumerChainQueueSizesGen() *rapid.Generator[map[ChainID]uint] { - return rapid.Custom(func(t *rapid.T) map[ChainID]uint { - return rapid.MapOf(GetChainIDGen(), rapid.Uint()).Draw(t, "ConsumerChainQueueSizes") +func GetConsumerChainQueueSizesGen() *rapid.Generator[uint] { + return rapid.Custom(func(t *rapid.T) uint { + return rapid.Uint().Draw(t, "ConsumerChainQueueSizes") }) } From 42c8f0e8af729b89a50bbaf7e78fe18d487840af Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Wed, 27 Sep 2023 10:14:48 -0700 Subject: [PATCH 15/17] feat: remove max throttled packets param (#1332) * rm param * Update proto/interchain_security/ccv/provider/v1/provider.proto Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> --------- Co-authored-by: Philip Offtermatt <57488781+p-offtermatt@users.noreply.github.com> --- .../ccv/provider/v1/provider.proto | 8 +- x/ccv/provider/keeper/params.go | 9 - x/ccv/provider/keeper/params_test.go | 1 - x/ccv/provider/keeper/proposal_test.go | 1 - x/ccv/provider/types/genesis_test.go | 53 +--- x/ccv/provider/types/params.go | 12 - x/ccv/provider/types/params_test.go | 27 +- x/ccv/provider/types/provider.pb.go | 254 ++++++++---------- 8 files changed, 137 insertions(+), 228 deletions(-) diff --git a/proto/interchain_security/ccv/provider/v1/provider.proto b/proto/interchain_security/ccv/provider/v1/provider.proto index b0de16097b..922f6b1cbe 100644 --- a/proto/interchain_security/ccv/provider/v1/provider.proto +++ b/proto/interchain_security/ccv/provider/v1/provider.proto @@ -152,6 +152,10 @@ message GlobalSlashEntry { // Params defines the parameters for CCV Provider module message Params { + + // Reserve 8th slot for removed max throttled packet param + reserved 8; + ibc.lightclients.tendermint.v1.ClientState template_client = 1; // TrustingPeriodFraction is used to compute the consumer and provider IBC // client's TrustingPeriod from the chain defined UnbondingPeriod @@ -179,10 +183,6 @@ message Params { // total voting power that the slash meter can hold. string slash_meter_replenish_fraction = 7; - // The maximum amount of throttled slash or vsc matured packets - // that can be queued for a single consumer before the provider chain halts. - int64 max_throttled_packets = 8; - // The fee required to be paid to add a reward denom cosmos.base.v1beta1.Coin consumer_reward_denom_registration_fee = 9 [ (gogoproto.nullable) = false ]; diff --git a/x/ccv/provider/keeper/params.go b/x/ccv/provider/keeper/params.go index b7b53b245b..2dbe8ca40d 100644 --- a/x/ccv/provider/keeper/params.go +++ b/x/ccv/provider/keeper/params.go @@ -69,14 +69,6 @@ func (k Keeper) GetSlashMeterReplenishFraction(ctx sdk.Context) string { return f } -// GetMaxThrottledPackets returns the maximum amount of throttled slash or vsc matured packets -// that can be queued for a single consumer before the provider chain halts. -func (k Keeper) GetMaxThrottledPackets(ctx sdk.Context) int64 { - var p int64 - k.paramSpace.Get(ctx, types.KeyMaxThrottledPackets, &p) - return p -} - func (k Keeper) GetConsumerRewardDenomRegistrationFee(ctx sdk.Context) sdk.Coin { // Due to difficulties doing migrations in coordinated upgrades, this param is hardcoded to 10 ATOM in v1.1.0-multiden. // The below code is the proper way to store the param. A future scheduled upgrade will @@ -96,7 +88,6 @@ func (k Keeper) GetParams(ctx sdk.Context) types.Params { k.GetVscTimeoutPeriod(ctx), k.GetSlashMeterReplenishPeriod(ctx), k.GetSlashMeterReplenishFraction(ctx), - k.GetMaxThrottledPackets(ctx), k.GetConsumerRewardDenomRegistrationFee(ctx), ) } diff --git a/x/ccv/provider/keeper/params_test.go b/x/ccv/provider/keeper/params_test.go index 05b3964bb7..c057079e59 100644 --- a/x/ccv/provider/keeper/params_test.go +++ b/x/ccv/provider/keeper/params_test.go @@ -44,7 +44,6 @@ func TestParams(t *testing.T) { 10*time.Minute, time.Hour, "0.4", - 100, sdk.Coin{ Denom: "stake", Amount: sdk.NewInt(10000000), diff --git a/x/ccv/provider/keeper/proposal_test.go b/x/ccv/provider/keeper/proposal_test.go index 82bd3ed24e..e9468d860f 100644 --- a/x/ccv/provider/keeper/proposal_test.go +++ b/x/ccv/provider/keeper/proposal_test.go @@ -770,7 +770,6 @@ func TestMakeConsumerGenesis(t *testing.T) { VscTimeoutPeriod: providertypes.DefaultVscTimeoutPeriod, SlashMeterReplenishPeriod: providertypes.DefaultSlashMeterReplenishPeriod, SlashMeterReplenishFraction: providertypes.DefaultSlashMeterReplenishFraction, - MaxThrottledPackets: providertypes.DefaultMaxThrottledPackets, ConsumerRewardDenomRegistrationFee: sdk.Coin{ Denom: "stake", Amount: sdk.NewInt(1000000), diff --git a/x/ccv/provider/types/genesis_test.go b/x/ccv/provider/types/genesis_test.go index 7878afb0a4..d77ea563f8 100644 --- a/x/ccv/provider/types/genesis_test.go +++ b/x/ccv/provider/types/genesis_test.go @@ -81,7 +81,7 @@ func TestValidateGenesisState(t *testing.T) { nil, types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - types.DefaultTrustingPeriodFraction, time.Hour, time.Hour, 30*time.Minute, time.Hour, "0.1", 400, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), + types.DefaultTrustingPeriodFraction, time.Hour, time.Hour, 30*time.Minute, time.Hour, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), nil, nil, nil, @@ -102,7 +102,7 @@ func TestValidateGenesisState(t *testing.T) { nil, types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - types.DefaultTrustingPeriodFraction, time.Hour, time.Hour, 30*time.Minute, time.Hour, "0.1", 400, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), + types.DefaultTrustingPeriodFraction, time.Hour, time.Hour, 30*time.Minute, time.Hour, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), nil, nil, nil, @@ -123,7 +123,7 @@ func TestValidateGenesisState(t *testing.T) { nil, types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - types.DefaultTrustingPeriodFraction, time.Hour, time.Hour, 30*time.Minute, time.Hour, "0.1", 400, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), + types.DefaultTrustingPeriodFraction, time.Hour, time.Hour, 30*time.Minute, time.Hour, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), nil, nil, nil, @@ -144,7 +144,7 @@ func TestValidateGenesisState(t *testing.T) { nil, types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - types.DefaultTrustingPeriodFraction, time.Hour, time.Hour, 30*time.Minute, time.Hour, "0.1", 400, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), + types.DefaultTrustingPeriodFraction, time.Hour, time.Hour, 30*time.Minute, time.Hour, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), nil, nil, nil, @@ -171,7 +171,7 @@ func TestValidateGenesisState(t *testing.T) { types.DefaultVscTimeoutPeriod, types.DefaultSlashMeterReplenishPeriod, types.DefaultSlashMeterReplenishFraction, - types.DefaultMaxThrottledPackets, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), + sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), nil, nil, nil, @@ -198,7 +198,7 @@ func TestValidateGenesisState(t *testing.T) { types.DefaultVscTimeoutPeriod, types.DefaultSlashMeterReplenishPeriod, types.DefaultSlashMeterReplenishFraction, - types.DefaultMaxThrottledPackets, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), + sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), nil, nil, nil, @@ -225,7 +225,7 @@ func TestValidateGenesisState(t *testing.T) { types.DefaultVscTimeoutPeriod, types.DefaultSlashMeterReplenishPeriod, types.DefaultSlashMeterReplenishFraction, - types.DefaultMaxThrottledPackets, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(1000000)}), + sdk.Coin{Denom: "stake", Amount: sdk.NewInt(1000000)}), nil, nil, nil, @@ -252,7 +252,7 @@ func TestValidateGenesisState(t *testing.T) { types.DefaultVscTimeoutPeriod, types.DefaultSlashMeterReplenishPeriod, types.DefaultSlashMeterReplenishFraction, - types.DefaultMaxThrottledPackets, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), + sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), nil, nil, nil, @@ -279,7 +279,7 @@ func TestValidateGenesisState(t *testing.T) { 0, // 0 vsc timeout here types.DefaultSlashMeterReplenishPeriod, types.DefaultSlashMeterReplenishFraction, - types.DefaultMaxThrottledPackets, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), + sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), nil, nil, nil, @@ -306,7 +306,7 @@ func TestValidateGenesisState(t *testing.T) { types.DefaultVscTimeoutPeriod, 0, // 0 slash meter replenish period here types.DefaultSlashMeterReplenishFraction, - types.DefaultMaxThrottledPackets, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), + sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), nil, nil, nil, @@ -333,34 +333,7 @@ func TestValidateGenesisState(t *testing.T) { types.DefaultVscTimeoutPeriod, types.DefaultSlashMeterReplenishPeriod, "1.15", - types.DefaultMaxThrottledPackets, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), - nil, - nil, - nil, - nil, - nil, - ), - false, - }, - { - "invalid params, invalid max pending slash packets", - types.NewGenesisState( - types.DefaultValsetUpdateID, - nil, - []types.ConsumerState{{ChainId: "chainid-1", ChannelId: "channelid", ClientId: "client-id"}}, - nil, - nil, - nil, - nil, - types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, - time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - types.DefaultTrustingPeriodFraction, - ccv.DefaultCCVTimeoutPeriod, - types.DefaultInitTimeoutPeriod, - types.DefaultVscTimeoutPeriod, - types.DefaultSlashMeterReplenishPeriod, - "1.15", - -1, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), + sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), nil, nil, nil, @@ -712,7 +685,7 @@ func TestValidateGenesisState(t *testing.T) { nil, types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - types.DefaultTrustingPeriodFraction, time.Hour, time.Hour, 30*time.Minute, time.Hour, "0.1", 400, sdk.Coin{Denom: "st", Amount: sdk.NewInt(10000000)}), + types.DefaultTrustingPeriodFraction, time.Hour, time.Hour, 30*time.Minute, time.Hour, "0.1", sdk.Coin{Denom: "st", Amount: sdk.NewInt(10000000)}), nil, nil, nil, @@ -733,7 +706,7 @@ func TestValidateGenesisState(t *testing.T) { nil, types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - types.DefaultTrustingPeriodFraction, time.Hour, time.Hour, 30*time.Minute, time.Hour, "0.1", 400, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(-1000000)}), + types.DefaultTrustingPeriodFraction, time.Hour, time.Hour, 30*time.Minute, time.Hour, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(-1000000)}), nil, nil, nil, diff --git a/x/ccv/provider/types/params.go b/x/ccv/provider/types/params.go index afb46694a3..fb6b0c267e 100644 --- a/x/ccv/provider/types/params.go +++ b/x/ccv/provider/types/params.go @@ -36,10 +36,6 @@ const ( // that is replenished to the slash meter every replenish period. This param also serves as a maximum // fraction of total voting power that the slash meter can hold. DefaultSlashMeterReplenishFraction = "0.05" - - // DefaultMaxThrottledPackets defines the default amount of throttled slash or vsc matured packets - // that can be queued for a single consumer before the provider chain halts. - DefaultMaxThrottledPackets = 100000 ) // Reflection based keys for params subspace @@ -50,7 +46,6 @@ var ( KeyVscTimeoutPeriod = []byte("VscTimeoutPeriod") KeySlashMeterReplenishPeriod = []byte("SlashMeterReplenishPeriod") KeySlashMeterReplenishFraction = []byte("SlashMeterReplenishFraction") - KeyMaxThrottledPackets = []byte("MaxThrottledPackets") KeyConsumerRewardDenomRegistrationFee = []byte("ConsumerRewardDenomRegistrationFee") ) @@ -68,7 +63,6 @@ func NewParams( vscTimeoutPeriod time.Duration, slashMeterReplenishPeriod time.Duration, slashMeterReplenishFraction string, - maxThrottledPackets int64, consumerRewardDenomRegistrationFee sdk.Coin, ) Params { return Params{ @@ -79,7 +73,6 @@ func NewParams( VscTimeoutPeriod: vscTimeoutPeriod, SlashMeterReplenishPeriod: slashMeterReplenishPeriod, SlashMeterReplenishFraction: slashMeterReplenishFraction, - MaxThrottledPackets: maxThrottledPackets, ConsumerRewardDenomRegistrationFee: consumerRewardDenomRegistrationFee, } } @@ -105,7 +98,6 @@ func DefaultParams() Params { DefaultVscTimeoutPeriod, DefaultSlashMeterReplenishPeriod, DefaultSlashMeterReplenishFraction, - DefaultMaxThrottledPackets, // Defining this inline because it's not possible to define a constant of type sdk.Coin. // Following the pattern from cosmos-sdk/staking/types/params.go sdk.Coin{ @@ -141,9 +133,6 @@ func (p Params) Validate() error { if err := ccvtypes.ValidateStringFraction(p.SlashMeterReplenishFraction); err != nil { return fmt.Errorf("slash meter replenish fraction is invalid: %s", err) } - if err := ccvtypes.ValidatePositiveInt64(p.MaxThrottledPackets); err != nil { - return fmt.Errorf("max throttled packets is invalid: %s", err) - } if err := ValidateCoin(p.ConsumerRewardDenomRegistrationFee); err != nil { return fmt.Errorf("consumer reward denom registration fee is invalid: %s", err) } @@ -160,7 +149,6 @@ func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { paramtypes.NewParamSetPair(KeyVscTimeoutPeriod, p.VscTimeoutPeriod, ccvtypes.ValidateDuration), paramtypes.NewParamSetPair(KeySlashMeterReplenishPeriod, p.SlashMeterReplenishPeriod, ccvtypes.ValidateDuration), paramtypes.NewParamSetPair(KeySlashMeterReplenishFraction, p.SlashMeterReplenishFraction, ccvtypes.ValidateStringFraction), - paramtypes.NewParamSetPair(KeyMaxThrottledPackets, p.MaxThrottledPackets, ccvtypes.ValidatePositiveInt64), paramtypes.NewParamSetPair(KeyConsumerRewardDenomRegistrationFee, p.ConsumerRewardDenomRegistrationFee, ValidateCoin), } } diff --git a/x/ccv/provider/types/params_test.go b/x/ccv/provider/types/params_test.go index 0676a15986..6e8bd780bf 100644 --- a/x/ccv/provider/types/params_test.go +++ b/x/ccv/provider/types/params_test.go @@ -24,42 +24,39 @@ func TestValidateParams(t *testing.T) { {"custom valid params", types.NewParams( ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - "0.33", time.Hour, time.Hour, time.Hour, 30*time.Minute, "0.1", 100, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), true}, + "0.33", time.Hour, time.Hour, time.Hour, 30*time.Minute, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), true}, {"custom invalid params", types.NewParams( ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, 0, clienttypes.Height{}, nil, []string{"ibc", "upgradedIBCState"}), - "0.33", time.Hour, time.Hour, time.Hour, 30*time.Minute, "0.1", 100, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, + "0.33", time.Hour, time.Hour, time.Hour, 30*time.Minute, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, {"blank client", types.NewParams(&ibctmtypes.ClientState{}, - "0.33", time.Hour, time.Hour, time.Hour, 30*time.Minute, "0.1", 100, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, - {"nil client", types.NewParams(nil, "0.33", time.Hour, time.Hour, time.Hour, 30*time.Minute, "0.1", 100, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, + "0.33", time.Hour, time.Hour, time.Hour, 30*time.Minute, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, + {"nil client", types.NewParams(nil, "0.33", time.Hour, time.Hour, time.Hour, 30*time.Minute, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, // Check if "0.00" is valid or if a zero dec TrustFraction needs to return an error {"0 trusting period fraction", types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - "0.00", time.Hour, time.Hour, time.Hour, 30*time.Minute, "0.1", 100, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), true}, + "0.00", time.Hour, time.Hour, time.Hour, 30*time.Minute, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), true}, {"0 ccv timeout period", types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - "0.33", 0, time.Hour, time.Hour, 30*time.Minute, "0.1", 100, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, + "0.33", 0, time.Hour, time.Hour, 30*time.Minute, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, {"0 init timeout period", types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - "0.33", time.Hour, 0, time.Hour, 30*time.Minute, "0.1", 100, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, + "0.33", time.Hour, 0, time.Hour, 30*time.Minute, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, {"0 vsc timeout period", types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - "0.33", time.Hour, time.Hour, 0, 30*time.Minute, "0.1", 100, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, + "0.33", time.Hour, time.Hour, 0, 30*time.Minute, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, {"0 slash meter replenish period", types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - "0.33", time.Hour, time.Hour, 24*time.Hour, 0, "0.1", 100, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, + "0.33", time.Hour, time.Hour, 24*time.Hour, 0, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, {"slash meter replenish fraction over 1", types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - "0.33", time.Hour, time.Hour, 24*time.Hour, time.Hour, "1.5", 100, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, - {"negative max pending slash packets", types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, - time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - "0.33", time.Hour, time.Hour, 24*time.Hour, time.Hour, "0.1", -100, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, + "0.33", time.Hour, time.Hour, 24*time.Hour, time.Hour, "1.5", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(10000000)}), false}, {"invalid consumer reward denom registration fee denom", types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - "0.33", time.Hour, time.Hour, 24*time.Hour, time.Hour, "0.1", -100, sdk.Coin{Denom: "st", Amount: sdk.NewInt(10000000)}), false}, + "0.33", time.Hour, time.Hour, 24*time.Hour, time.Hour, "0.1", sdk.Coin{Denom: "st", Amount: sdk.NewInt(10000000)}), false}, {"invalid consumer reward denom registration fee amount", types.NewParams(ibctmtypes.NewClientState("", ibctmtypes.DefaultTrustLevel, 0, 0, time.Second*40, clienttypes.Height{}, commitmenttypes.GetSDKSpecs(), []string{"ibc", "upgradedIBCState"}), - "0.33", time.Hour, time.Hour, 24*time.Hour, time.Hour, "0.1", -100, sdk.Coin{Denom: "stake", Amount: sdk.NewInt(-10000000)}), false}, + "0.33", time.Hour, time.Hour, 24*time.Hour, time.Hour, "0.1", sdk.Coin{Denom: "stake", Amount: sdk.NewInt(-10000000)}), false}, } for _, tc := range testCases { diff --git a/x/ccv/provider/types/provider.pb.go b/x/ccv/provider/types/provider.pb.go index ef0aa6e5e1..c064c7da6a 100644 --- a/x/ccv/provider/types/provider.pb.go +++ b/x/ccv/provider/types/provider.pb.go @@ -445,9 +445,6 @@ type Params struct { // every replenish period. This param also serves as a maximum fraction of // total voting power that the slash meter can hold. SlashMeterReplenishFraction string `protobuf:"bytes,7,opt,name=slash_meter_replenish_fraction,json=slashMeterReplenishFraction,proto3" json:"slash_meter_replenish_fraction,omitempty"` - // The maximum amount of throttled slash or vsc matured packets - // that can be queued for a single consumer before the provider chain halts. - MaxThrottledPackets int64 `protobuf:"varint,8,opt,name=max_throttled_packets,json=maxThrottledPackets,proto3" json:"max_throttled_packets,omitempty"` // The fee required to be paid to add a reward denom ConsumerRewardDenomRegistrationFee types2.Coin `protobuf:"bytes,9,opt,name=consumer_reward_denom_registration_fee,json=consumerRewardDenomRegistrationFee,proto3" json:"consumer_reward_denom_registration_fee"` } @@ -534,13 +531,6 @@ func (m *Params) GetSlashMeterReplenishFraction() string { return "" } -func (m *Params) GetMaxThrottledPackets() int64 { - if m != nil { - return m.MaxThrottledPackets - } - return 0 -} - func (m *Params) GetConsumerRewardDenomRegistrationFee() types2.Coin { if m != nil { return m.ConsumerRewardDenomRegistrationFee @@ -1420,115 +1410,114 @@ func init() { } var fileDescriptor_f22ec409a72b7b72 = []byte{ - // 1723 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0x4b, 0x73, 0x1b, 0xc7, - 0x11, 0xe6, 0x12, 0x20, 0x45, 0x34, 0xf8, 0xd2, 0x92, 0xb2, 0x40, 0x85, 0x01, 0xa9, 0x75, 0xec, - 0x30, 0xe5, 0xf2, 0xc2, 0xa4, 0x2a, 0x55, 0x2e, 0x55, 0x5c, 0x2e, 0x12, 0x94, 0x2d, 0x9a, 0xb1, - 0x45, 0x2f, 0x19, 0xaa, 0x92, 0x1c, 0xb6, 0x06, 0x33, 0x23, 0x60, 0x8a, 0xbb, 0x3b, 0xab, 0x99, - 0xc1, 0x4a, 0xb8, 0xe4, 0x9c, 0xa3, 0x73, 0x73, 0x25, 0x17, 0x27, 0x7f, 0x20, 0x7f, 0xc3, 0x47, - 0x1f, 0x73, 0xb2, 0x53, 0xd2, 0x21, 0x87, 0xfc, 0x89, 0xd4, 0xcc, 0x3e, 0x01, 0x3e, 0x02, 0x95, - 0x93, 0xdb, 0xa2, 0xa7, 0xfb, 0xeb, 0x9e, 0x7e, 0x7c, 0x3d, 0x24, 0xec, 0xb1, 0x48, 0x51, 0x81, - 0x07, 0x88, 0x45, 0xbe, 0xa4, 0x78, 0x28, 0x98, 0x1a, 0x75, 0x30, 0x4e, 0x3a, 0xb1, 0xe0, 0x09, - 0x23, 0x54, 0x74, 0x92, 0xdd, 0xe2, 0xdb, 0x8d, 0x05, 0x57, 0xdc, 0x7e, 0xfb, 0x0a, 0x1b, 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xb5, - 0xbf, 0x74, 0x81, 0xda, 0xe5, 0x0b, 0x38, 0x7f, 0xb5, 0x60, 0xbd, 0xea, 0x55, 0x9e, 0xf1, 0x13, - 0x31, 0x8c, 0xe8, 0x4d, 0xde, 0xcb, 0xf1, 0x9b, 0xad, 0x8e, 0xdf, 0x53, 0x58, 0x1e, 0x0b, 0x4a, - 0x66, 0xd9, 0xf8, 0x60, 0xaa, 0x1e, 0xab, 0xb0, 0xab, 0xb7, 0x54, 0xbd, 0x87, 0x3c, 0x78, 0xfa, - 0xed, 0xab, 0xb6, 0xf5, 0xdd, 0xab, 0xb6, 0xf5, 0xcf, 0x57, 0x6d, 0xeb, 0xab, 0xd7, 0xed, 0x99, - 0xef, 0x5e, 0xb7, 0x67, 0xfe, 0xf1, 0xba, 0x3d, 0xf3, 0xbb, 0x8f, 0xfa, 0x4c, 0x0d, 0x86, 0x3d, - 0x17, 0xf3, 0xb0, 0x93, 0xfd, 0x13, 0xa0, 0xf4, 0xf5, 0x7e, 0xf1, 0x1f, 0x92, 0xe4, 0x41, 0xe7, - 0xe5, 0xf8, 0x7f, 0x6c, 0xd4, 0x28, 0xa6, 0xb2, 0x37, 0x6f, 0x58, 0xe1, 0xc1, 0x7f, 0x02, 0x00, - 0x00, 0xff, 0xff, 0x47, 0xa2, 0xef, 0x46, 0xe2, 0x11, 0x00, 0x00, + // 1702 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x58, 0xcd, 0x73, 0xdb, 0xc6, + 0x15, 0x17, 0x44, 0x4a, 0x16, 0x1f, 0xf5, 0x65, 0x48, 0x89, 0x29, 0x57, 0xa5, 0x64, 0xa4, 0x49, + 0xd5, 0xc9, 0x04, 0x8c, 0xe4, 0xe9, 0x4c, 0xc6, 0xd3, 0x4c, 0x46, 0xa2, 0x9c, 0x58, 0x56, 0x13, + 0x2b, 0x90, 0x2a, 0x4f, 0xdb, 0x03,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x69, 0x7f, 0x20, 0x33, + 0xb1, 0xe8, 0x48, 0x12, 0x05, 0x84, 0x0f, 0x69, 0xa6, 0x5c, 0xbe, 0x19, 0x83, 0xcd, 0xca, 0x39, + 0xe6, 0xa3, 0x58, 0xb2, 0xce, 0x05, 0x19, 0x09, 0x73, 0xfa, 0x1e, 0x66, 0x62, 0xc8, 0x44, 0x87, + 0xa8, 0x8c, 0x45, 0x98, 0x74, 0xd2, 0xdd, 0x1e, 0x91, 0x68, 0xb7, 0x10, 0xe4, 0x71, 0x1b, 0xbd, + 0x1e, 0x12, 0xa5, 0x0e, 0x66, 0xd4, 0xc4, 0xed, 0xfc, 0x38, 0x0f, 0xad, 0xae, 0x49, 0xe4, 0x7e, + 0x10, 0x50, 0x75, 0xa5, 0x13, 0xce, 0x62, 0x26, 0x50, 0x68, 0xaf, 0xc3, 0x9c, 0xa4, 0x32, 0x24, + 0x2d, 0x6b, 0xdb, 0xda, 0x69, 0x78, 0xd9, 0x8b, 0xbd, 0x0d, 0xcd, 0x80, 0x08, 0xcc, 0x69, 0xac, + 0x94, 0x5b, 0xb3, 0xfa, 0xac, 0x2a, 0xb2, 0x37, 0x60, 0x21, 0xab, 0x03, 0x0d, 0x5a, 0x35, 0x7d, + 0x7c, 0x4b, 0xbf, 0x1f, 0x05, 0xf6, 0x67, 0xb0, 0x4c, 0x23, 0x2a, 0x29, 0x0a, 0xfd, 0x01, 0x51, + 0xd9, 0x68, 0xd5, 0xb7, 0xad, 0x9d, 0xe6, 0xde, 0x5d, 0x97, 0xf6, 0xb0, 0xab, 0x12, 0xe8, 0x9a, + 0xb4, 0xa5, 0xbb, 0xee, 0x23, 0xad, 0x71, 0x50, 0xff, 0xee, 0x87, 0xad, 0x19, 0x6f, 0xc9, 0xd8, + 0x65, 0x42, 0xfb, 0x1e, 0x2c, 0xf6, 0x49, 0x44, 0x04, 0x15, 0xfe, 0x00, 0x89, 0x41, 0x6b, 0x6e, + 0xdb, 0xda, 0x59, 0xf4, 0x9a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xff, 0x2c, 0x13, + 0xf6, 0x7a, 0xb4, 0x11, 0x00, 0x00, } func (m *ConsumerAdditionProposal) Marshal() (dAtA []byte, err error) { @@ -1893,11 +1882,6 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x4a - if m.MaxThrottledPackets != 0 { - i = encodeVarintProvider(dAtA, i, uint64(m.MaxThrottledPackets)) - i-- - dAtA[i] = 0x40 - } if len(m.SlashMeterReplenishFraction) > 0 { i -= len(m.SlashMeterReplenishFraction) copy(dAtA[i:], m.SlashMeterReplenishFraction) @@ -2784,9 +2768,6 @@ func (m *Params) Size() (n int) { if l > 0 { n += 1 + l + sovProvider(uint64(l)) } - if m.MaxThrottledPackets != 0 { - n += 1 + sovProvider(uint64(m.MaxThrottledPackets)) - } l = m.ConsumerRewardDenomRegistrationFee.Size() n += 1 + l + sovProvider(uint64(l)) return n @@ -4489,25 +4470,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.SlashMeterReplenishFraction = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 8: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field MaxThrottledPackets", wireType) - } - m.MaxThrottledPackets = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowProvider - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.MaxThrottledPackets |= int64(b&0x7F) << shift - if b < 0x80 { - break - } - } case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ConsumerRewardDenomRegistrationFee", wireType) From 656d837dbd47bfdb77423f3d22668f52a6d7cfb6 Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Wed, 27 Sep 2023 10:26:45 -0700 Subject: [PATCH 16/17] merge fixes --- tests/e2e/actions.go | 4 ++-- tests/e2e/state.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/e2e/actions.go b/tests/e2e/actions.go index 75ab81a2ac..63070289d6 100644 --- a/tests/e2e/actions.go +++ b/tests/e2e/actions.go @@ -2052,7 +2052,7 @@ type slashMeterReplenishmentAction struct { Timeout time.Duration } -func (tr TestRun) waitForSlashMeterReplenishment( +func (tr TestConfig) waitForSlashMeterReplenishment( action slashMeterReplenishmentAction, verbose bool, ) { @@ -2086,7 +2086,7 @@ type waitTimeAction struct { WaitTime time.Duration } -func (tr TestRun) waitForTime( +func (tr TestConfig) waitForTime( action waitTimeAction, verbose bool, ) { diff --git a/tests/e2e/state.go b/tests/e2e/state.go index 7c725427db..93566c1f05 100644 --- a/tests/e2e/state.go +++ b/tests/e2e/state.go @@ -658,7 +658,7 @@ func (tr TestConfig) getProviderAddressFromConsumer(consumerChain ChainID, valid return addr } -func (tr TestRun) getSlashMeter() int64 { +func (tr TestConfig) getSlashMeter() int64 { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[ChainID("provi")].BinaryName, @@ -698,7 +698,7 @@ func (tr TestConfig) getRegisteredConsumerRewardDenoms(chain ChainID) []string { return rewardDenoms } -func (tr TestRun) getPendingPacketQueueSize(chain ChainID) uint { +func (tr TestConfig) getPendingPacketQueueSize(chain ChainID) uint { //#nosec G204 -- Bypass linter warning for spawning subprocess with cmd arguments. cmd := exec.Command("docker", "exec", tr.containerConfig.InstanceName, tr.chainConfigs[chain].BinaryName, @@ -719,7 +719,7 @@ func (tr TestRun) getPendingPacketQueueSize(chain ChainID) uint { return uint(len(packetData)) } -func (tr TestRun) getValidatorNode(chain ChainID, validator ValidatorID) string { +func (tr TestConfig) getValidatorNode(chain ChainID, validator ValidatorID) string { // for CometMock, validatorNodes are all the same address as the query node (which is CometMocks address) if tr.useCometmock { return tr.getQueryNode(chain) From 48e75915eac6a255da42a7af59291dea0d7126ee Mon Sep 17 00:00:00 2001 From: Shawn <44221603+smarshall-spitzbart@users.noreply.github.com> Date: Wed, 27 Sep 2023 10:28:07 -0700 Subject: [PATCH 17/17] update e2e jsons --- .../e2e/tracehandler_testdata/changeover.json | 51 +-- .../e2e/tracehandler_testdata/democracy.json | 85 ++--- .../democracyRewardsSteps.json | 84 ++--- .../e2e/tracehandler_testdata/happyPath.json | 218 +++++-------- .../multipleConsumers.json | 291 ++++++------------ .../e2e/tracehandler_testdata/shorthappy.json | 167 ++++------ .../tracehandler_testdata/slashThrottle.json | 138 ++++----- 7 files changed, 367 insertions(+), 667 deletions(-) diff --git a/tests/e2e/tracehandler_testdata/changeover.json b/tests/e2e/tracehandler_testdata/changeover.json index d973b46fe4..8f90a114e3 100644 --- a/tests/e2e/tracehandler_testdata/changeover.json +++ b/tests/e2e/tracehandler_testdata/changeover.json @@ -24,8 +24,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -53,8 +52,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -98,8 +96,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -144,8 +141,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -185,8 +181,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -239,8 +234,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -288,8 +282,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -346,8 +339,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -364,8 +356,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -414,8 +405,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -443,8 +433,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -461,8 +450,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -490,8 +478,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -517,8 +504,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -546,8 +532,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -564,8 +549,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -593,8 +577,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } diff --git a/tests/e2e/tracehandler_testdata/democracy.json b/tests/e2e/tracehandler_testdata/democracy.json index 9a435b3a0b..46eadee2a1 100644 --- a/tests/e2e/tracehandler_testdata/democracy.json +++ b/tests/e2e/tracehandler_testdata/democracy.json @@ -1,4 +1,3 @@ - [ { "ActionType": "main.StartChainAction", @@ -38,8 +37,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -72,8 +70,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -116,8 +113,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -160,8 +156,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -196,8 +191,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -254,8 +248,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -272,8 +265,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -338,8 +330,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -356,8 +347,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -384,8 +374,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -413,8 +402,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -441,8 +429,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -482,8 +469,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -522,8 +508,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -552,8 +537,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -603,8 +587,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -636,8 +619,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": [], "Proposals": null } @@ -660,8 +642,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": [], "Proposals": null } @@ -693,8 +674,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": [ "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9" ], @@ -728,8 +708,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -755,8 +734,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -773,8 +751,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -802,8 +779,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -820,8 +796,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -849,8 +824,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -876,8 +850,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -894,8 +867,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -926,8 +898,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } diff --git a/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json b/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json index 355ff1fbb8..81bec7469a 100644 --- a/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json +++ b/tests/e2e/tracehandler_testdata/democracyRewardsSteps.json @@ -37,8 +37,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -71,8 +70,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -115,8 +113,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -159,8 +156,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -195,8 +191,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -253,8 +248,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -271,8 +265,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -337,8 +330,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -355,8 +347,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -383,8 +374,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -412,8 +402,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -440,8 +429,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -481,8 +469,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -521,8 +508,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -551,8 +537,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -602,8 +587,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -635,8 +619,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": [], "Proposals": null } @@ -659,8 +642,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": [], "Proposals": null } @@ -692,8 +674,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": [ "ibc/3C3D7B3BE4ECC85A0E5B52A3AEC3B7DFC2AA9CA47C37821E57020D6807043BE9" ], @@ -727,8 +708,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -754,8 +734,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -772,8 +751,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -801,8 +779,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -819,8 +796,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -848,8 +824,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -875,8 +850,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -893,8 +867,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -925,8 +898,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } diff --git a/tests/e2e/tracehandler_testdata/happyPath.json b/tests/e2e/tracehandler_testdata/happyPath.json index f46a4e983b..61d052918b 100644 --- a/tests/e2e/tracehandler_testdata/happyPath.json +++ b/tests/e2e/tracehandler_testdata/happyPath.json @@ -37,8 +37,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -71,8 +70,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -115,8 +113,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -159,8 +156,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -195,8 +191,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -253,8 +248,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -271,8 +265,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -323,8 +316,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -341,8 +333,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -369,8 +360,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -398,8 +388,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -426,8 +415,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -463,8 +451,7 @@ "bob": "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -481,8 +468,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -516,8 +502,7 @@ "bob": "cosmosvalcons1nx7n5uh0ztxsynn4sje6eyq2ud6rc6klc96w39", "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -534,8 +519,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -563,8 +547,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -581,8 +564,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -610,8 +592,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -639,8 +620,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -657,8 +637,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -686,8 +665,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -715,8 +693,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -733,8 +710,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -762,8 +738,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -792,8 +767,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -810,8 +784,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -839,8 +812,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -866,8 +838,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -884,8 +855,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -913,8 +883,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -931,8 +900,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -961,8 +929,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -979,8 +946,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1008,8 +974,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1035,8 +1000,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1053,8 +1017,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1073,7 +1036,6 @@ "ValBalances": null, "ValPowers": { "alice": 509, - "bob": 500, "carol": 501 }, "StakedTokens": null, @@ -1082,8 +1044,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1100,8 +1061,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1129,8 +1089,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1156,8 +1115,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1174,8 +1132,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1203,8 +1160,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1230,8 +1186,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1248,8 +1203,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1277,8 +1231,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1304,8 +1257,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1322,8 +1274,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1351,8 +1302,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1363,7 +1313,7 @@ "Action": { "Chain": "consu", "Height": 10, - "Time": "2023-09-20T18:24:51.823193+02:00", + "Time": "2023-09-27T10:27:44.186491-07:00", "Power": 500, "Validator": "bob", "Deposit": 10000001, @@ -1383,8 +1333,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1403,8 +1352,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "2": { @@ -1440,8 +1388,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1458,8 +1405,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1487,8 +1433,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1505,8 +1450,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1532,8 +1476,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1550,8 +1493,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1579,8 +1521,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1597,8 +1538,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1626,8 +1566,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1644,8 +1583,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1656,7 +1594,7 @@ "Action": { "Chain": "consu", "Height": 10, - "Time": "2023-09-20T18:24:51.823197+02:00", + "Time": "2023-09-27T10:27:44.186502-07:00", "Power": 500, "Validator": "bob", "Deposit": 10000001, @@ -1676,8 +1614,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1696,8 +1633,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "2": { @@ -1744,8 +1680,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1762,8 +1697,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "2": { @@ -1802,8 +1736,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1820,8 +1753,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1855,8 +1787,7 @@ }, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "3": { @@ -1902,8 +1833,7 @@ }, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "3": { @@ -1942,8 +1872,7 @@ }, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "4": { @@ -1987,8 +1916,7 @@ "ConsumerChains": {}, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "4": { diff --git a/tests/e2e/tracehandler_testdata/multipleConsumers.json b/tests/e2e/tracehandler_testdata/multipleConsumers.json index 4774a94ad8..1cb46af06c 100644 --- a/tests/e2e/tracehandler_testdata/multipleConsumers.json +++ b/tests/e2e/tracehandler_testdata/multipleConsumers.json @@ -37,8 +37,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -71,8 +70,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -115,8 +113,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -159,8 +156,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -195,8 +191,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -253,8 +248,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -271,8 +265,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -328,8 +321,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "2": { @@ -372,8 +364,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -416,8 +407,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -452,8 +442,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "2": { @@ -510,8 +499,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -528,8 +516,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -580,8 +567,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -598,8 +584,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -616,8 +601,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -645,8 +629,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -663,8 +646,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -681,8 +663,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -710,8 +691,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -728,8 +708,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -746,8 +725,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -775,8 +753,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -793,8 +770,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -811,8 +787,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -840,8 +815,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -858,8 +832,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -876,8 +849,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -905,8 +877,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -923,8 +894,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -941,8 +911,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -971,8 +940,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -989,8 +957,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1007,8 +974,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1036,8 +1002,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1054,8 +1019,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1072,8 +1036,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1101,8 +1064,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1119,8 +1081,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1137,8 +1098,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1164,8 +1124,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1182,8 +1141,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1200,8 +1158,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1229,8 +1186,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1247,8 +1203,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1265,8 +1220,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1294,8 +1248,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1312,8 +1265,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1341,8 +1293,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1359,8 +1310,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1386,8 +1336,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1404,8 +1353,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1422,8 +1370,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1451,8 +1398,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1469,8 +1415,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1487,8 +1432,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1516,8 +1460,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1534,8 +1477,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1552,8 +1494,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1579,8 +1520,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1597,8 +1537,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1615,8 +1554,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1644,8 +1582,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1662,8 +1599,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1680,8 +1616,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1709,8 +1644,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1727,8 +1661,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1745,8 +1678,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1772,8 +1704,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1790,8 +1721,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1808,8 +1738,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1837,8 +1766,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1855,8 +1783,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1873,8 +1800,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1902,8 +1828,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1920,8 +1845,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1938,8 +1862,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1965,8 +1888,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1983,8 +1905,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -2001,8 +1922,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -2030,8 +1950,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -2048,8 +1967,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -2066,8 +1984,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -2095,8 +2012,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -2113,8 +2029,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -2131,8 +2046,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -2158,8 +2072,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -2176,8 +2089,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -2194,8 +2106,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -2223,8 +2134,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -2241,8 +2151,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -2259,8 +2168,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -2288,8 +2196,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -2306,8 +2213,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -2324,8 +2230,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -2353,8 +2258,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -2371,8 +2275,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } diff --git a/tests/e2e/tracehandler_testdata/shorthappy.json b/tests/e2e/tracehandler_testdata/shorthappy.json index ee82bf619f..14083e0c08 100644 --- a/tests/e2e/tracehandler_testdata/shorthappy.json +++ b/tests/e2e/tracehandler_testdata/shorthappy.json @@ -37,8 +37,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -71,8 +70,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -115,8 +113,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -159,8 +156,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -195,8 +191,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -253,8 +248,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -271,8 +265,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -323,8 +316,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -341,8 +333,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -369,8 +360,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -398,8 +388,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -426,8 +415,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -455,8 +443,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -473,8 +460,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -502,8 +488,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -532,8 +517,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -550,8 +534,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -579,8 +562,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -606,8 +588,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -624,8 +605,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -644,7 +624,6 @@ "ValBalances": null, "ValPowers": { "alice": 509, - "bob": 500, "carol": 501 }, "StakedTokens": null, @@ -653,8 +632,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -671,8 +649,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -700,8 +677,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -727,8 +703,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -745,8 +720,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -774,8 +748,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -801,8 +774,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -819,8 +791,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -848,8 +819,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -875,8 +845,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -893,8 +862,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -922,8 +890,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -934,7 +901,7 @@ "Action": { "Chain": "consu", "Height": 10, - "Time": "2023-09-20T18:24:51.823231+02:00", + "Time": "2023-09-27T10:27:44.18657-07:00", "Power": 500, "Validator": "bob", "Deposit": 10000001, @@ -954,8 +921,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -974,8 +940,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "2": { @@ -1011,8 +976,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1029,8 +993,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1058,8 +1021,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1076,8 +1038,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1103,8 +1064,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1121,8 +1081,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1150,8 +1109,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1168,8 +1126,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1197,8 +1154,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1215,8 +1171,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1227,7 +1182,7 @@ "Action": { "Chain": "consu", "Height": 10, - "Time": "2023-09-20T18:24:51.823235+02:00", + "Time": "2023-09-27T10:27:44.186577-07:00", "Power": 500, "Validator": "bob", "Deposit": 10000001, @@ -1247,8 +1202,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1267,8 +1221,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "2": { @@ -1315,8 +1268,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1333,8 +1285,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "2": { @@ -1373,8 +1324,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -1391,8 +1341,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -1426,8 +1375,7 @@ }, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "3": { @@ -1473,8 +1421,7 @@ }, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "3": { @@ -1513,8 +1460,7 @@ }, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "4": { @@ -1558,8 +1504,7 @@ "ConsumerChains": {}, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "4": { diff --git a/tests/e2e/tracehandler_testdata/slashThrottle.json b/tests/e2e/tracehandler_testdata/slashThrottle.json index ea8306fd4c..d0173d03a8 100644 --- a/tests/e2e/tracehandler_testdata/slashThrottle.json +++ b/tests/e2e/tracehandler_testdata/slashThrottle.json @@ -37,8 +37,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -71,8 +70,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -115,8 +113,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -159,8 +156,7 @@ "ProviderKeys": { "carol": "cosmosvalcons1ezyrq65s3gshhx5585w6mpusq3xsj3ayzf4uv6" }, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -195,8 +191,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "1": { @@ -253,8 +248,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -271,8 +265,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -323,8 +316,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -341,8 +333,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -369,8 +360,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -398,8 +388,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -426,8 +415,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -453,8 +441,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": 1, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -471,8 +458,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -500,8 +486,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": 0, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -518,10 +503,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": { - "consu": 0 - }, - "GlobalSlashQueueSize": 0, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -547,8 +529,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": 1, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -565,8 +546,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -594,8 +574,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": 1, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -612,22 +591,17 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": { - "consu": 1 - }, - "GlobalSlashQueueSize": 1, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } } }, { - "ActionType": "main.slashThrottleDequeueAction", + "ActionType": "main.slashMeterReplenishmentAction", "Action": { - "Chain": "consu", - "CurrentQueueSize": 1, - "NextQueueSize": 0, - "Timeout": 80000000000 + "TargetValue": 0, + "Timeout": 100000000000 }, "State": { "consu": { @@ -643,8 +617,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": 1, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -653,7 +626,7 @@ "ValPowers": { "alice": 511, "bob": 0, - "carol": 0 + "carol": 500 }, "StakedTokens": null, "Params": null, @@ -661,10 +634,45 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": { - "consu": 0 + "ConsumerPendingPacketQueueSize": null, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + } + } + }, + { + "ActionType": "main.waitTimeAction", + "Action": { + "WaitTime": 30000000000 + }, + "State": { + "consu": { + "ValBalances": null, + "ValPowers": null, + "StakedTokens": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerPendingPacketQueueSize": 1, + "RegisteredConsumerRewardDenoms": null, + "Proposals": null + }, + "provi": { + "ValBalances": null, + "ValPowers": { + "alice": 511, + "bob": 0, + "carol": 500 }, - "GlobalSlashQueueSize": 0, + "StakedTokens": null, + "Params": null, + "Rewards": null, + "ConsumerChains": null, + "AssignedKeys": null, + "ProviderKeys": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -681,19 +689,14 @@ "State": { "consu": { "ValBalances": null, - "ValPowers": { - "alice": 511, - "bob": 0, - "carol": 0 - }, + "ValPowers": null, "StakedTokens": null, "Params": null, "Rewards": null, "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": 0, "RegisteredConsumerRewardDenoms": null, "Proposals": null }, @@ -710,10 +713,7 @@ "ConsumerChains": null, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": { - "consu": 0 - }, - "GlobalSlashQueueSize": 0, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": null } @@ -742,8 +742,7 @@ }, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "2": { @@ -787,8 +786,7 @@ "ConsumerChains": {}, "AssignedKeys": null, "ProviderKeys": null, - "ConsumerChainQueueSizes": null, - "GlobalSlashQueueSize": null, + "ConsumerPendingPacketQueueSize": null, "RegisteredConsumerRewardDenoms": null, "Proposals": { "2": {