diff --git a/.github/scripts/package-lock.json b/.github/scripts/package-lock.json new file mode 100644 index 000000000..4f089d5e1 --- /dev/null +++ b/.github/scripts/package-lock.json @@ -0,0 +1,29 @@ +{ + "name": "juno-release-dispatch-tests", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "juno-release-dispatch-tests", + "devDependencies": { + "yaml": "2.9.0" + } + }, + "node_modules/yaml": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.9.0.tgz", + "integrity": "sha512-2AvhNX3mb8zd6Zy7INTtSpl1F15HW6Wnqj0srWlkKLcpYl/gMIMJiyuGq2KeI2YFxUPjdlB+3Lc10seMLtL4cA==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + } + } +} diff --git a/.github/scripts/package.json b/.github/scripts/package.json new file mode 100644 index 000000000..02209dbc1 --- /dev/null +++ b/.github/scripts/package.json @@ -0,0 +1,10 @@ +{ + "name": "juno-release-dispatch-tests", + "private": true, + "scripts": { + "test": "node --test release-dispatch.test.js" + }, + "devDependencies": { + "yaml": "2.9.0" + } +} diff --git a/.github/scripts/release-dispatch.js b/.github/scripts/release-dispatch.js new file mode 100644 index 000000000..400142f62 --- /dev/null +++ b/.github/scripts/release-dispatch.js @@ -0,0 +1,93 @@ +'use strict'; + +const TARGET_REPOSITORY = 'CosmosContracts/juno-std'; +const EVENT_TYPE = 'juno-release'; + +function validateReleaseTag(tag) { + // Juno release tags use SemVer with a mandatory leading "v". Numeric + // prerelease identifiers may not contain leading zeroes (SemVer 2.0.0). + const semver = /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-(?:(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/; + if (typeof tag !== 'string' || !semver.test(tag)) { + throw new Error(`Invalid Juno release tag: '${tag || ''}'`); + } + + return tag; +} + +function requiredEnv(env, name) { + const value = env[name]; + if (!value) { + throw new Error(`Missing required environment variable: ${name}`); + } + return value; +} + +function buildDispatchRequest(payload, env) { + const release = payload && payload.release; + if (!release) { + throw new Error('A resolved GitHub release payload is required'); + } + const releaseTag = validateReleaseTag(release.tag_name); + const isDraft = Boolean(release.draft); + const isPrerelease = Boolean(release.prerelease); + const [owner, repo] = TARGET_REPOSITORY.split('/'); + + const repos = { + juno: { + name: 'juno', + repo: requiredEnv(env, 'JUNO_REPO'), + rev: releaseTag, + dir: requiredEnv(env, 'JUNO_DIR'), + exclude_mods: [], + }, + cosmos_sdk: { + name: 'cosmos', + repo: requiredEnv(env, 'COSMOS_SDK_REPO'), + rev: requiredEnv(env, 'COSMOS_SDK_REV'), + dir: requiredEnv(env, 'COSMOS_SDK_DIR'), + exclude_mods: ['cosmos/benchmark', 'cosmos/counter', 'cosmos/epochs', 'cosmos/protocolpool'], + }, + wasmd: { + name: 'wasm', + repo: requiredEnv(env, 'WASMD_REPO'), + rev: requiredEnv(env, 'WASMD_REV'), + dir: requiredEnv(env, 'WASMD_DIR'), + exclude_mods: [], + }, + cometbft: { + name: 'cometbft', + repo: requiredEnv(env, 'COMETBFT_REPO'), + rev: requiredEnv(env, 'COMETBFT_REV'), + dir: requiredEnv(env, 'COMETBFT_DIR'), + exclude_mods: [], + }, + ibc_go: { + name: 'ibc-go', + repo: requiredEnv(env, 'IBC_GO_REPO'), + rev: requiredEnv(env, 'IBC_GO_REV'), + dir: requiredEnv(env, 'IBC_GO_DIR'), + exclude_mods: [], + }, + ics23: { + name: 'ics23', + repo: requiredEnv(env, 'ICS23_REPO'), + rev: requiredEnv(env, 'ICS23_REV'), + dir: requiredEnv(env, 'ICS23_DIR'), + exclude_mods: [], + }, + }; + + return { + owner, + repo, + event_type: EVENT_TYPE, + client_payload: { + is_draft: isDraft, + is_prerelease: isPrerelease, + release_tag: releaseTag, + repos, + }, + }; +} + +module.exports = { buildDispatchRequest, validateReleaseTag }; diff --git a/.github/scripts/release-dispatch.test.js b/.github/scripts/release-dispatch.test.js new file mode 100644 index 000000000..07451a7d6 --- /dev/null +++ b/.github/scripts/release-dispatch.test.js @@ -0,0 +1,174 @@ +'use strict'; + +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const test = require('node:test'); +const YAML = require('yaml'); + +const { buildDispatchRequest, validateReleaseTag } = require('./release-dispatch'); + +const root = path.resolve(__dirname, '../..'); +const workflowPath = path.join(root, '.github/workflows/release-dispatch.yml'); +const ciPath = path.join(root, '.github/workflows/release-dispatch-ci.yml'); +const workflow = YAML.parse(fs.readFileSync(workflowPath, 'utf8')); + +const dependencyEnv = { + JUNO_REPO: 'https://github.com/CosmosContracts/juno.git', + JUNO_DIR: 'proto', + COSMOS_SDK_REPO: 'https://github.com/cosmos/cosmos-sdk.git', + COSMOS_SDK_REV: 'v0.53.7', + COSMOS_SDK_DIR: 'proto', + WASMD_REPO: 'https://github.com/CosmWasm/wasmd.git', + WASMD_REV: 'v0.61.11', + WASMD_DIR: 'proto', + COMETBFT_REPO: 'https://github.com/cometbft/cometbft.git', + COMETBFT_REV: 'v0.38.23', + COMETBFT_DIR: 'proto', + IBC_GO_REPO: 'https://github.com/cosmos/ibc-go.git', + IBC_GO_REV: 'v10.6.0', + IBC_GO_DIR: 'proto', + ICS23_REPO: 'https://github.com/cosmos/ics23.git', + ICS23_REV: 'go/v0.11.0', + ICS23_DIR: 'proto', +}; + +function request(payload) { + return buildDispatchRequest(payload, dependencyEnv); +} + +test('builds a payload from a published release event', () => { + const result = request({ + action: 'published', + release: { tag_name: 'v31.0.0', draft: false, prerelease: false }, + }); + + assert.equal(result.owner, 'CosmosContracts'); + assert.equal(result.repo, 'juno-std'); + assert.equal(result.event_type, 'juno-release'); + assert.deepEqual(result.client_payload, { + is_draft: false, + is_prerelease: false, + release_tag: 'v31.0.0', + repos: { + juno: { + name: 'juno', repo: dependencyEnv.JUNO_REPO, rev: 'v31.0.0', dir: 'proto', exclude_mods: [], + }, + cosmos_sdk: { + name: 'cosmos', repo: dependencyEnv.COSMOS_SDK_REPO, rev: 'v0.53.7', dir: 'proto', + exclude_mods: ['cosmos/benchmark', 'cosmos/counter', 'cosmos/epochs', 'cosmos/protocolpool'], + }, + wasmd: { + name: 'wasm', repo: dependencyEnv.WASMD_REPO, rev: 'v0.61.11', dir: 'proto', exclude_mods: [], + }, + cometbft: { + name: 'cometbft', repo: dependencyEnv.COMETBFT_REPO, rev: 'v0.38.23', dir: 'proto', exclude_mods: [], + }, + ibc_go: { + name: 'ibc-go', repo: dependencyEnv.IBC_GO_REPO, rev: 'v10.6.0', dir: 'proto', exclude_mods: [], + }, + ics23: { + name: 'ics23', repo: dependencyEnv.ICS23_REPO, rev: 'go/v0.11.0', dir: 'proto', exclude_mods: [], + }, + }, + }); +}); + +test('preserves prerelease flags from a published release payload', () => { + const result = request({ + action: 'published', + release: { tag_name: 'v31.0.0-rc.1', draft: false, prerelease: true }, + }); + + assert.equal(result.client_payload.release_tag, 'v31.0.0-rc.1'); + assert.equal(result.client_payload.is_draft, false); + assert.equal(result.client_payload.is_prerelease, true); +}); + +test('manual dispatch uses the release resolved by the workflow API lookup', () => { + const result = request({ + inputs: { release_tag: 'v32.1.0-rc.2' }, + release: { tag_name: 'v32.1.0-rc.2', draft: false, prerelease: true }, + }); + + assert.equal(result.client_payload.release_tag, 'v32.1.0-rc.2'); + assert.equal(result.client_payload.is_draft, false); + assert.equal(result.client_payload.is_prerelease, true); +}); + +test('accepts Juno semantic-version tags including release candidates', () => { + for (const tag of ['v31.0.0', 'v31.0.0-rc.1', 'v32.4.5-beta.2+build.7']) { + assert.equal(validateReleaseTag(tag), tag); + } +}); + +test('rejects branches, refs, and arbitrary strings as release tags', () => { + for (const tag of [ + '', 'main', 'release/v31', 'refs/tags/v31.0.0', 'v31', 'v31.0', 'v31.01.0', + 'v31.0.0-', 'v31.0.0-rc..1', 'v31.0.0 rc1', '../v31.0.0', + ]) { + assert.throws(() => validateReleaseTag(tag), /Juno release tag/i, JSON.stringify(tag)); + } +}); + +test('workflow listens only for release published and derives release state from payload', () => { + assert.deepEqual(workflow.on.release.types, ['published']); + assert.ok(workflow.on.workflow_dispatch.inputs.release_tag.required); + assert.deepEqual(Object.keys(workflow.on.workflow_dispatch.inputs), ['release_tag']); +}); + +test('manual workflow validates tag existence before dispatch', () => { + const script = workflow.jobs.dispatch.steps.find((step) => step.name === 'Dispatch release event').with.script; + const validation = script.indexOf('validateReleaseTag(payload.inputs.release_tag)'); + const lookup = script.indexOf('getReleaseByTag'); + const dispatch = script.indexOf('createDispatchEvent'); + assert.ok(validation >= 0 && lookup > validation, 'tag format must be validated before API lookup'); + assert.ok(lookup >= 0, 'manual path must resolve an existing GitHub release'); + assert.ok(dispatch > lookup, 'release lookup must occur before repository dispatch'); + assert.match(script, /context\.repo/); +}); + +test('workflow checks out and executes the exact trusted workflow revision', () => { + assert.deepEqual(workflow.permissions, { contents: 'read' }); + const checkout = workflow.jobs.dispatch.steps.find((step) => String(step.uses || '').startsWith('actions/checkout@')); + assert.match(checkout.uses, /^actions\/checkout@[0-9a-f]{40}$/); + assert.equal(checkout.with.ref, '${{ github.workflow_sha }}'); + assert.equal(checkout.with['persist-credentials'], false); + assert.match(workflow.jobs.dispatch.steps.at(-1).uses, /^actions\/github-script@[0-9a-f]{40}$/); +}); + +test('workflow dependency revisions track the selected v31 Go dependency graph', () => { + const goMod = fs.readFileSync(path.join(root, 'go.mod'), 'utf8'); + const moduleVersions = new Map( + [...goMod.matchAll(/^\s*(\S+)\s+(v\S+)(?:\s+\/\/.*)?$/gm)].map((match) => [match[1], match[2]]), + ); + const expected = { + COSMOS_SDK_REV: moduleVersions.get('github.com/cosmos/cosmos-sdk'), + WASMD_REV: moduleVersions.get('github.com/CosmWasm/wasmd'), + COMETBFT_REV: moduleVersions.get('github.com/cometbft/cometbft'), + IBC_GO_REV: moduleVersions.get('github.com/cosmos/ibc-go/v10'), + ICS23_REV: `go/${moduleVersions.get('github.com/cosmos/ics23/go')}`, + }; + + for (const [name, revision] of Object.entries(expected)) { + assert.ok(revision && !revision.includes('undefined'), `${name} dependency must exist in go.mod`); + assert.equal(workflow.env[name], revision); + } +}); + +test('dedicated CI runs offline Node tests and actionlint for dispatch files', () => { + const ci = YAML.parse(fs.readFileSync(ciPath, 'utf8')); + assert.deepEqual(ci.permissions, { contents: 'read' }); + const allSteps = Object.values(ci.jobs).flatMap((job) => job.steps); + assert.ok(allSteps.some((step) => step.run && step.run.includes('npm ci'))); + assert.ok(allSteps.some((step) => step.run && step.run.includes('npm test'))); + assert.ok(allSteps.some((step) => step.run && step.run.includes('actionlint'))); + for (const step of allSteps.filter((candidate) => candidate.uses)) { + assert.match(step.uses, /^[^@]+@[0-9a-f]{40}$/, `${step.uses} must use an immutable SHA`); + } +}); + +test('offline payload builder cannot perform network lookup or dispatch', () => { + const builder = fs.readFileSync(path.join(__dirname, 'release-dispatch.js'), 'utf8'); + assert.doesNotMatch(builder, /createDispatchEvent|getReleaseByTag|https?:/); +}); diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index dba8b1860..d56c550f4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,57 +2,163 @@ name: build on: + pull_request: + paths: + - "**/*.go" + - "go.mod" + - "go.sum" + - "interchaintest/go.mod" + - "interchaintest/go.sum" + - "proto/**" + - "api/**" + - "app/endpoints/**" + - "Dockerfile" + - "**/Dockerfile" + - "Makefile" + - "scripts/**" + - ".github/workflows/**" push: paths: - - "**.go" + - "**/*.go" + - "go.mod" - "go.sum" + - "interchaintest/go.mod" + - "interchaintest/go.sum" + - "proto/**" + - "api/**" + - "app/endpoints/**" + - "Dockerfile" + - "**/Dockerfile" + - "Makefile" + - "scripts/**" + - ".github/workflows/**" + +permissions: + contents: read concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true env: - GO_VERSION: 1.25.2 + GO_VERSION: 1.25.10 jobs: - build: + workflow-lint: + name: workflow syntax runs-on: ubuntu-latest - name: build steps: - - uses: actions/checkout@v4 - - name: Setup go - uses: actions/setup-go@v5 + - name: Checkout code + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 with: - go-version: ${{ env.GO_VERSION }} - - run: go build ./... + persist-credentials: false + - name: Install and run actionlint + env: + ACTIONLINT_VERSION: "1.7.7" + ACTIONLINT_SHA256: "023070a287cd8cccd71515fedc843f1985bf96c436b7effaecce67290e7e0757" + run: | + archive="actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" + curl --fail --location --silent --show-error \ + --output "$archive" \ + "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/${archive}" + printf '%s %s\n' "$ACTIONLINT_SHA256" "$archive" | sha256sum --check + tar --extract --gzip --file "$archive" actionlint + ./actionlint - test: + verify: + name: verify (${{ matrix.module }}) runs-on: ubuntu-latest - name: test + strategy: + fail-fast: false + matrix: + include: + - module: root + directory: . + - module: interchaintest + directory: interchaintest steps: - - name: Install Go - uses: actions/setup-go@v5 + - name: Checkout code + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - name: Set up Go + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version: ${{ env.GO_VERSION }} - - name: Checkout code - uses: actions/checkout@v4 - - name: Test - run: go test ./... + cache-dependency-path: ${{ matrix.directory }}/go.sum + - name: Verify dependencies + working-directory: ${{ matrix.directory }} + run: go mod verify tidy: + name: tidy-clean (${{ matrix.module }}) runs-on: ubuntu-latest - name: tidy + strategy: + fail-fast: false + matrix: + include: + - module: root + directory: . + - module: interchaintest + directory: interchaintest steps: - - uses: actions/checkout@v4 - - name: Setup go - uses: actions/setup-go@v5 + - name: Checkout code + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - name: Set up Go + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version: ${{ env.GO_VERSION }} - - run: | + cache-dependency-path: ${{ matrix.directory }}/go.sum + - name: Check that go mod tidy is clean + working-directory: ${{ matrix.directory }} + run: | go mod tidy - CHANGES_IN_REPO=$(git status --porcelain) - if [[ -n "$CHANGES_IN_REPO" ]]; then - echo "Repository is dirty. Showing 'git status' and 'git --no-pager diff' for debugging now:" - git status && git --no-pager diff - exit 1 - fi + git diff --exit-code -- go.mod go.sum + + build: + name: build (${{ matrix.module }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - module: root + directory: . + - module: interchaintest + directory: interchaintest + steps: + - name: Checkout code + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - name: Set up Go + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 + with: + go-version: ${{ env.GO_VERSION }} + cache-dependency-path: ${{ matrix.directory }}/go.sum + - name: Build packages + working-directory: ${{ matrix.directory }} + run: go build -mod=readonly ./... + + test: + name: test (${{ matrix.module }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - module: root + directory: . + arguments: "-race" + # E2E suites run in independent Docker-backed lanes in + # interchaintest-E2E.yml. This gate compiles every nested-module test. + - module: interchaintest + directory: interchaintest + arguments: "-race -run=^$" + steps: + - name: Checkout code + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - name: Set up Go + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 + with: + go-version: ${{ env.GO_VERSION }} + cache-dependency-path: ${{ matrix.directory }}/go.sum + - name: Test packages + working-directory: ${{ matrix.directory }} + run: go test -mod=readonly ${{ matrix.arguments }} ./... diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a39cd6189..e8436b5d3 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -18,7 +18,7 @@ concurrency: cancel-in-progress: true env: - GO_VERSION: 1.25.2 + GO_VERSION: 1.25.10 jobs: analyze: diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 2bfe44bd2..8cd66abcb 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -17,7 +17,7 @@ concurrency: cancel-in-progress: true env: - GO_VERSION: 1.25.2 + GO_VERSION: 1.25.10 jobs: golangci: diff --git a/.github/workflows/interchaintest-E2E.yml b/.github/workflows/interchaintest-E2E.yml index bf539166a..b1fdb4e2b 100644 --- a/.github/workflows/interchaintest-E2E.yml +++ b/.github/workflows/interchaintest-E2E.yml @@ -2,19 +2,44 @@ name: ictest E2E on: pull_request: + paths: + - "**/*.go" + - "go.mod" + - "go.sum" + - "interchaintest/**" + - "proto/**" + - "api/**" + - "app/endpoints/**" + - "Dockerfile" + - "**/Dockerfile" + - "Makefile" + - "scripts/**" + - ".github/workflows/**" push: tags: - "**" branches: - "main" - "master" + paths: + - "**/*.go" + - "go.mod" + - "go.sum" + - "interchaintest/**" + - "proto/**" + - "api/**" + - "app/endpoints/**" + - "Dockerfile" + - "**/Dockerfile" + - "Makefile" + - "scripts/**" + - ".github/workflows/**" permissions: contents: read - packages: write env: - GO_VERSION: 1.25.2 + GO_VERSION: 1.25.10 TAR_PATH: /tmp/juno-docker-image.tar IMAGE_NAME: juno-docker-image @@ -27,19 +52,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Setup Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v5 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version: ${{ env.GO_VERSION }} cache-dependency-path: interchaintest/go.sum - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3 - name: Build and export - uses: docker/build-push-action@v6 + uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6 with: context: . # Tag must match the repo string in @@ -51,7 +76,7 @@ jobs: outputs: type=docker,dest=${{ env.TAR_PATH }} - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 with: name: ${{ env.IMAGE_NAME }} path: ${{ env.TAR_PATH }} @@ -82,16 +107,16 @@ jobs: steps: - name: Set up Go ${{ env.GO_VERSION }} - uses: actions/setup-go@v5 + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 with: go-version: ${{ env.GO_VERSION }} cache-dependency-path: interchaintest/go.sum - name: checkout chain - uses: actions/checkout@v4 + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 - name: Download Tarball Artifact - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4 with: name: ${{ env.IMAGE_NAME }} path: /tmp @@ -102,19 +127,7 @@ jobs: docker image ls -a - name: Run Test - id: run_test - continue-on-error: true + # A failed assertion is deterministic until proved otherwise. Do not + # retry it into a green lane; the original log and exit status remain + # the authoritative failure evidence. run: make ${{ matrix.test }} - - - name: Retry Failed Test - if: steps.run_test.outcome == 'failure' - run: | - for i in 1 2; do - echo "Retry attempt $i" - if make ${{ matrix.test }}; then - echo "Test passed on retry" - exit 0 - fi - done - echo "Test failed after retries" - exit 1 diff --git a/.github/workflows/proto.yml b/.github/workflows/proto.yml new file mode 100644 index 000000000..03697b535 --- /dev/null +++ b/.github/workflows/proto.yml @@ -0,0 +1,62 @@ +--- +name: generated protobuf + +on: + pull_request: + paths: + - "proto/**" + - "api/**" + - "app/endpoints/openapi*" + - "scripts/buf/**" + - "buf.yaml" + - "buf.lock" + - "go.mod" + - "go.sum" + - "proto/Dockerfile" + - "Makefile" + - ".github/workflows/proto.yml" + push: + paths: + - "proto/**" + - "api/**" + - "app/endpoints/openapi*" + - "scripts/buf/**" + - "buf.yaml" + - "buf.lock" + - "go.mod" + - "go.sum" + - "proto/Dockerfile" + - "Makefile" + - ".github/workflows/proto.yml" + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + generated-clean: + name: generated files are current + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + - name: Set up Go + uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 + with: + go-version: 1.25.10 + cache-dependency-path: go.sum + - name: Build project protobuf toolchain + run: make proto-image + - name: Check protobuf and regenerate committed outputs + run: make proto-all + - name: Require a clean generated tree + run: | + if [[ -n "$(git status --porcelain)" ]]; then + git status --short + git --no-pager diff + echo "Generated protobuf/API files or buf.lock are stale. Update dependencies explicitly, then run 'make proto-image proto-all' and commit the result." + exit 1 + fi diff --git a/.github/workflows/push-docker-images.yml b/.github/workflows/push-docker-images.yml deleted file mode 100644 index de1a5eaef..000000000 --- a/.github/workflows/push-docker-images.yml +++ /dev/null @@ -1,69 +0,0 @@ -# This workflow pushes new juno docker images on every new tag. -# -# On every new `vX.Y.Z` tag the following images are pushed: -# -# cosmoscontracts/juno:vX.Y.Z # is pushed -# cosmoscontracts/juno:X.Y.Z # is pushed -# cosmoscontracts/juno:X.Y # is updated to X.Y.Z -# cosmoscontracts/juno:X # is updated to X.Y.Z -# cosmoscontracts/juno:latest # is updated to X.Y.Z -# -# All the images above have support for linux/amd64 and linux/arm64. -# -# Due to QEMU virtualization used to build multi-platform docker images -# this workflow might take a while to complete. - -name: Push Docker Images - -on: - release: - types: [published, created, edited] - push: - tags: - - 'v[0-9]+.[0-9]+.[0-9]+' # ignore rc - -jobs: - juno-images: - runs-on: ubuntu-latest - steps: - - - name: Check out the repo - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Parse tag - id: tag - run: | - VERSION=$(echo ${{ github.ref_name }} | sed "s/v//") - MAJOR_VERSION=$(echo $VERSION | cut -d '.' -f 1) - MINOR_VERSION=$(echo $VERSION | cut -d '.' -f 2) - PATCH_VERSION=$(echo $VERSION | cut -d '.' -f 3) - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo "MAJOR_VERSION=$MAJOR_VERSION" >> $GITHUB_ENV - echo "MINOR_VERSION=$MINOR_VERSION" >> $GITHUB_ENV - echo "PATCH_VERSION=$PATCH_VERSION" >> $GITHUB_ENV - - - name: Build and push - id: build_push_image - uses: docker/build-push-action@v6 - with: - file: Dockerfile - context: . - push: true - platforms: linux/amd64,linux/arm64 - tags: | - ghcr.io/cosmoscontracts/juno:${{ env.MAJOR_VERSION }} - ghcr.io/cosmoscontracts/juno:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }} - ghcr.io/cosmoscontracts/juno:${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }} - ghcr.io/cosmoscontracts/juno:v${{ env.MAJOR_VERSION }}.${{ env.MINOR_VERSION }}.${{ env.PATCH_VERSION }} diff --git a/.github/workflows/release-dispatch-ci.yml b/.github/workflows/release-dispatch-ci.yml new file mode 100644 index 000000000..33babd8a9 --- /dev/null +++ b/.github/workflows/release-dispatch-ci.yml @@ -0,0 +1,61 @@ +name: Release dispatch checks + +on: + push: + paths: + - ".github/scripts/release-dispatch.js" + - ".github/scripts/release-dispatch.test.js" + - ".github/scripts/package.json" + - ".github/scripts/package-lock.json" + - ".github/workflows/release-dispatch.yml" + - ".github/workflows/release-dispatch-ci.yml" + - "go.mod" + pull_request: + paths: + - ".github/scripts/release-dispatch.js" + - ".github/scripts/release-dispatch.test.js" + - ".github/scripts/package.json" + - ".github/scripts/package-lock.json" + - ".github/workflows/release-dispatch.yml" + - ".github/workflows/release-dispatch-ci.yml" + - "go.mod" + +permissions: + contents: read + +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 + with: + node-version: 22 + cache: npm + cache-dependency-path: .github/scripts/package-lock.json + - name: Run offline payload tests + working-directory: .github/scripts + run: | + npm ci --ignore-scripts + npm test + + actionlint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 + with: + persist-credentials: false + - name: Install and run actionlint + env: + ACTIONLINT_VERSION: "1.7.7" + ACTIONLINT_SHA256: "023070a287cd8cccd71515fedc843f1985bf96c436b7effaecce67290e7e0757" + run: | + archive="actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz" + curl --fail --location --silent --show-error \ + --output "$archive" \ + "https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/${archive}" + printf '%s %s\n' "$ACTIONLINT_SHA256" "$archive" | sha256sum --check + tar --extract --gzip --file "$archive" actionlint + ./actionlint diff --git a/.github/workflows/release-dispatch.yml b/.github/workflows/release-dispatch.yml index 95b68a618..d19c8f41a 100644 --- a/.github/workflows/release-dispatch.yml +++ b/.github/workflows/release-dispatch.yml @@ -2,21 +2,35 @@ name: Dispatch Release to juno-std on: release: - types: [released] + # "published" covers both full releases and draft-to-prerelease transitions. + # Payload fields below determine whether the published release is a prerelease. + types: [published] + workflow_dispatch: + inputs: + release_tag: + description: Release tag to redispatch + required: true + type: string + +permissions: + contents: read + env: JUNO_REPO: "https://github.com/CosmosContracts/juno.git" JUNO_DIR: "proto" + # Keep these selected proto revisions aligned with the dependency graph in go.mod. + # .github/scripts/release-dispatch.test.js enforces that relationship offline. COSMOS_SDK_REPO: "https://github.com/cosmos/cosmos-sdk.git" - COSMOS_SDK_REV: "v0.53.4" + COSMOS_SDK_REV: "v0.53.8" COSMOS_SDK_DIR: "proto" WASMD_REPO: "https://github.com/CosmWasm/wasmd.git" - WASMD_REV: "v0.54.2" + WASMD_REV: "v0.61.14" WASMD_DIR: "proto" COMETBFT_REPO: "https://github.com/cometbft/cometbft.git" - COMETBFT_REV: "v0.38.19" + COMETBFT_REV: "v0.38.25" COMETBFT_DIR: "proto" IBC_GO_REPO: "https://github.com/cosmos/ibc-go.git" - IBC_GO_REV: "v8.7.0" + IBC_GO_REV: "v10.7.0" IBC_GO_DIR: "proto" ICS23_REPO: "https://github.com/cosmos/ics23.git" ICS23_REV: "go/v0.11.0" @@ -26,90 +40,36 @@ jobs: dispatch: runs-on: ubuntu-latest steps: + - name: Check out payload builder + uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6 + with: + # Never execute code from the release tag while DISPATCH_TOKEN is present. + # The builder must be the exact revision containing this workflow run. + ref: ${{ github.workflow_sha }} + persist-credentials: false + - name: Dispatch release event - uses: actions/github-script@v8 + uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8 with: github-token: ${{ secrets.DISPATCH_TOKEN }} script: | - const { context, core, github } = require('@actions/github-script'); + const { buildDispatchRequest, validateReleaseTag } = require('./.github/scripts/release-dispatch'); - // Resolve target repository (owner/repo) from env - const repoStr = "CosmosContracts/juno-std"; - if (!repoStr.includes('/')) { - core.setFailed(`Invalid repository: '${repoStr}'`); - return; - } - const [targetOwner, targetRepo] = "CosmosContracts/juno-std".split('/', 2); + let payload = context.payload; + try { + if (!payload.release) { + const releaseTag = validateReleaseTag(payload.inputs.release_tag); + const { data: release } = await github.rest.repos.getReleaseByTag({ + ...context.repo, + tag: releaseTag, + }); + payload = { ...payload, release }; + } - // Determine release_tag and flags based on event type or manual inputs - const inputs = (context.payload && context.payload.inputs) || {}; - const releaseTag = inputs.release_tag || ''; - const isDraft = String(inputs.is_draft || '').toLowerCase() === 'true'; - const isPrerelease = String(inputs.is_prerelease || '').toLowerCase() === 'true'; - - if (!releaseTag) { - core.setFailed('Unable to determine release_tag'); - return; + const request = buildDispatchRequest(payload, process.env); + core.info(`Dispatching to ${request.owner}/${request.repo} with payload: ${JSON.stringify(request.client_payload)}`); + await github.rest.repos.createDispatchEvent(request); + core.info('Repository dispatch event sent successfully.'); + } catch (error) { + core.setFailed(error.message); } - - // Build 'repos' as a structured JSON object keyed by name - const repos = { - juno: { - name: 'juno', - repo: process.env.JUNO_REPO, - rev: releaseTag, - dir: process.env.JUNO_DIR, - exclude_mods: [], - }, - cosmos_sdk: { - name: 'cosmos', - repo: process.env.COSMOS_SDK_REPO, - rev: process.env.COSMOS_SDK_REV, - dir: process.env.COSMOS_SDK_DIR, - exclude_mods: ['cosmos/benchmark', 'cosmos/counter', 'cosmos/epochs', 'cosmos/protocolpool], - }, - wasmd: { - name: 'wasm', - repo: process.env.WASMD_REPO, - rev: process.env.WASMD_REV, - dir: process.env.WASMD_DIR, - exclude_mods: [], - }, - cometbft: { - name: 'cometbft', - repo: process.env.COMETBFT_REPO, - rev: process.env.COMETBFT_REV, - dir: process.env.COMETBFT_DIR, - exclude_mods: [], - }, - ibc_go: { - name: 'ibc-go', - repo: process.env.IBC_GO_REPO, - rev: process.env.IBC_GO_REV, - dir: process.env.IBC_GO_DIR, - exclude_mods: [], - }, - ics23: { - name: 'ics23', - repo: process.env.ICS23_REPO, - rev: process.env.ICS23_REV, - dir: process.env.ICS23_DIR, - exclude_mods: [], - }, - }; - - const payload = { - is_draft: isDraft, - is_prerelease: isPrerelease, - release_tag: releaseTag, - repos, - }; - - core.info(`Dispatching to ${targetOwner}/${targetRepo} with payload: ${JSON.stringify(payload)}`); - await github.rest.repos.createDispatchEvent({ - owner: targetOwner, - repo: targetRepo, - event_type: "juno-release", - client_payload: payload, - }); - core.info('Repository dispatch event sent successfully.'); diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e4c130e3..b9e50512f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,35 +1,266 @@ ---- -name: release binary +name: Verifiable v31 release on: - release: - types: [created] + push: + tags: ["v31.[0-9]*.[0-9]*"] + workflow_dispatch: + inputs: + tag: + description: Existing v31 semantic tag to publish (fails if a release already exists) + required: true + type: string -jobs: - release-alpine-static: - permissions: write-all - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 +concurrency: + group: release-publication-${{ github.repository }} + cancel-in-progress: false - - name: Docker compose - run: STAKE_TOKEN="ujunox" TIMEOUT_COMMIT=500ms docker compose up -d +permissions: + contents: read - - name: Copy binary - run: docker cp juno-node-1:/usr/bin/junod ./junod +jobs: + guard: + runs-on: ubuntu-24.04 + outputs: + tag: ${{ steps.guard.outputs.tag }} + tag_oid: ${{ steps.guard.outputs.tag_oid }} + commit: ${{ steps.guard.outputs.commit }} + epoch: ${{ steps.guard.outputs.epoch }} + image: ${{ steps.guard.outputs.image }} + steps: + # Publication policy comes from the reviewed workflow revision, never the tag. + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ github.workflow_sha }} + persist-credentials: false + - id: guard + env: + EVENT_AFTER: ${{ github.event.after }} + EVENT_NAME: ${{ github.event_name }} + GH_TOKEN: ${{ github.token }} + REQUESTED_TAG: ${{ inputs.tag || github.ref_name }} + run: | + . scripts/release/lib.sh + validate_version "$REQUESTED_TAG" + identity=$(resolve_remote_tag_identity . origin "$REQUESTED_TAG") + tag_oid=${identity%% *} + resolved_commit=${identity#* } + if [ "$EVENT_NAME" = push ]; then + validate_commit "$EVENT_AFTER" + if [ "$EVENT_AFTER" != "$tag_oid" ]; then + echo "push event tag object $EVENT_AFTER is no longer current ($tag_oid peeled to $resolved_commit)" >&2 + exit 1 + fi + fi + github_auth=$(printf 'Authorization: Bearer %s' "$GH_TOKEN") + response=$(mktemp) + status=$(curl --silent --show-error --output "$response" --write-out '%{http_code}' \ + --header "$github_auth" --header 'Accept: application/vnd.github+json' \ + "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/releases/tags/$REQUESTED_TAG") + require_absent_http_status "$status" "release $REQUESTED_TAG" || { cat "$response" >&2; exit 1; } + rm -f "$response" + epoch=$(gh api "repos/$GITHUB_REPOSITORY/commits/$resolved_commit" --jq '.commit.committer.date | fromdateiso8601') + repository=$(printf '%s' "$GITHUB_REPOSITORY" | tr '[:upper:]' '[:lower:]') + { + echo "tag=$REQUESTED_TAG" + echo "tag_oid=$tag_oid" + echo "commit=$resolved_commit" + echo "epoch=$epoch" + echo "image=ghcr.io/$repository" + } >>"$GITHUB_OUTPUT" - - name: Save sha256 sum - run: sha256sum ./junod > ./junod_sha256.txt + binaries: + needs: guard + strategy: + matrix: + arch: [amd64, arm64] + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ needs.guard.outputs.commit }} + fetch-depth: 0 + persist-credentials: false + - uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 + - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 + - name: Revalidate source before building + env: + COMMIT: ${{ needs.guard.outputs.commit }} + TAG: ${{ needs.guard.outputs.tag }} + TAG_OID: ${{ needs.guard.outputs.tag_oid }} + run: | + # COMMIT is supplied by the step environment. + # shellcheck disable=SC2153 + commit=$COMMIT + . scripts/release/lib.sh + test "$(git rev-parse HEAD)" = "$commit" + test "$(resolve_remote_tag_identity . origin "$TAG" "$TAG_OID" "$commit")" = "$TAG_OID $commit" + - name: Build and verify tagged binary + env: + VERSION: ${{ needs.guard.outputs.tag }} + COMMIT: ${{ needs.guard.outputs.commit }} + SOURCE_DATE_EPOCH: ${{ needs.guard.outputs.epoch }} + ARCH: ${{ matrix.arch }} + OUT_DIR: dist + run: scripts/release/build.sh + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: binary-${{ matrix.arch }} + path: dist/* + if-no-files-found: error + retention-days: 1 - - name: Release - uses: softprops/action-gh-release@v2 + container: + needs: guard + env: + IMAGE: ${{ needs.guard.outputs.image }} + outputs: + digest: ${{ steps.push.outputs.digest }} + permissions: + contents: read + packages: write + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ needs.guard.outputs.commit }} + fetch-depth: 0 + persist-credentials: false + path: source + # Run release policy only from the reviewed workflow revision. + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: - token: ${{ github.token }} - files: | - junod - junod_sha256.txt + ref: ${{ github.workflow_sha }} + persist-credentials: false + path: policy + - uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 + - uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 + - name: Revalidate source immediately before digest publication + env: + COMMIT: ${{ needs.guard.outputs.commit }} + TAG: ${{ needs.guard.outputs.tag }} + TAG_OID: ${{ needs.guard.outputs.tag_oid }} + run: | + . policy/scripts/release/lib.sh + test "$(git -C source rev-parse HEAD)" = "$COMMIT" + test "$(resolve_remote_tag_identity source origin "$TAG" "$TAG_OID" "$COMMIT")" = "$TAG_OID $COMMIT" + - uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ github.token }} + # GHCR tags are mutable and cannot be claimed with create-only semantics. + # Push a canonical manifest by content digest only; no registry tag is made. + - name: Publish content-addressed container manifest without tags + id: push + uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 + with: + context: source + file: source/release.Dockerfile + target: image + platforms: linux/amd64,linux/arm64 + build-args: | + VERSION=${{ needs.guard.outputs.tag }} + COMMIT=${{ needs.guard.outputs.commit }} + SOURCE_DATE_EPOCH=${{ needs.guard.outputs.epoch }} + SOURCE_REPOSITORY=${{ github.server_url }}/${{ github.repository }} + outputs: type=image,name=${{ env.IMAGE }},push-by-digest=true,name-canonical=true,push=true + cache-from: type=gha + provenance: mode=max + sbom: true + - name: Verify and record manifest-list and platform digests + env: + DIGEST: ${{ steps.push.outputs.digest }} + run: | + . policy/scripts/release/lib.sh + case "$DIGEST" in + sha256:*) validate_sha256 "${DIGEST#sha256:}" ;; + *) echo "invalid container digest: $DIGEST" >&2; exit 1 ;; + esac + docker buildx imagetools inspect --raw "$IMAGE@$DIGEST" >manifest.json + actual="sha256:$(sha256sum manifest.json | cut -d ' ' -f 1)" + test "$actual" = "$DIGEST" + jq -e -n --arg image "$IMAGE" --arg manifest "$DIGEST" \ + --slurpfile index manifest.json \ + '{image:$image,manifest_digest:$manifest,reference:($image+"@"+$manifest),platforms:[$index[0].manifests[]|select(.platform.os=="linux" and (.platform.architecture=="amd64" or .platform.architecture=="arm64"))|{platform:(.platform.os+"/"+.platform.architecture),digest:.digest}]} | select((.platforms|length)==2 and ([.platforms[].platform]|unique|length)==2)' \ + >container-digests.json + - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 + with: + name: container-digests + path: container-digests.json + retention-days: 1 - - name: Dump docker logs on failure - if: failure() - uses: jwalton/gh-docker-logs@v2 + publish: + needs: [guard, binaries, container] + env: + IMAGE: ${{ needs.guard.outputs.image }} + TAG: ${{ needs.guard.outputs.tag }} + TAG_OID: ${{ needs.guard.outputs.tag_oid }} + COMMIT: ${{ needs.guard.outputs.commit }} + permissions: + contents: write + packages: write + id-token: write + attestations: write + runs-on: ubuntu-24.04 + steps: + # Only trusted workflow-revision scripts run while the write token exists. + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + with: + ref: ${{ github.workflow_sha }} + persist-credentials: false + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + pattern: binary-* + path: dist + merge-multiple: true + - uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 + with: + name: container-digests + path: dist + - name: Generate offline metadata and checksums + run: | + # COMMIT is supplied by the job environment. + # shellcheck disable=SC2153 + commit=$COMMIT + cp RELEASE-VERIFICATION.md dist/ + python3 scripts/release/metadata.py --directory dist --version "$TAG" \ + --commit "$commit" --repository "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" \ + --workflow-sha "$GITHUB_WORKFLOW_SHA" + . scripts/release/lib.sh + generate_checksums dist + (cd dist && sha256sum --check SHA256SUMS) + - name: Revalidate source before asset attestations + run: | + # COMMIT is supplied by the job environment. + # shellcheck disable=SC2153 + commit=$COMMIT + . scripts/release/lib.sh + test "$(resolve_remote_tag_identity . origin "$TAG" "$TAG_OID" "$commit")" = "$TAG_OID $commit" + - name: Attest every release asset + uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0 + with: + subject-path: dist/* + - name: Revalidate source before container attestation + run: | + # COMMIT is supplied by the job environment. + # shellcheck disable=SC2153 + commit=$COMMIT + . scripts/release/lib.sh + test "$(resolve_remote_tag_identity . origin "$TAG" "$TAG_OID" "$commit")" = "$TAG_OID $commit" + - name: Attest the content-addressed container manifest + uses: actions/attest-build-provenance@977bb373ede98d70efdf65b84cb5f73e068dcc2a # v3.0.0 + with: + subject-name: ${{ env.IMAGE }} + subject-digest: ${{ needs.container.outputs.digest }} + push-to-registry: true + - name: Revalidate and create the GitHub release + env: + GH_TOKEN: ${{ github.token }} + run: | + # COMMIT is supplied by the job environment. + # shellcheck disable=SC2153 + commit=$COMMIT + . scripts/release/lib.sh + test "$(resolve_remote_tag_identity . origin "$TAG" "$TAG_OID" "$commit")" = "$TAG_OID $commit" + gh release create "$TAG" dist/* --verify-tag --title "$TAG" \ + --notes "Verifiable Juno release built from $commit. The container is published only at the digest recorded in container-digests.json." diff --git a/CLAUDE.md b/CLAUDE.md index 8f1c9fe04..be85df332 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -4,11 +4,11 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co ## What this is -Juno is a sovereign Cosmos SDK / CometBFT chain with CosmWasm smart-contract support (via `wasmd`). The binary is `junod`. Go module path is `github.com/CosmosContracts/juno/v30` — the `/v30` suffix tracks the current chain upgrade name and is bumped each consensus-breaking release (see `RELEASES.md`). +Juno is a sovereign Cosmos SDK / CometBFT chain with CosmWasm smart-contract support (via `wasmd`). The binary is `junod`. Go module path is `github.com/CosmosContracts/juno/v31` — the `/v31` suffix tracks the current chain upgrade name and is bumped each consensus-breaking release (see `RELEASES.md`). ## Toolchain -Go 1.25.2 is pinned in `.mise.toml` (also: `buf`, `yq`). Run `mise install` once to provision them. Dev tools (`golangci-lint`, `gofumpt`, `buf`, protoc plugins) are declared as Go tool dependencies in `go.mod` and invoked via `go tool …` — do not install them separately. +Go 1.25.10 is pinned in `.mise.toml` (also: `buf`, `yq`). Run `mise install` once to provision them. Dev tools (`golangci-lint`, `gofumpt`, `buf`, protoc plugins) are declared as Go tool dependencies in `go.mod` and invoked via `go tool …` — do not install them separately. ## Common commands @@ -96,7 +96,7 @@ Tx fee handling is *not* a single decorator; the order in `app/ante/ante.go` mat ### Versioned upgrades and module path -The Go module is `…/juno/v30`. Internal imports use `github.com/CosmosContracts/juno/v30/...`. When the chain is bumped to v31 the entire repo is mass-rewritten: `go.mod` major version, every import, and the upgrade name string in `app/upgrades/v31/`. Don't introduce code that pins the literal `"v30"` outside the upgrade package and import paths. +The Go module is `…/juno/v31`. Internal imports use `github.com/CosmosContracts/juno/v31/...`. For each consensus-breaking major release the entire repo is mass-rewritten: `go.mod` major version, every import, and the new upgrade package/name. Don't pin the current major version outside module/import identity and the corresponding upgrade package. ## Conventions worth knowing diff --git a/Dockerfile b/Dockerfile index 25c0cf631..ded836ced 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ # Arguments # -------------------------------------------------------- -ARG GO_VERSION="1.25.2" +ARG GO_VERSION="1.25.10" ARG ALPINE_VERSION="3.22" # -------------------------------------------------------- @@ -12,7 +12,7 @@ ARG ALPINE_VERSION="3.22" # -------------------------------------------------------- FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS builder -ENV GOTOOLCHAIN=go1.25.2 +ENV GOTOOLCHAIN=go1.25.10 RUN apk add --no-cache \ ca-certificates \ @@ -28,7 +28,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build \ --mount=type=cache,target=/root/go/pkg/mod \ go mod download -# Fetch wasmvm — bumped from /v2 to /v3 to match the Path A+ wasmvm v3.0.4 +# Fetch wasmvm — bumped from /v2 to /v3 to match the Path A+ wasmvm v3 # pinned in go.mod. v2.x's libwasmvm.a is ABI-incompatible with the v3 Go # bindings; using the wrong archive silently produces a dynamically-linked # binary because the muslc tag is unsatisfied. diff --git a/Makefile b/Makefile index 041f06f8f..a560ece6d 100644 --- a/Makefile +++ b/Makefile @@ -231,7 +231,7 @@ proto-image: setup-builder ############################################################################### PROTO_IMAGE_NAME := juno-protobuilder:latest -PROTO_IMAGE := $(DOCKER) run --rm -v "$(CURDIR)":/workspace --workdir /workspace $(PROTO_IMAGE_NAME) +PROTO_IMAGE := $(DOCKER) run --rm --user $(shell id -u):$(shell id -g) -e HOME=/tmp -v "$(CURDIR)":/workspace --workdir /workspace $(PROTO_IMAGE_NAME) proto-all: proto-check proto-gen proto-gen: proto-gogo proto-pulsar proto-openapi @@ -254,17 +254,17 @@ proto-openapi: proto-format: @echo "🖊️ Formatting Protobuffers" - @$(PROTO_IMAGE) buf format ./proto --error-format=json + @$(PROTO_IMAGE) go tool buf format ./proto --error-format=json @echo "✅ Formatted Protobuffers successfully!" proto-lint: @echo "🔎 Linting Protobuffers" - @$(PROTO_IMAGE) buf lint --error-format=json + @$(PROTO_IMAGE) go tool buf lint --error-format=json @echo "✅ Linted Protobuffers successfully!" proto-breaking: @echo "🔎 Checking breaking Protobuffers changes against branch main" - @$(PROTO_IMAGE) buf breaking ./proto --against $(HTTPS_GIT).git#branch=main + @$(PROTO_IMAGE) go tool buf breaking ./proto --against $(HTTPS_GIT).git#branch=main @echo "✅ Protobuffers are non-breaking, checked successfully!" .PHONY: proto-all proto-gen proto-check proto-format proto-lint proto-breaking proto-gogo proto-pulsar proto-openapi diff --git a/RELEASE-VERIFICATION.md b/RELEASE-VERIFICATION.md new file mode 100644 index 000000000..fb3647de8 --- /dev/null +++ b/RELEASE-VERIFICATION.md @@ -0,0 +1,58 @@ +# Verify and install a v31 release + +The workflow refuses to create a release when that tag already has one, but +GitHub releases and Git tags remain administratively mutable; do not treat that +check as a platform immutability guarantee. `SHA256SUMS` covers every attached +binary, archive, SBOM, provenance, container-digest report, and this guide. The +container report records the manifest-list digest and its `linux/amd64` and +`linux/arm64` child digests. GHCR receives no version or commit tag: the image +is published and consumed only as the content-addressed `image@sha256:...` +reference in that report. + +Set the release and architecture, download the files, and verify the selected +binary and archive **before** installing: + +```sh +VERSION=v31.0.0 +ARCH=amd64 # use arm64 on 64-bit ARM Linux +REPOSITORY=CosmosContracts/juno +mkdir "juno-$VERSION" && cd "juno-$VERSION" +gh release download "$VERSION" --repo "$REPOSITORY" +grep -E " (junod-linux-$ARCH|juno-$VERSION-linux-$ARCH.tar.gz)$" SHA256SUMS | sha256sum --check +tar --extract --gzip --file "juno-$VERSION-linux-$ARCH.tar.gz" +./"junod-linux-$ARCH" version --long +install -m 0755 "junod-linux-$ARCH" "$HOME/.local/bin/junod" +"$HOME/.local/bin/junod" version --long +``` + +The two `version --long` outputs must report the requested semantic version and +the full commit from `provenance.intoto.jsonl`. Independently inspect metadata: + +```sh +jq -r '.predicate.buildDefinition.externalParameters' provenance.intoto.jsonl +jq . container-digests.json +gh attestation verify "junod-linux-$ARCH" --repo "$REPOSITORY" +docker buildx imagetools inspect "$(jq -r .image container-digests.json)@$(jq -r .manifest_digest container-digests.json)" +``` + +Rebuilding uses the digest-pinned Go 1.25.10/Alpine 3.22 builder in +`release.Dockerfile`, `SOURCE_DATE_EPOCH` from the tagged commit, trimmed paths, +and an empty Go build ID. CI builds each binary in two independent cacheless +BuildKit builders, compares the binaries and dependency records, and creates +deterministic tar/gzip archives. Direct Alpine package versions are pinned and +the complete installed package set plus Go's embedded module build information +are attached and represented in SBOM/provenance. For a Go module replacement, +both the original requirement and the selected replacement recorded by +`go version -m` are represented. This is build metadata, not a license or +vulnerability-analysis guarantee. Alpine repositories and GitHub runner/QEMU +remain external availability dependencies. + +Publication spans services and is not transactional. A failed run can leave an +untagged, content-addressed GHCR manifest and attestations before the GitHub +release is created. Those objects cannot redirect an existing digest reference +and a retry may reuse the same digest. If `gh release create` creates a release +but an asset upload then fails, the workflow will refuse an automatic replay; +an operator must inspect the partial release and explicitly remove it before a +`workflow_dispatch` retry. Payload packaging, replacement mutation, metadata, +strict remote tag identity, and replay refusal are tested offline by +`scripts/release/test-release.sh`. diff --git a/RELEASES.md b/RELEASES.md index 361e99079..57ab65554 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -16,6 +16,14 @@ the ## Scheduled upgrade via governance +### v31 dependency compatibility + +The v31 binary is built with Go 1.25.10 and pins Cosmos SDK v0.53.8, +wasmd v0.61.14/wasmvm v3.0.7, CometBFT v0.38.25, and IBC-Go v10.7.0. +Packet-forward middleware remains at v10.6.0 and ibc-hooks at v10.0.0. +The SDK patch is state-breaking and must be activated through the coordinated +v31 upgrade; operators must not switch a running chain to this binary early. + For a SoftwareUpgradeProposal via governance: 1. Validators will be told via the announcements channel when the prop is live diff --git a/api/juno/clock/module/v1/module.pulsar.go b/api/juno/clock/module/v1/module.pulsar.go index 381363519..769d02984 100644 --- a/api/juno/clock/module/v1/module.pulsar.go +++ b/api/juno/clock/module/v1/module.pulsar.go @@ -497,7 +497,7 @@ var file_juno_clock_module_v1_module_proto_rawDesc = []byte{ 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x33, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2d, 0x0a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x76, 0x33, 0x30, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x76, 0x33, 0x31, 0x2f, 0x78, 0x2f, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x42, 0xca, 0x01, 0x0a, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, diff --git a/api/juno/clock/v1/genesis.pulsar.go b/api/juno/clock/v1/genesis.pulsar.go index 5eaaa2ac8..d21db8c26 100644 --- a/api/juno/clock/v1/genesis.pulsar.go +++ b/api/juno/clock/v1/genesis.pulsar.go @@ -452,12 +452,14 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { var ( md_Params protoreflect.MessageDescriptor fd_Params_contract_gas_limit protoreflect.FieldDescriptor + fd_Params_max_contracts protoreflect.FieldDescriptor ) func init() { file_juno_clock_v1_genesis_proto_init() md_Params = File_juno_clock_v1_genesis_proto.Messages().ByName("Params") fd_Params_contract_gas_limit = md_Params.Fields().ByName("contract_gas_limit") + fd_Params_max_contracts = md_Params.Fields().ByName("max_contracts") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -531,6 +533,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.MaxContracts != uint64(0) { + value := protoreflect.ValueOfUint64(x.MaxContracts) + if !f(fd_Params_max_contracts, value) { + return + } + } } // Has reports whether a field is populated. @@ -548,6 +556,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "juno.clock.v1.Params.contract_gas_limit": return x.ContractGasLimit != uint64(0) + case "juno.clock.v1.Params.max_contracts": + return x.MaxContracts != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.clock.v1.Params")) @@ -566,6 +576,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "juno.clock.v1.Params.contract_gas_limit": x.ContractGasLimit = uint64(0) + case "juno.clock.v1.Params.max_contracts": + x.MaxContracts = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.clock.v1.Params")) @@ -585,6 +597,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "juno.clock.v1.Params.contract_gas_limit": value := x.ContractGasLimit return protoreflect.ValueOfUint64(value) + case "juno.clock.v1.Params.max_contracts": + value := x.MaxContracts + return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.clock.v1.Params")) @@ -607,6 +622,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto switch fd.FullName() { case "juno.clock.v1.Params.contract_gas_limit": x.ContractGasLimit = value.Uint() + case "juno.clock.v1.Params.max_contracts": + x.MaxContracts = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.clock.v1.Params")) @@ -629,6 +646,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore switch fd.FullName() { case "juno.clock.v1.Params.contract_gas_limit": panic(fmt.Errorf("field contract_gas_limit of message juno.clock.v1.Params is not mutable")) + case "juno.clock.v1.Params.max_contracts": + panic(fmt.Errorf("field max_contracts of message juno.clock.v1.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.clock.v1.Params")) @@ -644,6 +663,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor switch fd.FullName() { case "juno.clock.v1.Params.contract_gas_limit": return protoreflect.ValueOfUint64(uint64(0)) + case "juno.clock.v1.Params.max_contracts": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.clock.v1.Params")) @@ -716,6 +737,9 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if x.ContractGasLimit != 0 { n += 1 + runtime.Sov(uint64(x.ContractGasLimit)) } + if x.MaxContracts != 0 { + n += 1 + runtime.Sov(uint64(x.MaxContracts)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -745,6 +769,11 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.MaxContracts != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxContracts)) + i-- + dAtA[i] = 0x10 + } if x.ContractGasLimit != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.ContractGasLimit)) i-- @@ -818,6 +847,25 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { break } } + case 2: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxContracts", wireType) + } + x.MaxContracts = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.MaxContracts |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -911,6 +959,10 @@ type Params struct { // contract_gas_limit defines the maximum amount of gas that can be used by a contract. ContractGasLimit uint64 `protobuf:"varint,1,opt,name=contract_gas_limit,json=contractGasLimit,proto3" json:"contract_gas_limit,omitempty"` + // max_contracts caps the number of registered clock contracts, bounding + // per-block EndBlock sudo work so registration cannot be used to inflate + // block time. + MaxContracts uint64 `protobuf:"varint,2,opt,name=max_contracts,json=maxContracts,proto3" json:"max_contracts,omitempty"` } func (x *Params) Reset() { @@ -940,6 +992,13 @@ func (x *Params) GetContractGasLimit() uint64 { return 0 } +func (x *Params) GetMaxContracts() uint64 { + if x != nil { + return x.MaxContracts + } + return 0 +} + var File_juno_clock_v1_genesis_proto protoreflect.FileDescriptor var file_juno_clock_v1_genesis_proto_rawDesc = []byte{ @@ -953,21 +1012,23 @@ var file_juno_clock_v1_genesis_proto_rawDesc = []byte{ 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, - 0x3c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6e, + 0x61, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x47, - 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x42, 0x9f, 0x01, - 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, - 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x6f, 0x63, 0x6b, - 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4a, 0x43, - 0x58, 0xaa, 0x02, 0x0d, 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x56, - 0x31, 0xca, 0x02, 0x0d, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x5c, 0x56, - 0x31, 0xe2, 0x02, 0x19, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, - 0x4a, 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, + 0x6d, 0x61, 0x78, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x3a, 0x04, 0xe8, 0xa0, + 0x1f, 0x01, 0x42, 0x9f, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, + 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, + 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, + 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x4a, 0x43, 0x58, 0xaa, 0x02, 0x0d, 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x43, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x6c, + 0x6f, 0x63, 0x6b, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x6c, + 0x6f, 0x63, 0x6b, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x0f, 0x4a, 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x63, 0x6b, + 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/juno/clock/v1/tx.pulsar.go b/api/juno/clock/v1/tx.pulsar.go index 56ca05447..8534d6722 100644 --- a/api/juno/clock/v1/tx.pulsar.go +++ b/api/juno/clock/v1/tx.pulsar.go @@ -8,7 +8,6 @@ import ( _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -3714,113 +3713,111 @@ var file_juno_clock_v1_tx_proto_rawDesc = []byte{ 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, - 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1b, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x76, - 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xe7, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, - 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x3f, 0x0a, 0x0e, - 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, - 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, - 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x3a, 0x45, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, - 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, - 0xe7, 0xb0, 0x2a, 0x25, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x63, 0x6c, 0x6f, 0x63, 0x6b, - 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, - 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x22, 0x0a, 0x20, 0x4d, 0x73, 0x67, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xeb, 0x01, - 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, - 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x3f, 0x0a, 0x0e, - 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, - 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, - 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x3a, 0x47, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, - 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, - 0xe7, 0xb0, 0x2a, 0x27, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x63, 0x6c, 0x6f, 0x63, 0x6b, - 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, - 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x24, 0x0a, 0x22, 0x4d, - 0x73, 0x67, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, - 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0xe3, 0x01, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x43, - 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x3f, 0x0a, 0x0e, - 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, - 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, - 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x3a, 0x43, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, - 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, - 0xe7, 0xb0, 0x2a, 0x23, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x63, 0x6c, 0x6f, 0x63, 0x6b, - 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x20, 0x0a, 0x1e, 0x4d, 0x73, 0x67, 0x55, 0x6e, - 0x6a, 0x61, 0x69, 0x6c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xbc, 0x01, 0x0a, 0x0f, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, - 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, - 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x38, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, - 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, - 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, - 0x37, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x6a, 0x75, 0x6e, 0x6f, - 0x2f, 0x78, 0x2f, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0xbd, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x71, 0x0a, 0x15, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, - 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x1a, 0x2f, 0x2e, - 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x77, - 0x0a, 0x17, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, - 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x29, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, - 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x72, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x1a, 0x31, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, - 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x13, 0x55, 0x6e, 0x6a, 0x61, 0x69, - 0x6c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x25, - 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x1a, 0x2d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, - 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x43, - 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, - 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x26, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, - 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, - 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, - 0xb0, 0x2a, 0x01, 0x42, 0x9a, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, - 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x6f, 0x63, - 0x6b, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4a, - 0x43, 0x58, 0xaa, 0x02, 0x0d, 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, - 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x5c, - 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x5c, - 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, - 0x0f, 0x4a, 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x3a, 0x3a, 0x56, 0x31, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, 0x6f, 0x63, 0x6b, + 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xe7, 0x01, 0x0a, 0x18, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x3f, + 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x43, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x3a, 0x45, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, + 0xb0, 0x2a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x25, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x63, 0x6c, 0x6f, + 0x63, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, + 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x22, 0x0a, 0x20, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0xeb, 0x01, 0x0a, 0x1a, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x3f, + 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x43, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x3a, 0x47, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, + 0xb0, 0x2a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x27, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x63, 0x6c, 0x6f, + 0x63, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, + 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x24, 0x0a, + 0x22, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, + 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0xe3, 0x01, 0x0a, 0x16, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, + 0x6c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x3f, + 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x43, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x3a, 0x43, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, + 0xb0, 0x2a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x23, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x63, 0x6c, 0x6f, + 0x63, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x43, 0x6c, 0x6f, 0x63, + 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x20, 0x0a, 0x1e, 0x4d, 0x73, 0x67, + 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xbc, 0x01, 0x0a, 0x0f, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, + 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x38, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, + 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, + 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x3a, 0x37, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1c, 0x6a, 0x75, + 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xbd, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x71, 0x0a, + 0x15, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x1a, + 0x2f, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x77, 0x0a, 0x17, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, + 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x29, 0x2e, 0x6a, 0x75, + 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, + 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x1a, 0x31, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x13, 0x55, 0x6e, 0x6a, + 0x61, 0x69, 0x6c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x12, 0x25, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, 0x6c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x1a, 0x2d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, + 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x6a, 0x61, 0x69, + 0x6c, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x26, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x6c, + 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, + 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x9a, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, + 0x6e, 0x6f, 0x2e, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x63, 0x6c, + 0x6f, 0x63, 0x6b, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6c, 0x6f, 0x63, 0x6b, 0x76, 0x31, 0xa2, 0x02, + 0x03, 0x4a, 0x43, 0x58, 0xaa, 0x02, 0x0d, 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x43, 0x6c, 0x6f, 0x63, + 0x6b, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x6c, 0x6f, 0x63, + 0x6b, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x6c, 0x6f, 0x63, + 0x6b, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x0f, 0x4a, 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x43, 0x6c, 0x6f, 0x63, 0x6b, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/juno/cwhooks/module/v2/module.pulsar.go b/api/juno/cwhooks/module/v2/module.pulsar.go index 48f9173bf..ff121e0f6 100644 --- a/api/juno/cwhooks/module/v2/module.pulsar.go +++ b/api/juno/cwhooks/module/v2/module.pulsar.go @@ -493,26 +493,26 @@ var file_juno_cwhooks_module_v2_module_proto_rawDesc = []byte{ 0x6f, 0x6b, 0x73, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x32, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0x5d, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, + 0x5e, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x35, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2f, 0x0a, - 0x2d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x73, 0x6d, + 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x36, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x30, 0x0a, + 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, - 0x2f, 0x76, 0x33, 0x30, 0x2f, 0x78, 0x2f, 0x63, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x42, 0xd6, - 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x77, 0x68, 0x6f, - 0x6f, 0x6b, 0x73, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0b, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, - 0x75, 0x6e, 0x6f, 0x2f, 0x63, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x6d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x32, 0xa2, 0x02, - 0x03, 0x4a, 0x43, 0x4d, 0xaa, 0x02, 0x16, 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x43, 0x77, 0x68, 0x6f, - 0x6f, 0x6b, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x16, - 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x5c, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x22, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x77, - 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x32, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x4a, 0x75, - 0x6e, 0x6f, 0x3a, 0x3a, 0x43, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, - 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x2f, 0x76, 0x33, 0x31, 0x2f, 0x78, 0x2f, 0x63, 0x77, 0x2d, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x42, + 0xd6, 0x01, 0x0a, 0x1a, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x77, 0x68, + 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x32, 0x42, 0x0b, + 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x30, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x63, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x6d, 0x6f, 0x64, + 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x32, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x32, 0xa2, + 0x02, 0x03, 0x4a, 0x43, 0x4d, 0xaa, 0x02, 0x16, 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x43, 0x77, 0x68, + 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x32, 0xca, 0x02, + 0x16, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x5c, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x22, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, + 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x32, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x19, 0x4a, + 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x43, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x3a, 0x3a, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/juno/cwhooks/v2/genesis.pulsar.go b/api/juno/cwhooks/v2/genesis.pulsar.go index 5e53c14df..b40997795 100644 --- a/api/juno/cwhooks/v2/genesis.pulsar.go +++ b/api/juno/cwhooks/v2/genesis.pulsar.go @@ -729,6 +729,7 @@ var ( md_Params protoreflect.MessageDescriptor fd_Params_contract_gas_limit protoreflect.FieldDescriptor fd_Params_contract_failure_removal_threshold protoreflect.FieldDescriptor + fd_Params_max_contracts protoreflect.FieldDescriptor ) func init() { @@ -736,6 +737,7 @@ func init() { md_Params = File_juno_cwhooks_v2_genesis_proto.Messages().ByName("Params") fd_Params_contract_gas_limit = md_Params.Fields().ByName("contract_gas_limit") fd_Params_contract_failure_removal_threshold = md_Params.Fields().ByName("contract_failure_removal_threshold") + fd_Params_max_contracts = md_Params.Fields().ByName("max_contracts") } var _ protoreflect.Message = (*fastReflection_Params)(nil) @@ -815,6 +817,12 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.MaxContracts != uint64(0) { + value := protoreflect.ValueOfUint64(x.MaxContracts) + if !f(fd_Params_max_contracts, value) { + return + } + } } // Has reports whether a field is populated. @@ -834,6 +842,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.ContractGasLimit != uint64(0) case "juno.cwhooks.v2.Params.contract_failure_removal_threshold": return x.ContractFailureRemovalThreshold != uint64(0) + case "juno.cwhooks.v2.Params.max_contracts": + return x.MaxContracts != uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.cwhooks.v2.Params")) @@ -854,6 +864,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.ContractGasLimit = uint64(0) case "juno.cwhooks.v2.Params.contract_failure_removal_threshold": x.ContractFailureRemovalThreshold = uint64(0) + case "juno.cwhooks.v2.Params.max_contracts": + x.MaxContracts = uint64(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.cwhooks.v2.Params")) @@ -876,6 +888,9 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "juno.cwhooks.v2.Params.contract_failure_removal_threshold": value := x.ContractFailureRemovalThreshold return protoreflect.ValueOfUint64(value) + case "juno.cwhooks.v2.Params.max_contracts": + value := x.MaxContracts + return protoreflect.ValueOfUint64(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.cwhooks.v2.Params")) @@ -900,6 +915,8 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.ContractGasLimit = value.Uint() case "juno.cwhooks.v2.Params.contract_failure_removal_threshold": x.ContractFailureRemovalThreshold = value.Uint() + case "juno.cwhooks.v2.Params.max_contracts": + x.MaxContracts = value.Uint() default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.cwhooks.v2.Params")) @@ -924,6 +941,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field contract_gas_limit of message juno.cwhooks.v2.Params is not mutable")) case "juno.cwhooks.v2.Params.contract_failure_removal_threshold": panic(fmt.Errorf("field contract_failure_removal_threshold of message juno.cwhooks.v2.Params is not mutable")) + case "juno.cwhooks.v2.Params.max_contracts": + panic(fmt.Errorf("field max_contracts of message juno.cwhooks.v2.Params is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.cwhooks.v2.Params")) @@ -941,6 +960,8 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfUint64(uint64(0)) case "juno.cwhooks.v2.Params.contract_failure_removal_threshold": return protoreflect.ValueOfUint64(uint64(0)) + case "juno.cwhooks.v2.Params.max_contracts": + return protoreflect.ValueOfUint64(uint64(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.cwhooks.v2.Params")) @@ -1016,6 +1037,9 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if x.ContractFailureRemovalThreshold != 0 { n += 1 + runtime.Sov(uint64(x.ContractFailureRemovalThreshold)) } + if x.MaxContracts != 0 { + n += 1 + runtime.Sov(uint64(x.MaxContracts)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1045,6 +1069,11 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.MaxContracts != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.MaxContracts)) + i-- + dAtA[i] = 0x18 + } if x.ContractFailureRemovalThreshold != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.ContractFailureRemovalThreshold)) i-- @@ -1142,6 +1171,25 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { break } } + case 3: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field MaxContracts", wireType) + } + x.MaxContracts = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + x.MaxContracts |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1255,6 +1303,10 @@ type Params struct { ContractGasLimit uint64 `protobuf:"varint,1,opt,name=contract_gas_limit,json=contractGasLimit,proto3" json:"contract_gas_limit,omitempty"` // contract_failure_removal_threshold is the threshold for removing a contract after consecutive failures ContractFailureRemovalThreshold uint64 `protobuf:"varint,2,opt,name=contract_failure_removal_threshold,json=contractFailureRemovalThreshold,proto3" json:"contract_failure_removal_threshold,omitempty"` + // max_contracts caps the number of registered contracts per hook module, + // bounding per-hook sudo work so registration cannot be used to inflate + // block time. + MaxContracts uint64 `protobuf:"varint,3,opt,name=max_contracts,json=maxContracts,proto3" json:"max_contracts,omitempty"` } func (x *Params) Reset() { @@ -1291,6 +1343,13 @@ func (x *Params) GetContractFailureRemovalThreshold() uint64 { return 0 } +func (x *Params) GetMaxContracts() uint64 { + if x != nil { + return x.MaxContracts + } + return 0 +} + var File_juno_cwhooks_v2_genesis_proto protoreflect.FileDescriptor var file_juno_cwhooks_v2_genesis_proto_rawDesc = []byte{ @@ -1318,7 +1377,7 @@ var file_juno_cwhooks_v2_genesis_proto_rawDesc = []byte{ 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x76, 0x32, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x14, 0x67, 0x6f, 0x76, 0x43, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x89, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0xae, 0x01, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x47, @@ -1327,19 +1386,21 @@ var file_juno_cwhooks_v2_genesis_proto_rawDesc = []byte{ 0x76, 0x61, 0x6c, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x1f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x46, 0x61, 0x69, 0x6c, 0x75, 0x72, 0x65, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x61, 0x6c, 0x54, 0x68, 0x72, 0x65, 0x73, - 0x68, 0x6f, 0x6c, 0x64, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x42, 0xad, 0x01, 0x0a, 0x13, 0x63, - 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2e, - 0x76, 0x32, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x63, 0x77, 0x68, 0x6f, 0x6f, 0x6b, - 0x73, 0x2f, 0x76, 0x32, 0x3b, 0x63, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x76, 0x32, 0xa2, 0x02, - 0x03, 0x4a, 0x43, 0x58, 0xaa, 0x02, 0x0f, 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x43, 0x77, 0x68, 0x6f, - 0x6f, 0x6b, 0x73, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x77, - 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x1b, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, - 0x43, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x5c, 0x56, 0x32, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, - 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x4a, 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x43, - 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x3a, 0x3a, 0x56, 0x32, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, + 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x23, 0x0a, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x6d, 0x61, 0x78, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x42, + 0xad, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x63, 0x77, 0x68, + 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x76, 0x32, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, + 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x63, + 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2f, 0x76, 0x32, 0x3b, 0x63, 0x77, 0x68, 0x6f, 0x6f, 0x6b, + 0x73, 0x76, 0x32, 0xa2, 0x02, 0x03, 0x4a, 0x43, 0x58, 0xaa, 0x02, 0x0f, 0x4a, 0x75, 0x6e, 0x6f, + 0x2e, 0x43, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x2e, 0x56, 0x32, 0xca, 0x02, 0x0f, 0x4a, 0x75, + 0x6e, 0x6f, 0x5c, 0x43, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x5c, 0x56, 0x32, 0xe2, 0x02, 0x1b, + 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x43, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x5c, 0x56, 0x32, 0x5c, + 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x4a, 0x75, + 0x6e, 0x6f, 0x3a, 0x3a, 0x43, 0x77, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x3a, 0x3a, 0x56, 0x32, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/juno/drip/module/v1/module.pulsar.go b/api/juno/drip/module/v1/module.pulsar.go index dd6c0d185..811bca47e 100644 --- a/api/juno/drip/module/v1/module.pulsar.go +++ b/api/juno/drip/module/v1/module.pulsar.go @@ -497,7 +497,7 @@ var file_juno_drip_module_v1_module_proto_rawDesc = []byte{ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x32, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2c, 0x0a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x76, 0x33, 0x30, 0x2f, 0x78, + 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x76, 0x33, 0x31, 0x2f, 0x78, 0x2f, 0x64, 0x72, 0x69, 0x70, 0x42, 0xc4, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x64, 0x72, 0x69, 0x70, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, diff --git a/api/juno/drip/v1/tx.pulsar.go b/api/juno/drip/v1/tx.pulsar.go index 6c1983eaf..6591ae67c 100644 --- a/api/juno/drip/v1/tx.pulsar.go +++ b/api/juno/drip/v1/tx.pulsar.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -1962,65 +1961,63 @@ var file_juno_drip_v1_tx_proto_rawDesc = []byte{ 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, - 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x1a, 0x1a, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x64, 0x72, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x2f, 0x67, - 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x02, 0x0a, - 0x13, 0x4d, 0x73, 0x67, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, - 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, - 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, - 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, - 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, - 0x3a, 0x3b, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x1f, 0x6a, 0x75, - 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x64, 0x72, 0x69, 0x70, 0x2f, 0x4d, 0x73, 0x67, 0x44, 0x69, 0x73, - 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x22, 0x1d, 0x0a, - 0x1b, 0x4d, 0x73, 0x67, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x54, 0x6f, - 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xba, 0x01, 0x0a, - 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, - 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x37, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, - 0x64, 0x72, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, - 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x3a, 0x36, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, - 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1b, 0x6a, 0x75, - 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x64, 0x72, 0x69, 0x70, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xc4, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, 0x0a, 0x10, - 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, - 0x12, 0x21, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x64, 0x72, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x73, 0x1a, 0x29, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x64, 0x72, 0x69, 0x70, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x54, - 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1d, - 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x64, 0x72, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x25, 0x2e, - 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x64, 0x72, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x93, 0x01, 0x0a, 0x10, - 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x64, 0x72, 0x69, 0x70, 0x2e, 0x76, 0x31, - 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, 0x75, - 0x6e, 0x6f, 0x2f, 0x64, 0x72, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x72, 0x69, 0x70, 0x76, - 0x31, 0xa2, 0x02, 0x03, 0x4a, 0x44, 0x58, 0xaa, 0x02, 0x0c, 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x44, - 0x72, 0x69, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x44, 0x72, - 0x69, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x44, 0x72, 0x69, - 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x0e, 0x4a, 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x44, 0x72, 0x69, 0x70, 0x3a, 0x3a, 0x56, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x6f, 0x1a, 0x1a, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x64, 0x72, 0x69, 0x70, 0x2f, 0x76, 0x31, + 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, + 0x02, 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, + 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, + 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, + 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x3a, 0x3b, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x1f, + 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x64, 0x72, 0x69, 0x70, 0x2f, 0x4d, 0x73, 0x67, 0x44, + 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x22, + 0x1d, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, + 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xba, + 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, + 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x37, 0x0a, 0x06, 0x70, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6a, 0x75, 0x6e, + 0x6f, 0x2e, 0x64, 0x72, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, + 0x61, 0x6d, 0x73, 0x3a, 0x36, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, + 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1b, + 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x64, 0x72, 0x69, 0x70, 0x2f, 0x4d, 0x73, 0x67, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xc4, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x60, + 0x0a, 0x10, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, + 0x6e, 0x73, 0x12, 0x21, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x64, 0x72, 0x69, 0x70, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x54, + 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x1a, 0x29, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x64, 0x72, 0x69, + 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x69, 0x73, 0x74, 0x72, 0x69, 0x62, 0x75, + 0x74, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x54, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x1d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x64, 0x72, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, + 0x25, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x64, 0x72, 0x69, 0x70, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x93, 0x01, + 0x0a, 0x10, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x64, 0x72, 0x69, 0x70, 0x2e, + 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x24, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x64, 0x72, 0x69, 0x70, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x72, 0x69, + 0x70, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4a, 0x44, 0x58, 0xaa, 0x02, 0x0c, 0x4a, 0x75, 0x6e, 0x6f, + 0x2e, 0x44, 0x72, 0x69, 0x70, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0c, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, + 0x44, 0x72, 0x69, 0x70, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x18, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x44, + 0x72, 0x69, 0x70, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, + 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4a, 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x44, 0x72, 0x69, 0x70, 0x3a, + 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/juno/feemarket/module/v1/module.pulsar.go b/api/juno/feemarket/module/v1/module.pulsar.go index bdbea5128..daa8bea62 100644 --- a/api/juno/feemarket/module/v1/module.pulsar.go +++ b/api/juno/feemarket/module/v1/module.pulsar.go @@ -498,7 +498,7 @@ var file_juno_feemarket_module_v1_module_proto_rawDesc = []byte{ 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x37, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x31, 0x0a, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, - 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x76, 0x33, 0x30, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, + 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x76, 0x33, 0x31, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x42, 0xe2, 0x01, 0x0a, 0x1c, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x65, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, diff --git a/api/juno/feepay/module/v1/module.pulsar.go b/api/juno/feepay/module/v1/module.pulsar.go index 6c8e8f419..1013bb420 100644 --- a/api/juno/feepay/module/v1/module.pulsar.go +++ b/api/juno/feepay/module/v1/module.pulsar.go @@ -498,7 +498,7 @@ var file_juno_feepay_module_v1_module_proto_rawDesc = []byte{ 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x34, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2e, 0x0a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x76, - 0x33, 0x30, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x42, 0xd0, 0x01, 0x0a, 0x19, + 0x33, 0x31, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x42, 0xd0, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, diff --git a/api/juno/feepay/v1/genesis.pulsar.go b/api/juno/feepay/v1/genesis.pulsar.go index 9619b77af..ca4a1d291 100644 --- a/api/juno/feepay/v1/genesis.pulsar.go +++ b/api/juno/feepay/v1/genesis.pulsar.go @@ -65,10 +65,62 @@ func (x *_GenesisState_2_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_GenesisState_3_list)(nil) + +type _GenesisState_3_list struct { + list *[]*FeePayWalletUsage +} + +func (x *_GenesisState_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_GenesisState_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_GenesisState_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*FeePayWalletUsage) + (*x.list)[i] = concreteValue +} + +func (x *_GenesisState_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*FeePayWalletUsage) + *x.list = append(*x.list, concreteValue) +} + +func (x *_GenesisState_3_list) AppendMutable() protoreflect.Value { + v := new(FeePayWalletUsage) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_GenesisState_3_list) NewElement() protoreflect.Value { + v := new(FeePayWalletUsage) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_GenesisState_3_list) IsValid() bool { + return x.list != nil +} + var ( md_GenesisState protoreflect.MessageDescriptor fd_GenesisState_params protoreflect.FieldDescriptor fd_GenesisState_fee_pay_contracts protoreflect.FieldDescriptor + fd_GenesisState_wallet_usages protoreflect.FieldDescriptor ) func init() { @@ -76,6 +128,7 @@ func init() { md_GenesisState = File_juno_feepay_v1_genesis_proto.Messages().ByName("GenesisState") fd_GenesisState_params = md_GenesisState.Fields().ByName("params") fd_GenesisState_fee_pay_contracts = md_GenesisState.Fields().ByName("fee_pay_contracts") + fd_GenesisState_wallet_usages = md_GenesisState.Fields().ByName("wallet_usages") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -155,6 +208,12 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } + if len(x.WalletUsages) != 0 { + value := protoreflect.ValueOfList(&_GenesisState_3_list{list: &x.WalletUsages}) + if !f(fd_GenesisState_wallet_usages, value) { + return + } + } } // Has reports whether a field is populated. @@ -174,6 +233,8 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool return x.Params != nil case "juno.feepay.v1.GenesisState.fee_pay_contracts": return len(x.FeePayContracts) != 0 + case "juno.feepay.v1.GenesisState.wallet_usages": + return len(x.WalletUsages) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.feepay.v1.GenesisState")) @@ -194,6 +255,8 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { x.Params = nil case "juno.feepay.v1.GenesisState.fee_pay_contracts": x.FeePayContracts = nil + case "juno.feepay.v1.GenesisState.wallet_usages": + x.WalletUsages = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.feepay.v1.GenesisState")) @@ -219,6 +282,12 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto } listValue := &_GenesisState_2_list{list: &x.FeePayContracts} return protoreflect.ValueOfList(listValue) + case "juno.feepay.v1.GenesisState.wallet_usages": + if len(x.WalletUsages) == 0 { + return protoreflect.ValueOfList(&_GenesisState_3_list{}) + } + listValue := &_GenesisState_3_list{list: &x.WalletUsages} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.feepay.v1.GenesisState")) @@ -245,6 +314,10 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value lv := value.List() clv := lv.(*_GenesisState_2_list) x.FeePayContracts = *clv.list + case "juno.feepay.v1.GenesisState.wallet_usages": + lv := value.List() + clv := lv.(*_GenesisState_3_list) + x.WalletUsages = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.feepay.v1.GenesisState")) @@ -276,6 +349,12 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p } value := &_GenesisState_2_list{list: &x.FeePayContracts} return protoreflect.ValueOfList(value) + case "juno.feepay.v1.GenesisState.wallet_usages": + if x.WalletUsages == nil { + x.WalletUsages = []*FeePayWalletUsage{} + } + value := &_GenesisState_3_list{list: &x.WalletUsages} + return protoreflect.ValueOfList(value) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.feepay.v1.GenesisState")) @@ -295,6 +374,9 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "juno.feepay.v1.GenesisState.fee_pay_contracts": list := []*FeePayContract{} return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list}) + case "juno.feepay.v1.GenesisState.wallet_usages": + list := []*FeePayWalletUsage{} + return protoreflect.ValueOfList(&_GenesisState_3_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: juno.feepay.v1.GenesisState")) @@ -374,6 +456,12 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } + if len(x.WalletUsages) > 0 { + for _, e := range x.WalletUsages { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -403,6 +491,22 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.WalletUsages) > 0 { + for iNdEx := len(x.WalletUsages) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.WalletUsages[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x1a + } + } if len(x.FeePayContracts) > 0 { for iNdEx := len(x.FeePayContracts) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.FeePayContracts[iNdEx]) @@ -552,6 +656,40 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field WalletUsages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.WalletUsages = append(x.WalletUsages, &FeePayWalletUsage{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.WalletUsages[len(x.WalletUsages)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1020,6 +1158,8 @@ type GenesisState struct { Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` // fee_pay_contracts are the feepay module contracts FeePayContracts []*FeePayContract `protobuf:"bytes,2,rep,name=fee_pay_contracts,json=feePayContracts,proto3" json:"fee_pay_contracts,omitempty"` + // wallet_usages are the per-contract wallet counters that enforce wallet limits. + WalletUsages []*FeePayWalletUsage `protobuf:"bytes,3,rep,name=wallet_usages,json=walletUsages,proto3" json:"wallet_usages,omitempty"` } func (x *GenesisState) Reset() { @@ -1056,6 +1196,13 @@ func (x *GenesisState) GetFeePayContracts() []*FeePayContract { return nil } +func (x *GenesisState) GetWalletUsages() []*FeePayWalletUsage { + if x != nil { + return x.WalletUsages + } + return nil +} + // Params defines the feepay module params type Params struct { state protoimpl.MessageState @@ -1103,7 +1250,7 @@ var file_juno_feepay_v1_genesis_proto_rawDesc = []byte{ 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa0, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, + 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xf3, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, @@ -1113,21 +1260,26 @@ var file_juno_feepay_v1_genesis_proto_rawDesc = []byte{ 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0f, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x22, 0x33, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x66, 0x65, 0x65, 0x70, - 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, - 0x46, 0x65, 0x65, 0x70, 0x61, 0x79, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x42, 0xa6, 0x01, 0x0a, - 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, - 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, - 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, - 0x79, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x76, 0x31, 0xa2, 0x02, 0x03, - 0x4a, 0x46, 0x58, 0xaa, 0x02, 0x0e, 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x46, 0x65, 0x65, 0x70, 0x61, - 0x79, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x46, 0x65, 0x65, 0x70, - 0x61, 0x79, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x46, 0x65, 0x65, - 0x70, 0x61, 0x79, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x10, 0x4a, 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x70, 0x61, - 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x12, 0x51, 0x0a, 0x0d, 0x77, 0x61, 0x6c, 0x6c, 0x65, + 0x74, 0x5f, 0x75, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, + 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, + 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x55, 0x73, 0x61, 0x67, + 0x65, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0c, 0x77, 0x61, + 0x6c, 0x6c, 0x65, 0x74, 0x55, 0x73, 0x61, 0x67, 0x65, 0x73, 0x22, 0x33, 0x0a, 0x06, 0x50, 0x61, + 0x72, 0x61, 0x6d, 0x73, 0x12, 0x23, 0x0a, 0x0d, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x66, + 0x65, 0x65, 0x70, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x65, 0x6e, 0x61, + 0x62, 0x6c, 0x65, 0x46, 0x65, 0x65, 0x70, 0x61, 0x79, 0x3a, 0x04, 0xe8, 0xa0, 0x1f, 0x01, 0x42, + 0xa6, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, + 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x66, 0x65, + 0x65, 0x70, 0x61, 0x79, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x4a, 0x46, 0x58, 0xaa, 0x02, 0x0e, 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x46, 0x65, + 0x65, 0x70, 0x61, 0x79, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x46, + 0x65, 0x65, 0x70, 0x61, 0x79, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1a, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, + 0x46, 0x65, 0x65, 0x70, 0x61, 0x79, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x4a, 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x46, 0x65, + 0x65, 0x70, 0x61, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1144,18 +1296,20 @@ func file_juno_feepay_v1_genesis_proto_rawDescGZIP() []byte { var file_juno_feepay_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo, 2) var file_juno_feepay_v1_genesis_proto_goTypes = []interface{}{ - (*GenesisState)(nil), // 0: juno.feepay.v1.GenesisState - (*Params)(nil), // 1: juno.feepay.v1.Params - (*FeePayContract)(nil), // 2: juno.feepay.v1.FeePayContract + (*GenesisState)(nil), // 0: juno.feepay.v1.GenesisState + (*Params)(nil), // 1: juno.feepay.v1.Params + (*FeePayContract)(nil), // 2: juno.feepay.v1.FeePayContract + (*FeePayWalletUsage)(nil), // 3: juno.feepay.v1.FeePayWalletUsage } var file_juno_feepay_v1_genesis_proto_depIdxs = []int32{ 1, // 0: juno.feepay.v1.GenesisState.params:type_name -> juno.feepay.v1.Params 2, // 1: juno.feepay.v1.GenesisState.fee_pay_contracts:type_name -> juno.feepay.v1.FeePayContract - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 3, // 2: juno.feepay.v1.GenesisState.wallet_usages:type_name -> juno.feepay.v1.FeePayWalletUsage + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_juno_feepay_v1_genesis_proto_init() } diff --git a/api/juno/feepay/v1/tx.pulsar.go b/api/juno/feepay/v1/tx.pulsar.go index 8831b064d..35a2e1131 100644 --- a/api/juno/feepay/v1/tx.pulsar.go +++ b/api/juno/feepay/v1/tx.pulsar.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -4846,48 +4845,29 @@ var file_juno_feepay_v1_tx_proto_rawDesc = []byte{ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, - 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, - 0x79, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x1a, 0x1c, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x76, - 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, - 0xef, 0x01, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, - 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x3f, 0x0a, - 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, - 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x48, - 0x0a, 0x10, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, - 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x0e, 0x66, 0x65, 0x65, 0x50, 0x61, 0x79, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x3a, 0x47, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, - 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x27, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, - 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x22, 0x23, 0x0a, 0x21, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xee, 0x01, 0x0a, 0x1b, 0x4d, 0x73, 0x67, 0x55, 0x6e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, - 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x49, 0x88, 0xa0, - 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x29, 0x6a, 0x75, - 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x4d, 0x73, 0x67, 0x55, - 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x25, 0x0a, 0x23, 0x4d, 0x73, 0x67, 0x55, 0x6e, - 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xdd, - 0x02, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x66, 0x65, 0x65, + 0x70, 0x61, 0x79, 0x2f, 0x76, 0x31, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, + 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x22, 0xef, 0x01, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, + 0x3f, 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x48, 0x0a, 0x10, 0x66, 0x65, 0x65, 0x5f, 0x70, 0x61, 0x79, 0x5f, 0x63, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x6a, 0x75, 0x6e, + 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x46, 0x65, 0x65, 0x50, + 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x0e, 0x66, 0x65, 0x65, 0x50, + 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x3a, 0x47, 0x88, 0xa0, 0x1f, 0x00, + 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x27, 0x6a, 0x75, 0x6e, 0x6f, + 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x22, 0x23, 0x0a, 0x21, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xee, 0x01, 0x0a, 0x1b, 0x4d, 0x73, 0x67, + 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, @@ -4896,105 +4876,122 @@ var file_juno_feepay_v1_tx_proto_rawDesc = []byte{ 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x63, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x79, - 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, - 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, - 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, - 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x43, 0x88, 0xa0, 0x1f, 0x00, 0xe8, - 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x23, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, - 0x78, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, - 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x1f, - 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x9f, 0x02, 0x0a, 0x22, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, - 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, - 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, - 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x63, 0x6f, 0x6e, - 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, - 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x0b, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x3a, - 0x50, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x65, - 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, - 0x30, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x22, 0x2c, 0x0a, 0x2a, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, - 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x57, 0x61, 0x6c, 0x6c, - 0x65, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0xbe, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x39, 0x0a, 0x06, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6a, 0x75, - 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, - 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x38, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, - 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, - 0xb0, 0x2a, 0x1d, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, - 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xdc, 0x04, 0x0a, 0x03, - 0x4d, 0x73, 0x67, 0x12, 0x76, 0x0a, 0x16, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, - 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x29, 0x2e, - 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, - 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x1a, 0x31, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, - 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, - 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7c, 0x0a, 0x18, 0x55, - 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, - 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x2b, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, - 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, - 0x72, 0x61, 0x63, 0x74, 0x1a, 0x33, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, - 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, - 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x46, 0x75, 0x6e, - 0x64, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, - 0x25, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x1a, 0x2d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, - 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x46, - 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x91, 0x01, 0x0a, 0x1f, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x49, + 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x65, 0x6e, + 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x29, + 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x4d, 0x73, + 0x67, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, + 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x22, 0x25, 0x0a, 0x23, 0x4d, 0x73, 0x67, + 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0xdd, 0x02, 0x0a, 0x15, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x46, 0x65, 0x65, 0x50, + 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x65, + 0x6e, 0x64, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x10, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, + 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x79, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, + 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x46, 0xc8, 0xde, 0x1f, + 0x00, 0xaa, 0xdf, 0x1f, 0x28, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, + 0x6b, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, 0xe7, 0xb0, + 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, + 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x3a, 0x43, 0x88, 0xa0, 0x1f, + 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, + 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x23, 0x6a, 0x75, 0x6e, + 0x6f, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x4d, 0x73, 0x67, 0x46, 0x75, + 0x6e, 0x64, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x22, 0x1f, 0x0a, 0x1d, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x46, 0x65, 0x65, 0x50, 0x61, + 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x9f, 0x02, 0x0a, 0x22, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, + 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x57, 0x61, 0x6c, + 0x6c, 0x65, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x3f, 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0d, 0x73, 0x65, 0x6e, 0x64, + 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x10, 0x63, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x63, + 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, + 0x0a, 0x0c, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4c, 0x69, 0x6d, 0x69, + 0x74, 0x3a, 0x50, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x0e, + 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, + 0xb0, 0x2a, 0x30, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, + 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x22, 0x2c, 0x0a, 0x2a, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x57, 0x61, - 0x6c, 0x6c, 0x65, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x32, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, - 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, - 0x63, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, 0x3a, 0x2e, - 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4c, 0x69, 0x6d, 0x69, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0c, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, - 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x27, 0x2e, 0x6a, 0x75, 0x6e, - 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa1, 0x01, 0x0a, 0x12, 0x63, - 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, - 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, - 0x75, 0x6e, 0x6f, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, - 0x65, 0x70, 0x61, 0x79, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4a, 0x46, 0x58, 0xaa, 0x02, 0x0e, 0x4a, - 0x75, 0x6e, 0x6f, 0x2e, 0x46, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0e, - 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x46, 0x65, 0x65, 0x70, 0x61, 0x79, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x1a, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x46, 0x65, 0x65, 0x70, 0x61, 0x79, 0x5c, 0x56, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, 0x4a, 0x75, - 0x6e, 0x6f, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x70, 0x61, 0x79, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x6c, 0x6c, 0x65, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0xbe, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, + 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x39, 0x0a, + 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, + 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, 0x38, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, + 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, + 0x8a, 0xe7, 0xb0, 0x2a, 0x1d, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x70, + 0x61, 0x79, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xdc, 0x04, + 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x76, 0x0a, 0x16, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, + 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, + 0x29, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, + 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x1a, 0x31, 0x2e, 0x6a, 0x75, 0x6e, + 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, + 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, + 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x7c, 0x0a, + 0x18, 0x55, 0x6e, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, + 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x12, 0x2b, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, + 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, + 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, + 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x1a, 0x33, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, + 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x6e, 0x72, 0x65, 0x67, + 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, + 0x61, 0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6a, 0x0a, 0x12, 0x46, + 0x75, 0x6e, 0x64, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, + 0x74, 0x12, 0x25, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, + 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, 0x64, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x1a, 0x2d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, + 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x46, 0x75, 0x6e, + 0x64, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x91, 0x01, 0x0a, 0x1f, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x32, 0x2e, 0x6a, 0x75, + 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, 0x43, 0x6f, 0x6e, 0x74, + 0x72, 0x61, 0x63, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x1a, + 0x3a, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x50, 0x61, 0x79, + 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x4c, 0x69, + 0x6d, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x58, 0x0a, 0x0c, 0x55, + 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1f, 0x2e, 0x6a, 0x75, + 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x27, 0x2e, 0x6a, + 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xa1, 0x01, 0x0a, + 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, + 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x28, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, + 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2f, 0x76, 0x31, 0x3b, + 0x66, 0x65, 0x65, 0x70, 0x61, 0x79, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4a, 0x46, 0x58, 0xaa, 0x02, + 0x0e, 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x46, 0x65, 0x65, 0x70, 0x61, 0x79, 0x2e, 0x56, 0x31, 0xca, + 0x02, 0x0e, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x46, 0x65, 0x65, 0x70, 0x61, 0x79, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x1a, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x46, 0x65, 0x65, 0x70, 0x61, 0x79, 0x5c, 0x56, + 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x10, + 0x4a, 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x70, 0x61, 0x79, 0x3a, 0x3a, 0x56, 0x31, + 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/juno/feeshare/module/v1/module.pulsar.go b/api/juno/feeshare/module/v1/module.pulsar.go index 243ce8b1c..9998186a8 100644 --- a/api/juno/feeshare/module/v1/module.pulsar.go +++ b/api/juno/feeshare/module/v1/module.pulsar.go @@ -498,7 +498,7 @@ var file_juno_feeshare_module_v1_module_proto_rawDesc = []byte{ 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x36, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x30, 0x0a, 0x2e, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, 0x6a, 0x75, - 0x6e, 0x6f, 0x2f, 0x76, 0x33, 0x30, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, + 0x6e, 0x6f, 0x2f, 0x76, 0x33, 0x31, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x42, 0xdc, 0x01, 0x0a, 0x1b, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, diff --git a/api/juno/feeshare/v1/tx.pulsar.go b/api/juno/feeshare/v1/tx.pulsar.go index 89f6c002c..67b752d3a 100644 --- a/api/juno/feeshare/v1/tx.pulsar.go +++ b/api/juno/feeshare/v1/tx.pulsar.go @@ -8,7 +8,6 @@ import ( _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" _ "github.com/cosmos/gogoproto/gogoproto" - _ "google.golang.org/genproto/googleapis/api/annotations" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" @@ -3863,120 +3862,119 @@ var file_juno_feeshare_v1_tx_proto_rawDesc = []byte{ 0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, - 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x66, - 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, 0x65, 0x73, - 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x02, 0x0a, 0x13, 0x4d, 0x73, 0x67, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, - 0x12, 0x43, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, - 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, - 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6c, 0x6f, - 0x79, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x47, 0x0a, 0x12, 0x77, 0x69, - 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x3a, 0x45, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, - 0x2a, 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x23, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x66, 0x65, - 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, - 0x65, 0x72, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x22, 0x1d, 0x0a, 0x1b, 0x4d, 0x73, - 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xab, 0x02, 0x0a, 0x11, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, - 0x43, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, - 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, - 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x47, 0x0a, 0x12, 0x77, 0x69, 0x74, - 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, - 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x3a, 0x43, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, - 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x21, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, - 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, - 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe2, 0x01, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, - 0x65, 0x6c, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x43, 0x0a, 0x10, 0x63, 0x6f, - 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x43, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x41, 0x64, 0x64, + 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x6a, 0x75, 0x6e, 0x6f, + 0x2f, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x65, 0x6e, + 0x65, 0x73, 0x69, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xaf, 0x02, 0x0a, 0x13, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, + 0x72, 0x65, 0x12, 0x43, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, + 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, + 0x79, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x64, 0x65, 0x70, + 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x47, 0x0a, 0x12, + 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, + 0x6e, 0x67, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x45, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, + 0xe7, 0xb0, 0x2a, 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x23, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, + 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, + 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x22, 0x1d, 0x0a, 0x1b, + 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x53, 0x68, + 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xab, 0x02, 0x0a, 0x11, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, + 0x65, 0x12, 0x43, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x43, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, + 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6c, + 0x6f, 0x79, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x47, 0x0a, 0x12, 0x77, + 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x11, 0x77, 0x69, 0x74, 0x68, 0x64, 0x72, 0x61, 0x77, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x43, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x21, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x66, - 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc2, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, - 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, 0xc8, 0xde, - 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x3a, - 0x3a, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, 0x61, 0x75, - 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1f, 0x6a, 0x75, 0x6e, 0x6f, - 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x4d, 0x73, 0x67, 0x55, - 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, 0x17, 0x4d, - 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x9c, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x68, - 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, - 0x72, 0x65, 0x12, 0x25, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, - 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x1a, 0x2d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, - 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x23, 0x2e, 0x6a, 0x75, 0x6e, - 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, - 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x1a, - 0x2b, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x53, - 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0e, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x23, - 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x46, 0x65, 0x65, 0x53, 0x68, - 0x61, 0x72, 0x65, 0x1a, 0x2b, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, - 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, - 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x5c, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x12, 0x21, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, - 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, - 0x61, 0x6d, 0x73, 0x1a, 0x29, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, - 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, - 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xaf, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, - 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x07, - 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, - 0x2f, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x66, 0x65, 0x65, - 0x73, 0x68, 0x61, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4a, 0x46, 0x58, 0xaa, 0x02, 0x10, - 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x46, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x56, 0x31, - 0xca, 0x02, 0x10, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x46, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, - 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x46, 0x65, 0x65, 0x73, 0x68, - 0x61, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x12, 0x4a, 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x46, 0x65, 0x65, 0x73, 0x68, - 0x61, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xe2, 0x01, 0x0a, 0x11, 0x4d, 0x73, 0x67, 0x43, 0x61, + 0x6e, 0x63, 0x65, 0x6c, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x43, 0x0a, 0x10, + 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x12, 0x43, 0x0a, 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x0f, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x3a, 0x43, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, + 0x82, 0xe7, 0xb0, 0x2a, 0x10, 0x64, 0x65, 0x70, 0x6c, 0x6f, 0x79, 0x65, 0x72, 0x5f, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x8a, 0xe7, 0xb0, 0x2a, 0x21, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x78, + 0x2f, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x22, 0x1b, 0x0a, 0x19, 0x4d, + 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0xc2, 0x01, 0x0a, 0x0f, 0x4d, 0x73, 0x67, + 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x36, 0x0a, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, + 0x72, 0x69, 0x74, 0x79, 0x12, 0x3b, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x09, + 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, + 0x73, 0x3a, 0x3a, 0x88, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x00, 0x82, 0xe7, 0xb0, 0x2a, 0x09, + 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x8a, 0xe7, 0xb0, 0x2a, 0x1f, 0x6a, 0x75, + 0x6e, 0x6f, 0x2f, 0x78, 0x2f, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x4d, 0x73, + 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x19, 0x0a, + 0x17, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x9c, 0x03, 0x0a, 0x03, 0x4d, 0x73, 0x67, + 0x12, 0x68, 0x0a, 0x10, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x53, + 0x68, 0x61, 0x72, 0x65, 0x12, 0x25, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, + 0x68, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x1a, 0x2d, 0x2e, 0x6a, 0x75, + 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, + 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x0e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x12, 0x23, 0x2e, 0x6a, + 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, + 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, + 0x65, 0x1a, 0x2b, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, + 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x46, 0x65, + 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, + 0x0a, 0x0e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, + 0x12, 0x23, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x46, 0x65, 0x65, + 0x53, 0x68, 0x61, 0x72, 0x65, 0x1a, 0x2b, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, + 0x65, 0x6c, 0x46, 0x65, 0x65, 0x53, 0x68, 0x61, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, + 0x6d, 0x73, 0x12, 0x21, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, + 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x29, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0xaf, 0x01, 0x0a, 0x14, 0x63, 0x6f, 0x6d, 0x2e, + 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, 0x76, 0x31, + 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x6a, 0x75, + 0x6e, 0x6f, 0x2f, 0x66, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x66, + 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4a, 0x46, 0x58, 0xaa, + 0x02, 0x10, 0x4a, 0x75, 0x6e, 0x6f, 0x2e, 0x46, 0x65, 0x65, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2e, + 0x56, 0x31, 0xca, 0x02, 0x10, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x46, 0x65, 0x65, 0x73, 0x68, 0x61, + 0x72, 0x65, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1c, 0x4a, 0x75, 0x6e, 0x6f, 0x5c, 0x46, 0x65, 0x65, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, + 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x12, 0x4a, 0x75, 0x6e, 0x6f, 0x3a, 0x3a, 0x46, 0x65, 0x65, + 0x73, 0x68, 0x61, 0x72, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( diff --git a/api/juno/mint/module/v1/module.pulsar.go b/api/juno/mint/module/v1/module.pulsar.go index db229b551..a73125501 100644 --- a/api/juno/mint/module/v1/module.pulsar.go +++ b/api/juno/mint/module/v1/module.pulsar.go @@ -572,7 +572,7 @@ var file_juno_mint_module_v1_module_proto_rawDesc = []byte{ 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x32, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2c, 0x0a, 0x2a, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, - 0x61, 0x63, 0x74, 0x73, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x76, 0x33, 0x30, 0x2f, 0x78, 0x2f, + 0x61, 0x63, 0x74, 0x73, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x76, 0x33, 0x31, 0x2f, 0x78, 0x2f, 0x6d, 0x69, 0x6e, 0x74, 0x42, 0xc4, 0x01, 0x0a, 0x17, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x6d, 0x69, 0x6e, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, diff --git a/api/juno/stream/module/v1/module.pulsar.go b/api/juno/stream/module/v1/module.pulsar.go index fecaf86e7..425dc8936 100644 --- a/api/juno/stream/module/v1/module.pulsar.go +++ b/api/juno/stream/module/v1/module.pulsar.go @@ -498,7 +498,7 @@ var file_juno_stream_module_v1_module_proto_rawDesc = []byte{ 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x34, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x2e, 0x0a, 0x2c, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, 0x2f, 0x76, - 0x33, 0x30, 0x2f, 0x78, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0xd0, 0x01, 0x0a, 0x19, + 0x33, 0x31, 0x2f, 0x78, 0x2f, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x42, 0xd0, 0x01, 0x0a, 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x6a, 0x75, 0x6e, 0x6f, 0x2e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, diff --git a/api/juno/votingsnapshot/v1/query.pulsar.go b/api/juno/votingsnapshot/v1/query.pulsar.go index 345d27902..30cdaacda 100644 --- a/api/juno/votingsnapshot/v1/query.pulsar.go +++ b/api/juno/votingsnapshot/v1/query.pulsar.go @@ -4008,6 +4008,7 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) +// QueryParamsRequest requests the current module parameters. type QueryParamsRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4034,6 +4035,7 @@ func (*QueryParamsRequest) Descriptor() ([]byte, []int) { return file_juno_votingsnapshot_v1_query_proto_rawDescGZIP(), []int{0} } +// QueryParamsResponse contains the current module parameters. type QueryParamsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4069,6 +4071,7 @@ func (x *QueryParamsResponse) GetParams() *Params { return nil } +// QueryVotingPowerAtRequest requests an address's voting power at a height. type QueryVotingPowerAtRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4115,6 +4118,7 @@ func (x *QueryVotingPowerAtRequest) GetAtHeight() int64 { return 0 } +// QueryVotingPowerAtResponse contains an address's voting power. type QueryVotingPowerAtResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4151,6 +4155,7 @@ func (x *QueryVotingPowerAtResponse) GetPower() string { return "" } +// QueryTotalVotingPowerAtRequest requests total voting power at a height. type QueryTotalVotingPowerAtRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4186,6 +4191,7 @@ func (x *QueryTotalVotingPowerAtRequest) GetAtHeight() int64 { return 0 } +// QueryTotalVotingPowerAtResponse contains total voting power. type QueryTotalVotingPowerAtResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4221,6 +4227,7 @@ func (x *QueryTotalVotingPowerAtResponse) GetPower() string { return "" } +// QueryVotingPowerOverRangeRequest requests an address's snapshots over a height range. type QueryVotingPowerOverRangeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4272,6 +4279,7 @@ func (x *QueryVotingPowerOverRangeRequest) GetToHeight() int64 { return 0 } +// QueryVotingPowerOverRangeResponse contains voting-power snapshots over a height range. type QueryVotingPowerOverRangeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -4307,6 +4315,7 @@ func (x *QueryVotingPowerOverRangeResponse) GetRows() []*HeightPower { return nil } +// HeightPower pairs a block height with its recorded voting power. type HeightPower struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/juno/votingsnapshot/v1/tx.pulsar.go b/api/juno/votingsnapshot/v1/tx.pulsar.go index c43e9ece2..a871deaab 100644 --- a/api/juno/votingsnapshot/v1/tx.pulsar.go +++ b/api/juno/votingsnapshot/v1/tx.pulsar.go @@ -932,6 +932,7 @@ func (x *MsgUpdateParams) GetParams() *Params { return nil } +// MsgUpdateParamsResponse is returned after module parameters are updated. type MsgUpdateParamsResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache diff --git a/api/osmosis/tokenfactory/module/v1/module.pulsar.go b/api/osmosis/tokenfactory/module/v1/module.pulsar.go index 5b1ac4ef4..6b8a2ecda 100644 --- a/api/osmosis/tokenfactory/module/v1/module.pulsar.go +++ b/api/osmosis/tokenfactory/module/v1/module.pulsar.go @@ -499,7 +499,7 @@ var file_osmosis_tokenfactory_module_v1_module_proto_rawDesc = []byte{ 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, 0x3a, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x34, 0x0a, 0x32, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x43, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x73, 0x2f, 0x6a, 0x75, 0x6e, 0x6f, - 0x2f, 0x76, 0x33, 0x30, 0x2f, 0x78, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x66, 0x61, 0x63, 0x74, + 0x2f, 0x76, 0x33, 0x31, 0x2f, 0x78, 0x2f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x86, 0x02, 0x0a, 0x22, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x69, 0x73, 0x2e, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x66, 0x61, 0x63, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, diff --git a/app/ante/ante.go b/app/ante/ante.go index 75f64da87..aa9163cbd 100644 --- a/app/ante/ante.go +++ b/app/ante/ante.go @@ -17,11 +17,11 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - decorators "github.com/CosmosContracts/juno/v30/app/ante/decorators" - feemarketkeeper "github.com/CosmosContracts/juno/v30/x/feemarket/keeper" - feepaykeeper "github.com/CosmosContracts/juno/v30/x/feepay/keeper" - feeshareante "github.com/CosmosContracts/juno/v30/x/feeshare/ante" - feesharekeeper "github.com/CosmosContracts/juno/v30/x/feeshare/keeper" + decorators "github.com/CosmosContracts/juno/v31/app/ante/decorators" + feemarketkeeper "github.com/CosmosContracts/juno/v31/x/feemarket/keeper" + feepaykeeper "github.com/CosmosContracts/juno/v31/x/feepay/keeper" + feeshareante "github.com/CosmosContracts/juno/v31/x/feeshare/ante" + feesharekeeper "github.com/CosmosContracts/juno/v31/x/feeshare/keeper" ) // HandlerOptions extends the SDK's AnteHandler options by requiring the IBC diff --git a/app/ante/decorators/change_rate_test.go b/app/ante/decorators/change_rate_test.go index 102da7294..61a36c5cf 100644 --- a/app/ante/decorators/change_rate_test.go +++ b/app/ante/decorators/change_rate_test.go @@ -16,8 +16,8 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - decorators "github.com/CosmosContracts/juno/v30/app/ante/decorators" - "github.com/CosmosContracts/juno/v30/testutil" + decorators "github.com/CosmosContracts/juno/v31/app/ante/decorators" + "github.com/CosmosContracts/juno/v31/testutil" ) // Define an empty ante handle diff --git a/app/ante/decorators/handle_fees.go b/app/ante/decorators/handle_fees.go index c72b82376..afd9c38b2 100644 --- a/app/ante/decorators/handle_fees.go +++ b/app/ante/decorators/handle_fees.go @@ -17,11 +17,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - feemarketkeeper "github.com/CosmosContracts/juno/v30/x/feemarket/keeper" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - feepayhelpers "github.com/CosmosContracts/juno/v30/x/feepay/helpers" - feepaykeeper "github.com/CosmosContracts/juno/v30/x/feepay/keeper" - feepaytypes "github.com/CosmosContracts/juno/v30/x/feepay/types" + feemarketkeeper "github.com/CosmosContracts/juno/v31/x/feemarket/keeper" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + feepayhelpers "github.com/CosmosContracts/juno/v31/x/feepay/helpers" + feepaykeeper "github.com/CosmosContracts/juno/v31/x/feepay/keeper" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" ) const ( @@ -44,11 +44,11 @@ type DeductFeeDecorator struct { fallbackDecorator sdk.AnteDecorator } -func NewDeductFeeDecorator(fpk feepaykeeper.Keeper, fmk feemarketkeeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fgk authante.FeegrantKeeper, bondDenom string, bypassMinFeeMsgTypes []string, fallbackDecorator sdk.AnteDecorator) DeductFeeDecorator { +func NewDeductFeeDecorator(fpk feepaykeeper.Keeper, fmk feemarketkeeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fgk authante.FeegrantKeeper, _ string, bypassMinFeeMsgTypes []string, fallbackDecorator sdk.AnteDecorator) DeductFeeDecorator { return DeductFeeDecorator{ feemarketkeeper: fmk, innerDecorator: newInnerDeductFeeDecorator( - fpk, fmk, ak, bk, fgk, bondDenom, bypassMinFeeMsgTypes, + fpk, fmk, ak, bk, fgk, bypassMinFeeMsgTypes, ), fallbackDecorator: fallbackDecorator, } @@ -68,18 +68,16 @@ type InnerDeductFeeDecorator struct { accountKeeper authkeeper.AccountKeeper bankKeeper bankkeeper.Keeper feegrantKeeper authante.FeegrantKeeper - bondDenom string bypassMinFeeMsgTypes []string } -func newInnerDeductFeeDecorator(fpk feepaykeeper.Keeper, fmk feemarketkeeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fgk authante.FeegrantKeeper, bondDenom string, bypassMinFeeMsgTypes []string) InnerDeductFeeDecorator { +func newInnerDeductFeeDecorator(fpk feepaykeeper.Keeper, fmk feemarketkeeper.Keeper, ak authkeeper.AccountKeeper, bk bankkeeper.Keeper, fgk authante.FeegrantKeeper, bypassMinFeeMsgTypes []string) InnerDeductFeeDecorator { return InnerDeductFeeDecorator{ feepayKeeper: fpk, feemarketKeeper: fmk, accountKeeper: ak, bankKeeper: bk, feegrantKeeper: fgk, - bondDenom: bondDenom, bypassMinFeeMsgTypes: bypassMinFeeMsgTypes, } } @@ -87,6 +85,11 @@ func newInnerDeductFeeDecorator(fpk feepaykeeper.Keeper, fmk feemarketkeeper.Kee // AnteHandle calls the feemarket antehandler if the keeper is enabled. If disabled, the fallback // fee antehandler is fallen back to. func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { + if feeTx, ok := tx.(sdk.FeeTx); ok && feeTx.GetGas() > math.MaxInt64 { + return ctx, errorsmod.Wrapf(sdkerrors.ErrInvalidGasLimit, + "gas limit %d exceeds maximum of %d", feeTx.GetGas(), int64(math.MaxInt64)) + } + params, err := dfd.feemarketkeeper.GetParams(ctx) if err != nil { return ctx, err @@ -142,7 +145,7 @@ func (dfd InnerDeductFeeDecorator) HandleFees(ctx sdk.Context, feeTx sdk.FeeTx, // First try to handle FeePay transactions, if error, try the feemarket route. // If not a FeePay transaction, default to the feemarket route. if isValidFeepayTx { - feePayErr = dfd.handleZeroFees(ctx, deductFeesFromAcc, feeTx) + feePayErr = dfd.handleZeroFees(ctx, feeTx) if feePayErr != nil { // Only fall back to user-paid escrow when there is an actual fee to // escrow. For a valid feepay tx the user submits --fees 0, so `fee` @@ -229,11 +232,8 @@ func (dfd InnerDeductFeeDecorator) anteHandle(ctx sdk.Context, tx sdk.Tx, simula return ctx, errorsmod.Wrapf(err, "unable to get fee market params") } - // Default payCoin to a zero coin in the fee market's fee denom. For a - // valid feepay tx the user submits with --fees 0 (sdk.ParseCoinsNormalized - // strips the zero, so feeCoins is empty), and the actual fee is covered by - // x/feepay in HandleFees — there is no feeCoins[0] to read. Pre-fix this - // indexed past the end of feeCoins and panicked in CheckTx. + // Default to the fee denom's zero coin. In simulation, fee validation is + // skipped and the submitted fee is accounted for separately below. payCoin := sdk.NewCoin(params.FeeDenom, sdkmath.ZeroInt()) if !simulate && len(feeCoins) > 0 { payCoin = feeCoins[0] @@ -264,8 +264,32 @@ func (dfd InnerDeductFeeDecorator) anteHandle(ctx sdk.Context, tx sdk.Tx, simula } } - // handle the entire tx fee process - err = dfd.HandleFees(ctx, feeTx, payCoin, isValidFeepayTx) + // Account for fee escrow during simulation without committing its writes or + // changing the historical behavior that lets gas estimation proceed when a + // submitted fee cannot be deducted. BaseApp already simulates in a cached + // context; the nested cache also makes direct ante-handler callers safe. + // Its gas meter is shared with ctx, so successful feegrant checks and bank + // writes contribute exactly the gas that delivery will consume. + if simulate && !isValidFeepayTx { + // Keplr and other clients commonly simulate with an empty fee amount + // and derive the real fee only after receiving the gas estimate. A + // nominal positive coin triggers the same bank store accesses; use the + // submitted fee when one is present. + simulationPayCoin := sdk.NewCoin(params.FeeDenom, sdkmath.OneInt()) + if len(feeCoins) > 0 { + simulationPayCoin = feeCoins[0] + } + + simCtx, _ := ctx.CacheContext() + if simErr := dfd.HandleFees(simCtx, feeTx, simulationPayCoin, false); simErr != nil { + // Preserve the prior simulation semantics for errors such as a + // missing feegrant, while still allowing gas estimation without a + // funded payer by retrying with the historical zero fee. + err = dfd.HandleFees(ctx, feeTx, payCoin, false) + } + } else { + err = dfd.HandleFees(ctx, feeTx, payCoin, isValidFeepayTx) + } if err != nil { return ctx, errorsmod.Wrapf(err, "error escrowing funds") } @@ -339,7 +363,7 @@ func (dfd InnerDeductFeeDecorator) isBypassMsg(msg sdk.Msg) bool { // Handle zero fee transactions for x/feepay module. // CONTRACT: the tx was validated by IsValidFeePayTransaction, which enforces // exactly one message of type MsgExecuteContract on a registered contract. -func (dfd InnerDeductFeeDecorator) handleZeroFees(ctx sdk.Context, deductFeesFromAcc sdk.AccountI, tx sdk.FeeTx) error { +func (dfd InnerDeductFeeDecorator) handleZeroFees(ctx sdk.Context, tx sdk.FeeTx) error { msg := tx.GetMsgs()[0] cw, ok := msg.(*wasmtypes.MsgExecuteContract) if !ok { @@ -352,32 +376,35 @@ func (dfd InnerDeductFeeDecorator) handleZeroFees(ctx sdk.Context, deductFeesFro return errorsmod.Wrapf(err, "error getting contract %s", cw.GetContract()) } - // Get the fee price in the chain denom - fmMinGasPriceBondDenom, err := dfd.feemarketKeeper.GetCurrentGasPrice(ctx, dfd.bondDenom) + params, err := dfd.feemarketKeeper.GetParams(ctx) if err != nil { return errorsmod.Wrapf(err, "error getting feemarket params") } - feePrice := sdk.DecCoin{} - if fmMinGasPriceBondDenom.Denom == dfd.bondDenom { - feePrice = fmMinGasPriceBondDenom - } - if feePrice == (sdk.DecCoin{}) { - return errorsmod.Wrapf(sdkerrors.ErrInvalidCoins, "fee price not found for denom %s in feemarket keeper", dfd.bondDenom) + feePrice, err := dfd.feemarketKeeper.GetCurrentGasPrice(ctx, params.FeeDenom) + if err != nil { + return errorsmod.Wrapf(err, "error getting gas price for fee denom %s", params.FeeDenom) } gas := sdkmath.LegacyNewDec(int64(tx.GetGas())) requiredFee := feePrice.Amount.Mul(gas).Ceil().RoundInt() - // Check if wallet exceeded usage limit on contract - accBech32 := deductFeesFromAcc.GetAddress().String() - if dfd.feepayKeeper.HasWalletExceededUsageLimit(ctx, feepayContract, accBech32) { + // Wallet limits protect the authenticated contract caller, not the account + // that happens to pay fees. With feegrant those identities are distinct. + // Canonicalize the Bech32 spelling so equivalent encodings share one usage + // bucket rather than allowing case variants to bypass the wallet limit. + walletAddr, err := sdk.AccAddressFromBech32(cw.Sender) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid contract sender %q: %s", cw.Sender, err) + } + walletAddress := walletAddr.String() + if dfd.feepayKeeper.HasWalletExceededUsageLimit(ctx, feepayContract, walletAddress) { return errorsmod.Wrapf(feepaytypes.ErrWalletExceededUsageLimit, "wallet has exceeded usage limit (%d)", feepayContract.WalletLimit) } - // Check if the contract has enough funds to cover the fee - if !dfd.feepayKeeper.CanContractCoverFee(feepayContract, requiredFee.Uint64()) { - return errorsmod.Wrapf(feepaytypes.ErrContractNotEnoughFunds, "contract has insufficient funds; expected: %d, got: %d", requiredFee.Uint64(), feepayContract.Balance) + newBalance, err := feepaytypes.ContractBalanceAfterSubtraction(feepayContract.Balance, requiredFee) + if err != nil { + return err } // Create an array of coins, storing the required fee @@ -389,10 +416,10 @@ func (dfd InnerDeductFeeDecorator) handleZeroFees(ctx sdk.Context, deductFeesFro } // Deduct the fee from the contract balance - dfd.feepayKeeper.SetContractBalance(ctx, feepayContract, feepayContract.Balance-requiredFee.Uint64()) + dfd.feepayKeeper.SetContractBalance(ctx, feepayContract, newBalance) // Increment wallet usage - if err := dfd.feepayKeeper.IncrementContractUses(ctx, feepayContract, accBech32, 1); err != nil { + if err := dfd.feepayKeeper.IncrementContractUses(ctx, feepayContract, walletAddress, 1); err != nil { return errorsmod.Wrapf(err, "error incrementing contract uses") } diff --git a/app/app.go b/app/app.go index b30e8e331..ba2d4ddbd 100644 --- a/app/app.go +++ b/app/app.go @@ -60,15 +60,18 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - - junoante "github.com/CosmosContracts/juno/v30/app/ante" - endpoints "github.com/CosmosContracts/juno/v30/app/endpoints" - wsendpoints "github.com/CosmosContracts/juno/v30/app/endpoints/websocket" - "github.com/CosmosContracts/juno/v30/app/keepers" - upgrades "github.com/CosmosContracts/juno/v30/app/upgrades" - v30 "github.com/CosmosContracts/juno/v30/app/upgrades/v30" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - streamtypes "github.com/CosmosContracts/juno/v30/x/stream/types" + paramsproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" + + junoante "github.com/CosmosContracts/juno/v31/app/ante" + endpoints "github.com/CosmosContracts/juno/v31/app/endpoints" + wsendpoints "github.com/CosmosContracts/juno/v31/app/endpoints/websocket" + "github.com/CosmosContracts/juno/v31/app/keepers" + upgrades "github.com/CosmosContracts/juno/v31/app/upgrades" + v31 "github.com/CosmosContracts/juno/v31/app/upgrades/v31" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + legacyglobalfeetypes "github.com/CosmosContracts/juno/v31/x/globalfee/types" + legacypobtypes "github.com/CosmosContracts/juno/v31/x/legacy/pob/types" + streamtypes "github.com/CosmosContracts/juno/v31/x/stream/types" ) const ( @@ -88,7 +91,7 @@ var ( EnableSpecificProposals = "" Upgrades = []upgrades.Upgrade{ - v30.Upgrade, + v31.Upgrade, } _ runtime.AppI = (*App)(nil) @@ -150,6 +153,15 @@ func New( std.RegisterLegacyAminoCodec(legacyAmino) std.RegisterInterfaces(interfaceRegistry) + // Retired modules can leave interface-typed governance messages in state. + // Keep their codecs registered so historical queries and genesis export do + // not panic even though no keepers, stores, or message routes remain. + paramsproposal.RegisterLegacyAminoCodec(legacyAmino) + paramsproposal.RegisterInterfaces(interfaceRegistry) + legacyglobalfeetypes.RegisterLegacyAminoCodec(legacyAmino) + legacyglobalfeetypes.RegisterInterfaces(interfaceRegistry) + legacypobtypes.RegisterLegacyAminoCodec(legacyAmino) + legacypobtypes.RegisterInterfaces(interfaceRegistry) bApp := baseapp.NewBaseApp(Name, logger, db, txConfig.TxDecoder(), baseAppOptions...) bApp.SetCommitMultiStoreTracer(traceStore) diff --git a/app/endpoints/openapi.yaml b/app/endpoints/openapi.yaml index 0b49830d9..433e691bc 100644 --- a/app/endpoints/openapi.yaml +++ b/app/endpoints/openapi.yaml @@ -8243,6 +8243,7 @@ components: type: string power: type: string + description: HeightPower pairs a block height with its recorded voting power. HistoricalInfo: type: object properties: @@ -8509,6 +8510,12 @@ components: contractFailureRemovalThreshold: type: string description: contract_failure_removal_threshold is the threshold for removing a contract after consecutive failures + maxContracts: + type: string + description: |- + max_contracts caps the number of registered contracts per hook module, + bounding per-hook sudo work so registration cannot be used to inflate + block time. sendEnabled: type: array items: @@ -8529,14 +8536,6 @@ components: allowed_clients defines the list of allowed client state types which can be created and interacted with. If a client type is removed from the allowed clients list, usage of this client will be disabled until it is added again to the list. - hostEnabled: - type: boolean - description: host_enabled enables or disables the host submodule. - allowQueries: - type: array - items: - type: string - description: allow_queries defines a list of query paths allowed to be queried on a host chain. codeUploadAccess: $ref: '#/components/schemas/AccessConfig' instantiateDefaultPermission: @@ -8998,6 +8997,7 @@ components: clockContract: allOf: - $ref: '#/components/schemas/ClockContract' + - $ref: '#/components/schemas/ClockContract' description: contract is the clock contract. description: QueryClockContractResponse is the response type for the Query/ClockContract RPC method. QueryClockContractsResponse: @@ -9011,6 +9011,7 @@ components: pagination: allOf: - $ref: '#/components/schemas/PageResponse' + - $ref: '#/components/schemas/PageResponse' description: pagination defines the pagination in the response. description: QueryClockContractsResponse is the response type for the Query/ClockContracts RPC method. QueryCodeInfoResponse: @@ -9510,6 +9511,7 @@ components: pagination: allOf: - $ref: '#/components/schemas/PageResponse' + - $ref: '#/components/schemas/PageResponse' description: pagination defines the pagination in the response. description: |- QueryDeployerFeeSharesResponse is the response type for the @@ -9556,6 +9558,7 @@ components: feePayContract: allOf: - $ref: '#/components/schemas/FeePayContract' + - $ref: '#/components/schemas/FeePayContract' description: contract defines the fee pay contract description: QueryFeePayContractResponse defines the response for retrieving a single fee pay contract QueryFeePayContractUsesResponse: @@ -9576,6 +9579,7 @@ components: pagination: allOf: - $ref: '#/components/schemas/PageResponse' + - $ref: '#/components/schemas/PageResponse' description: pagination defines the pagination in the response. description: The response for querying all fee pay contracts QueryFeePayWalletIsEligibleResponse: @@ -9591,6 +9595,7 @@ components: feeshare: allOf: - $ref: '#/components/schemas/FeeShare' + - $ref: '#/components/schemas/FeeShare' description: FeeShare is a stored Reveneue for the queried contract description: QueryFeeShareResponse is the response type for the Query/FeeShare RPC method. QueryFeeSharesResponse: @@ -9604,6 +9609,7 @@ components: pagination: allOf: - $ref: '#/components/schemas/PageResponse' + - $ref: '#/components/schemas/PageResponse' description: pagination defines the pagination in the response. description: |- QueryFeeSharesResponse is the response type for the Query/FeeShares RPC @@ -9833,7 +9839,6 @@ components: - $ref: '#/components/schemas/Params' - $ref: '#/components/schemas/Params' - $ref: '#/components/schemas/Params' - - $ref: '#/components/schemas/Params' description: params defines the parameters of the module. description: QueryParamsResponse is the response type for the Query/Params RPC method. QueryPinnedCodesResponse: @@ -10029,6 +10034,7 @@ components: properties: power: type: string + description: QueryTotalVotingPowerAtResponse contains total voting power. QueryUnbondingDelegationResponse: type: object properties: @@ -10281,6 +10287,7 @@ components: power: type: string description: power is the bonded stake amount as a base-10 string (uint). + description: QueryVotingPowerAtResponse contains an address's voting power. QueryVotingPowerOverRangeResponse: type: object properties: @@ -10288,6 +10295,7 @@ components: type: array items: $ref: '#/components/schemas/HeightPower' + description: QueryVotingPowerOverRangeResponse contains voting-power snapshots over a height range. QueryWasmLimitsConfigResponse: type: object properties: @@ -10310,6 +10318,7 @@ components: pagination: allOf: - $ref: '#/components/schemas/PageResponse' + - $ref: '#/components/schemas/PageResponse' description: pagination defines the pagination in the response. description: |- QueryWithdrawerFeeSharesResponse is the response type for the diff --git a/app/endpoints/openapi_spec_test.go b/app/endpoints/openapi_spec_test.go index ba35430dd..f5cd7bc87 100644 --- a/app/endpoints/openapi_spec_test.go +++ b/app/endpoints/openapi_spec_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/CosmosContracts/juno/v30/app/endpoints" + "github.com/CosmosContracts/juno/v31/app/endpoints" ) func TestGetOpenAPIEndpointsIncludesAccountPath(t *testing.T) { diff --git a/app/endpoints/websocket/common/handler.go b/app/endpoints/websocket/common/handler.go index 41c5100a9..918a76ee9 100644 --- a/app/endpoints/websocket/common/handler.go +++ b/app/endpoints/websocket/common/handler.go @@ -18,8 +18,8 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/x/stream/types" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/x/stream/types" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) const ( diff --git a/app/endpoints/websocket/common/handler_test.go b/app/endpoints/websocket/common/handler_test.go index 1e5a7ab49..1678186ea 100644 --- a/app/endpoints/websocket/common/handler_test.go +++ b/app/endpoints/websocket/common/handler_test.go @@ -15,8 +15,8 @@ import ( "cosmossdk.io/log" - "github.com/CosmosContracts/juno/v30/x/stream/types" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/x/stream/types" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) func TestHandlerServeConnectionConnectionLimit(t *testing.T) { diff --git a/app/endpoints/websocket/common/stream_module.go b/app/endpoints/websocket/common/stream_module.go index cfd2e99fd..b5cce71b2 100644 --- a/app/endpoints/websocket/common/stream_module.go +++ b/app/endpoints/websocket/common/stream_module.go @@ -13,9 +13,9 @@ import ( "cosmossdk.io/log" - "github.com/CosmosContracts/juno/v30/app/endpoints" - "github.com/CosmosContracts/juno/v30/x/stream/types" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/app/endpoints" + "github.com/CosmosContracts/juno/v31/x/stream/types" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) const wsRoutePrefix = "/ws" diff --git a/app/endpoints/websocket/common/stream_module_test.go b/app/endpoints/websocket/common/stream_module_test.go index 7bbe2bf85..dc8e2faca 100644 --- a/app/endpoints/websocket/common/stream_module_test.go +++ b/app/endpoints/websocket/common/stream_module_test.go @@ -5,8 +5,8 @@ import ( "github.com/stretchr/testify/require" - "github.com/CosmosContracts/juno/v30/app/endpoints" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/app/endpoints" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) func TestDescriptorResolverPrefersModuleHint(t *testing.T) { diff --git a/app/endpoints/websocket/server.go b/app/endpoints/websocket/server.go index ed3b76e75..14a070970 100644 --- a/app/endpoints/websocket/server.go +++ b/app/endpoints/websocket/server.go @@ -7,9 +7,9 @@ import ( "cosmossdk.io/log" - "github.com/CosmosContracts/juno/v30/app/endpoints/websocket/common" - "github.com/CosmosContracts/juno/v30/x/stream/types" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/app/endpoints/websocket/common" + "github.com/CosmosContracts/juno/v31/x/stream/types" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) // ServerOptions contains the configuration required to build a WebSocket server. diff --git a/app/endpoints/websocket/websocket.go b/app/endpoints/websocket/websocket.go index 38e07d590..6a05b8883 100644 --- a/app/endpoints/websocket/websocket.go +++ b/app/endpoints/websocket/websocket.go @@ -8,8 +8,8 @@ import ( "github.com/cosmos/cosmos-sdk/server/api" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/app/endpoints/websocket/common" - "github.com/CosmosContracts/juno/v30/x/stream/keeper" + "github.com/CosmosContracts/juno/v31/app/endpoints/websocket/common" + "github.com/CosmosContracts/juno/v31/x/stream/keeper" ) // RegisterRoutes registers WebSocket routes for the stream module using the configuration diff --git a/app/export.go b/app/export.go index 70ead7913..b6e58bc31 100644 --- a/app/export.go +++ b/app/export.go @@ -14,6 +14,9 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + clocktypes "github.com/CosmosContracts/juno/v31/x/clock/types" + cwhookstypes "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) // ExportAppStateAndValidators exports the state of the application for a genesis @@ -34,6 +37,31 @@ func (app *App) ExportAppStateAndValidators(forZeroHeight bool, jailAllowedAddrs return servertypes.ExportedApp{}, err } + // v30 stores written before the contract-cap fields existed decode their + // max_contracts values as zero. The v31 genesis validators correctly reject + // that unsafe value, so preserve the live parameters while supplying the new + // default caps in exported state. + if raw, ok := genState[clocktypes.ModuleName]; ok { + var clockGenesis clocktypes.GenesisState + if err := app.appCodec.UnmarshalJSON(raw, &clockGenesis); err != nil { + return servertypes.ExportedApp{}, err + } + if clockGenesis.Params.MaxContracts == 0 { + clockGenesis.Params.MaxContracts = clocktypes.DefaultMaxContracts + genState[clocktypes.ModuleName] = app.appCodec.MustMarshalJSON(&clockGenesis) + } + } + if raw, ok := genState[cwhookstypes.ModuleName]; ok { + var cwHooksGenesis cwhookstypes.GenesisState + if err := app.appCodec.UnmarshalJSON(raw, &cwHooksGenesis); err != nil { + return servertypes.ExportedApp{}, err + } + if cwHooksGenesis.Params.MaxContracts == 0 { + cwHooksGenesis.Params.MaxContracts = cwhookstypes.DefaultMaxContracts + genState[cwhookstypes.ModuleName] = app.appCodec.MustMarshalJSON(&cwHooksGenesis) + } + } + appState, err := json.MarshalIndent(genState, "", " ") if err != nil { return servertypes.ExportedApp{}, err diff --git a/app/export_test.go b/app/export_test.go new file mode 100644 index 000000000..cc1d54b5c --- /dev/null +++ b/app/export_test.go @@ -0,0 +1,128 @@ +package app_test + +import ( + "encoding/json" + "testing" + + "github.com/stretchr/testify/require" + + abci "github.com/cometbft/cometbft/abci/types" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + + storetypes "cosmossdk.io/store/types" + + sdk "github.com/cosmos/cosmos-sdk/types" + minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" + + "github.com/CosmosContracts/juno/v31/testutil/setup" + clocktypes "github.com/CosmosContracts/juno/v31/x/clock/types" + cwhookstypes "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" +) + +func TestExportNormalizesLegacyContractCaps(t *testing.T) { + chainID := "juno-export-legacy-caps-1" + app := setup.Setup(false, t.TempDir(), chainID) + ctx := app.NewContextLegacy(false, cmtproto.Header{Height: 1, ChainID: chainID}) + + legacyClock := clocktypes.Params{ContractGasLimit: 250_000, MaxContracts: 0} + clockStore := app.AppKeepers.ClockKeeper.GetStoreService().OpenKVStore(ctx) + require.NoError(t, clockStore.Set(clocktypes.ParamsKey, app.AppKeepers.ClockKeeper.GetCdc().MustMarshal(&legacyClock))) + legacyCWHooks := cwhookstypes.Params{ + ContractGasLimit: 250_000, + ContractFailureRemovalThreshold: 3, + MaxContracts: 0, + } + require.NoError(t, app.AppKeepers.CWHooksKeeper.Params.Set(ctx, legacyCWHooks)) + ctx.MultiStore().(storetypes.CacheMultiStore).Write() + _, err := app.Commit() + require.NoError(t, err) + + exported, err := app.ExportAppStateAndValidators(false, nil, nil) + require.NoError(t, err) + var state map[string]json.RawMessage + require.NoError(t, json.Unmarshal(exported.AppState, &state)) + var clockGenesis clocktypes.GenesisState + require.NoError(t, app.AppCodec().UnmarshalJSON(state[clocktypes.ModuleName], &clockGenesis)) + var cwHooksGenesis cwhookstypes.GenesisState + require.NoError(t, app.AppCodec().UnmarshalJSON(state[cwhookstypes.ModuleName], &cwHooksGenesis)) + require.Equal(t, clocktypes.DefaultMaxContracts, clockGenesis.Params.MaxContracts) + require.Equal(t, legacyClock.ContractGasLimit, clockGenesis.Params.ContractGasLimit) + require.Equal(t, cwhookstypes.DefaultMaxContracts, cwHooksGenesis.Params.MaxContracts) + require.Equal(t, legacyCWHooks.ContractGasLimit, cwHooksGenesis.Params.ContractGasLimit) + require.Equal(t, legacyCWHooks.ContractFailureRemovalThreshold, cwHooksGenesis.Params.ContractFailureRemovalThreshold) +} + +func TestExportContractCapNormalizationRespectsModuleSelection(t *testing.T) { + app := setup.Setup(false, t.TempDir(), "juno-export-module-selection-1") + ctx := app.NewContextLegacy(false, cmtproto.Header{Height: 1}) + ctx.MultiStore().(storetypes.CacheMultiStore).Write() + _, err := app.Commit() + require.NoError(t, err) + + _, err = app.ExportAppStateAndValidators(false, nil, []string{"bank"}) + require.NoError(t, err) +} + +func TestExportImportPreservesV31State(t *testing.T) { + const chainID = "juno-export-import-1" + firstHome := t.TempDir() + first := setup.Setup(false, firstHome, chainID) + ctx := first.NewContextLegacy(false, cmtproto.Header{Height: 1, ChainID: chainID}) + _, err := first.AppKeepers.VotingSnapshotKeeper.Params.Get(ctx) + require.NoError(t, err, "default genesis must initialize voting-snapshot before state export") + + contractAddr := "juno1qsrercqegvs4ye0yqg93knv73ye5dc3prqwd6jcdcuj8ggp6w0us66deup" + walletAddr := "juno1p30mp2fh2p6603h9mkxc8alw6wplss72dfd385" + contract := feepaytypes.FeePayContract{ + ContractAddress: contractAddr, + Balance: 1_000_000, + WalletLimit: 10, + } + backing := sdk.NewCoins(sdk.NewInt64Coin("stake", 1_000_000)) + require.NoError(t, first.AppKeepers.BankKeeper.MintCoins(ctx, minttypes.ModuleName, backing)) + require.NoError(t, first.AppKeepers.BankKeeper.SendCoinsFromModuleToModule(ctx, minttypes.ModuleName, feepaytypes.ModuleName, backing)) + first.AppKeepers.FeePayKeeper.SetFeePayContract(ctx, contract) + require.NoError(t, first.AppKeepers.FeePayKeeper.IncrementContractUses(ctx, &contract, walletAddr, 3)) + preExportPower, err := first.AppKeepers.VotingSnapshotKeeper.TotalVotingPowerAt(ctx, ctx.BlockHeight()) + require.NoError(t, err) + require.False(t, preExportPower.IsZero()) + preExportVersions, err := first.AppKeepers.UpgradeKeeper.GetModuleVersionMap(ctx) + require.NoError(t, err) + ctx.MultiStore().(storetypes.CacheMultiStore).Write() + _, err = first.Commit() + require.NoError(t, err) + + exported, err := first.ExportAppStateAndValidators(false, nil, nil) + require.NoError(t, err) + require.NotEmpty(t, exported.AppState) + require.Positive(t, exported.Height) + + second := setup.Setup(true, t.TempDir(), chainID) + _, err = second.InitChain(&abci.RequestInitChain{ + ConsensusParams: &exported.ConsensusParams, + AppStateBytes: exported.AppState, + ChainId: chainID, + InitialHeight: exported.Height, + }) + require.NoError(t, err) + + restoredCtx := second.NewContextLegacy(false, cmtproto.Header{Height: exported.Height, ChainID: chainID}) + restored, err := second.AppKeepers.FeePayKeeper.GetContract(restoredCtx, contractAddr) + require.NoError(t, err) + require.Equal(t, contract, *restored) + uses, err := second.AppKeepers.FeePayKeeper.GetContractUses(restoredCtx, restored, walletAddr) + require.NoError(t, err) + require.Equal(t, uint64(3), uses) + require.Equal(t, backing.AmountOf("stake"), second.AppKeepers.BankKeeper.GetBalance( + restoredCtx, + second.AppKeepers.AccountKeeper.GetModuleAddress(feepaytypes.ModuleName), + "stake", + ).Amount) + restoredPower, err := second.AppKeepers.VotingSnapshotKeeper.TotalVotingPowerAt(restoredCtx, exported.Height) + require.NoError(t, err) + require.Equal(t, preExportPower, restoredPower) + restoredVersions, err := second.AppKeepers.UpgradeKeeper.GetModuleVersionMap(restoredCtx) + require.NoError(t, err) + require.Equal(t, preExportVersions, restoredVersions) +} diff --git a/app/keepers/acceptedQueries.go b/app/keepers/acceptedQueries.go index bf54d7e60..170435b4f 100644 --- a/app/keepers/acceptedQueries.go +++ b/app/keepers/acceptedQueries.go @@ -15,7 +15,7 @@ import ( govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - tokenfactorytypes "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + tokenfactorytypes "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) func AcceptedQueries() map[string]func() proto.Message { diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 96f670f24..e328294bc 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -65,29 +65,29 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/CosmosContracts/juno/v30/wasmbindings" - junoburn "github.com/CosmosContracts/juno/v30/x/burn" - clockkeeper "github.com/CosmosContracts/juno/v30/x/clock/keeper" - clocktypes "github.com/CosmosContracts/juno/v30/x/clock/types" - cwhookskeeper "github.com/CosmosContracts/juno/v30/x/cw-hooks/keeper" - cwhookstypes "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" - dripkeeper "github.com/CosmosContracts/juno/v30/x/drip/keeper" - driptypes "github.com/CosmosContracts/juno/v30/x/drip/types" - feemarketkeeper "github.com/CosmosContracts/juno/v30/x/feemarket/keeper" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - feepaykeeper "github.com/CosmosContracts/juno/v30/x/feepay/keeper" - feepaytypes "github.com/CosmosContracts/juno/v30/x/feepay/types" - feesharekeeper "github.com/CosmosContracts/juno/v30/x/feeshare/keeper" - feesharetypes "github.com/CosmosContracts/juno/v30/x/feeshare/types" - mintkeeper "github.com/CosmosContracts/juno/v30/x/mint/keeper" - minttypes "github.com/CosmosContracts/juno/v30/x/mint/types" - streamkeeper "github.com/CosmosContracts/juno/v30/x/stream/keeper" - tokenfactorykeeper "github.com/CosmosContracts/juno/v30/x/tokenfactory/keeper" - tokenfactorytypes "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" - votingsnapshotkeeper "github.com/CosmosContracts/juno/v30/x/voting-snapshot/keeper" - votingsnapshottypes "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + "github.com/CosmosContracts/juno/v31/wasmbindings" + junoburn "github.com/CosmosContracts/juno/v31/x/burn" + clockkeeper "github.com/CosmosContracts/juno/v31/x/clock/keeper" + clocktypes "github.com/CosmosContracts/juno/v31/x/clock/types" + cwhookskeeper "github.com/CosmosContracts/juno/v31/x/cw-hooks/keeper" + cwhookstypes "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" + dripkeeper "github.com/CosmosContracts/juno/v31/x/drip/keeper" + driptypes "github.com/CosmosContracts/juno/v31/x/drip/types" + feemarketkeeper "github.com/CosmosContracts/juno/v31/x/feemarket/keeper" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + feepaykeeper "github.com/CosmosContracts/juno/v31/x/feepay/keeper" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" + feesharekeeper "github.com/CosmosContracts/juno/v31/x/feeshare/keeper" + feesharetypes "github.com/CosmosContracts/juno/v31/x/feeshare/types" + mintkeeper "github.com/CosmosContracts/juno/v31/x/mint/keeper" + minttypes "github.com/CosmosContracts/juno/v31/x/mint/types" + streamkeeper "github.com/CosmosContracts/juno/v31/x/stream/keeper" + tokenfactorykeeper "github.com/CosmosContracts/juno/v31/x/tokenfactory/keeper" + tokenfactorytypes "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" + votingsnapshotkeeper "github.com/CosmosContracts/juno/v31/x/voting-snapshot/keeper" + votingsnapshottypes "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" // wrappers - wrappedgovkeeper "github.com/CosmosContracts/juno/v30/x/wrappers/gov/keeper" + wrappedgovkeeper "github.com/CosmosContracts/juno/v31/x/wrappers/gov/keeper" ) var ( @@ -181,7 +181,7 @@ func NewAppKeepers( maccPerms map[string][]string, appOpts servertypes.AppOptions, wasmOpts []wasmkeeper.Option, - bondDenom string, + _ string, homePath string, ) AppKeepers { appKeepers := AppKeepers{} @@ -531,9 +531,10 @@ func NewAppKeepers( appKeepers.BankKeeper, appKeepers.WasmKeeper, appKeepers.AccountKeeper, - bondDenom, + appKeepers.FeeMarketKeeper, govModAddress, ) + appKeepers.FeeMarketKeeper.SetFeePayLiabilityChecker(appKeepers.FeePayKeeper) // set the contract keeper for the Ics20WasmHooks appKeepers.ContractKeeper = wasmkeeper.NewDefaultPermissionKeeper(appKeepers.WasmKeeper) diff --git a/app/keepers/keepers_test.go b/app/keepers/keepers_test.go index 433b31abc..49e5fa145 100644 --- a/app/keepers/keepers_test.go +++ b/app/keepers/keepers_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/suite" - "github.com/CosmosContracts/juno/v30/testutil" + "github.com/CosmosContracts/juno/v31/testutil" ) type KeepersTestSuite struct { diff --git a/app/keepers/keys.go b/app/keepers/keys.go index 2015ec844..829d7006f 100644 --- a/app/keepers/keys.go +++ b/app/keepers/keys.go @@ -25,15 +25,15 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clocktypes "github.com/CosmosContracts/juno/v30/x/clock/types" - cwhookstypes "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" - driptypes "github.com/CosmosContracts/juno/v30/x/drip/types" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - feepaytypes "github.com/CosmosContracts/juno/v30/x/feepay/types" - feesharetypes "github.com/CosmosContracts/juno/v30/x/feeshare/types" - minttypes "github.com/CosmosContracts/juno/v30/x/mint/types" - tokenfactorytypes "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" - votingsnapshottypes "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + clocktypes "github.com/CosmosContracts/juno/v31/x/clock/types" + cwhookstypes "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" + driptypes "github.com/CosmosContracts/juno/v31/x/drip/types" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" + feesharetypes "github.com/CosmosContracts/juno/v31/x/feeshare/types" + minttypes "github.com/CosmosContracts/juno/v31/x/mint/types" + tokenfactorytypes "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" + votingsnapshottypes "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" ) func (appKeepers *AppKeepers) GenerateKeys() { diff --git a/app/legacy_params_export_test.go b/app/legacy_params_export_test.go new file mode 100644 index 000000000..4c4d03649 --- /dev/null +++ b/app/legacy_params_export_test.go @@ -0,0 +1,58 @@ +package app_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + govv1beta1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" + paramsproposal "github.com/cosmos/cosmos-sdk/x/params/types/proposal" + + "github.com/CosmosContracts/juno/v31/testutil/setup" +) + +func TestLegacyParameterChangeProposalCanBeUnpackedForExport(t *testing.T) { + app := setup.Setup(false, t.TempDir(), "juno-1", t) + legacyProposal := ¶msproposal.ParameterChangeProposal{ + Title: "legacy parameter change", + Description: "state retained from before x/params removal", + Changes: []paramsproposal.ParamChange{{ + Subspace: "staking", + Key: "MaxValidators", + Value: "100", + }}, + } + anyProposal, err := codectypes.NewAnyWithValue(legacyProposal) + require.NoError(t, err) + encoded := app.AppCodec().MustMarshal(anyProposal) + var storedProposal codectypes.Any + app.AppCodec().MustUnmarshal(encoded, &storedProposal) + + var content govv1beta1.Content + require.NoError(t, app.InterfaceRegistry().UnpackAny(&storedProposal, &content)) + require.Equal(t, legacyProposal, content) +} + +func TestLegacyGlobalFeeMessageCanBeUnpackedForExport(t *testing.T) { + app := setup.Setup(false, t.TempDir(), "juno-1", t) + storedMessage := &codectypes.Any{ + TypeUrl: "/gaia.globalfee.v1beta1.MsgUpdateParams", + Value: []byte{}, + } + + var message sdk.Msg + require.NoError(t, app.InterfaceRegistry().UnpackAny(storedMessage, &message)) +} + +func TestLegacyBuilderMessageCanBeUnpackedForExport(t *testing.T) { + app := setup.Setup(false, t.TempDir(), "juno-1", t) + storedMessage := &codectypes.Any{ + TypeUrl: "/pob.builder.v1.MsgUpdateParams", + Value: []byte{}, + } + + var message sdk.Msg + require.NoError(t, app.InterfaceRegistry().UnpackAny(storedMessage, &message)) +} diff --git a/app/modules.go b/app/modules.go index 5edbc7ccf..24a58bbdb 100644 --- a/app/modules.go +++ b/app/modules.go @@ -49,28 +49,28 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - clockmodule "github.com/CosmosContracts/juno/v30/x/clock/module" - clocktypes "github.com/CosmosContracts/juno/v30/x/clock/types" - cwhooksmodule "github.com/CosmosContracts/juno/v30/x/cw-hooks/module" - cwhookstypes "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" - dripmodule "github.com/CosmosContracts/juno/v30/x/drip/module" - driptypes "github.com/CosmosContracts/juno/v30/x/drip/types" - feemarketmodule "github.com/CosmosContracts/juno/v30/x/feemarket/module" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - feepaymodule "github.com/CosmosContracts/juno/v30/x/feepay/module" - feepaytypes "github.com/CosmosContracts/juno/v30/x/feepay/types" - feesharemodule "github.com/CosmosContracts/juno/v30/x/feeshare/module" - feesharetypes "github.com/CosmosContracts/juno/v30/x/feeshare/types" - mintmodule "github.com/CosmosContracts/juno/v30/x/mint/module" - minttypes "github.com/CosmosContracts/juno/v30/x/mint/types" - streammodule "github.com/CosmosContracts/juno/v30/x/stream/module" - streamtypes "github.com/CosmosContracts/juno/v30/x/stream/types" - tokenfactorymodule "github.com/CosmosContracts/juno/v30/x/tokenfactory/module" - tokenfactorytypes "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" - votingsnapshotmodule "github.com/CosmosContracts/juno/v30/x/voting-snapshot/module" - votingsnapshottypes "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + clockmodule "github.com/CosmosContracts/juno/v31/x/clock/module" + clocktypes "github.com/CosmosContracts/juno/v31/x/clock/types" + cwhooksmodule "github.com/CosmosContracts/juno/v31/x/cw-hooks/module" + cwhookstypes "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" + dripmodule "github.com/CosmosContracts/juno/v31/x/drip/module" + driptypes "github.com/CosmosContracts/juno/v31/x/drip/types" + feemarketmodule "github.com/CosmosContracts/juno/v31/x/feemarket/module" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + feepaymodule "github.com/CosmosContracts/juno/v31/x/feepay/module" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" + feesharemodule "github.com/CosmosContracts/juno/v31/x/feeshare/module" + feesharetypes "github.com/CosmosContracts/juno/v31/x/feeshare/types" + mintmodule "github.com/CosmosContracts/juno/v31/x/mint/module" + minttypes "github.com/CosmosContracts/juno/v31/x/mint/types" + streammodule "github.com/CosmosContracts/juno/v31/x/stream/module" + streamtypes "github.com/CosmosContracts/juno/v31/x/stream/types" + tokenfactorymodule "github.com/CosmosContracts/juno/v31/x/tokenfactory/module" + tokenfactorytypes "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" + votingsnapshotmodule "github.com/CosmosContracts/juno/v31/x/voting-snapshot/module" + votingsnapshottypes "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" // wrappers - wrappedgovmodule "github.com/CosmosContracts/juno/v30/x/wrappers/gov/module" + wrappedgovmodule "github.com/CosmosContracts/juno/v31/x/wrappers/gov/module" ) // SA1019 module.AppModule is deprecated upstream in favor of appmodule.AppModule @@ -230,8 +230,8 @@ func orderInitBlockers() []string { packetforwardtypes.ModuleName, tokenfactorytypes.ModuleName, driptypes.ModuleName, - feepaytypes.ModuleName, feemarkettypes.ModuleName, + feepaytypes.ModuleName, feesharetypes.ModuleName, streamtypes.ModuleName, wasmtypes.ModuleName, diff --git a/app/modules_test.go b/app/modules_test.go index 1f73a995d..b8528a696 100644 --- a/app/modules_test.go +++ b/app/modules_test.go @@ -7,7 +7,7 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - votingsnapshottypes "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + votingsnapshottypes "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" ) func TestOrderMigrationsKeepsVotingSnapshotAfterStaking(t *testing.T) { diff --git a/app/post.go b/app/post.go index c104b4c90..2fdb0a029 100644 --- a/app/post.go +++ b/app/post.go @@ -8,10 +8,10 @@ import ( authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - feemarketkeeper "github.com/CosmosContracts/juno/v30/x/feemarket/keeper" - feemarketpost "github.com/CosmosContracts/juno/v30/x/feemarket/post" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - feepaykeeper "github.com/CosmosContracts/juno/v30/x/feepay/keeper" + feemarketkeeper "github.com/CosmosContracts/juno/v31/x/feemarket/keeper" + feemarketpost "github.com/CosmosContracts/juno/v31/x/feemarket/post" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + feepaykeeper "github.com/CosmosContracts/juno/v31/x/feepay/keeper" ) // PostHandlerOptions are the options required for constructing a FeeMarket PostHandler. diff --git a/app/upgrades/types.go b/app/upgrades/types.go index 359f99360..c6b3a98ab 100644 --- a/app/upgrades/types.go +++ b/app/upgrades/types.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" - "github.com/CosmosContracts/juno/v30/app/keepers" + "github.com/CosmosContracts/juno/v31/app/keepers" ) // Upgrade defines a struct containing necessary fields that a SoftwareUpgradeProposal diff --git a/app/upgrades/v31/constants.go b/app/upgrades/v31/constants.go new file mode 100644 index 000000000..750c0bb02 --- /dev/null +++ b/app/upgrades/v31/constants.go @@ -0,0 +1,15 @@ +package v31 + +import ( + storetypes "cosmossdk.io/store/types" + + "github.com/CosmosContracts/juno/v31/app/upgrades" +) + +const UpgradeName = "v31" + +var Upgrade = upgrades.Upgrade{ + UpgradeName: UpgradeName, + CreateUpgradeHandler: CreateV31UpgradeHandler, + StoreUpgrades: storetypes.StoreUpgrades{}, +} diff --git a/app/upgrades/v31/upgrades.go b/app/upgrades/v31/upgrades.go new file mode 100644 index 000000000..5fa2f00b2 --- /dev/null +++ b/app/upgrades/v31/upgrades.go @@ -0,0 +1,64 @@ +package v31 + +import ( + "context" + + upgradetypes "cosmossdk.io/x/upgrade/types" + + "github.com/cosmos/cosmos-sdk/types/module" + + "github.com/CosmosContracts/juno/v31/app/keepers" + clocktypes "github.com/CosmosContracts/juno/v31/x/clock/types" + cwhookstypes "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" +) + +type migrationRunner interface { + RunMigrations(context.Context, module.Configurator, module.VersionMap) (module.VersionMap, error) +} + +type clockParamsStore interface { + GetParams(context.Context) clocktypes.Params + SetParams(context.Context, clocktypes.Params) error +} + +type cwHooksParamsStore interface { + Get(context.Context) (cwhookstypes.Params, error) + Set(context.Context, cwhookstypes.Params) error +} + +func migrateLegacyContractCaps(ctx context.Context, clockStore clockParamsStore, cwHooksStore cwHooksParamsStore) error { + clockParams := clockStore.GetParams(ctx) + if clockParams.MaxContracts == 0 { + clockParams.MaxContracts = clocktypes.DefaultMaxContracts + if err := clockStore.SetParams(ctx, clockParams); err != nil { + return err + } + } + cwHooksParams, err := cwHooksStore.Get(ctx) + if err != nil { + return err + } + if cwHooksParams.MaxContracts == 0 { + cwHooksParams.MaxContracts = cwhookstypes.DefaultMaxContracts + if err := cwHooksStore.Set(ctx, cwHooksParams); err != nil { + return err + } + } + return nil +} + +func CreateV31UpgradeHandler(mm *module.Manager, cfg module.Configurator, appKeepers *keepers.AppKeepers) upgradetypes.UpgradeHandler { + runMigrations := createV31UpgradeHandler(mm, cfg) + return func(ctx context.Context, plan upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + if err := migrateLegacyContractCaps(ctx, &appKeepers.ClockKeeper, appKeepers.CWHooksKeeper.Params); err != nil { + return nil, err + } + return runMigrations(ctx, plan, vm) + } +} + +func createV31UpgradeHandler(mm migrationRunner, cfg module.Configurator) upgradetypes.UpgradeHandler { + return func(ctx context.Context, _ upgradetypes.Plan, vm module.VersionMap) (module.VersionMap, error) { + return mm.RunMigrations(ctx, cfg, vm) + } +} diff --git a/app/upgrades/v31/upgrades_test.go b/app/upgrades/v31/upgrades_test.go new file mode 100644 index 000000000..6ffec05f0 --- /dev/null +++ b/app/upgrades/v31/upgrades_test.go @@ -0,0 +1,101 @@ +package v31 + +import ( + "context" + "errors" + "testing" + + "github.com/stretchr/testify/require" + + storetypes "cosmossdk.io/store/types" + upgradetypes "cosmossdk.io/x/upgrade/types" + + "github.com/cosmos/cosmos-sdk/types/module" + + clocktypes "github.com/CosmosContracts/juno/v31/x/clock/types" + cwhookstypes "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" +) + +var errMigrationFailed = errors.New("migration failed") + +type clockParamsStoreStub struct { + params clocktypes.Params +} + +func (s *clockParamsStoreStub) GetParams(context.Context) clocktypes.Params { return s.params } +func (s *clockParamsStoreStub) SetParams(_ context.Context, params clocktypes.Params) error { + s.params = params + return nil +} + +type cwHooksParamsStoreStub struct { + params cwhookstypes.Params +} + +func (s *cwHooksParamsStoreStub) Get(context.Context) (cwhookstypes.Params, error) { + return s.params, nil +} + +func (s *cwHooksParamsStoreStub) Set(_ context.Context, params cwhookstypes.Params) error { + s.params = params + return nil +} + +func TestMigrateLegacyContractCaps(t *testing.T) { + clockStore := &clockParamsStoreStub{params: clocktypes.Params{ContractGasLimit: 250_000}} + cwHooksStore := &cwHooksParamsStoreStub{params: cwhookstypes.Params{ + ContractGasLimit: 250_000, + ContractFailureRemovalThreshold: 3, + }} + + err := migrateLegacyContractCaps(context.Background(), clockStore, cwHooksStore) + + require.NoError(t, err) + require.Equal(t, clocktypes.DefaultMaxContracts, clockStore.params.MaxContracts) + require.Equal(t, uint64(250_000), clockStore.params.ContractGasLimit) + require.Equal(t, cwhookstypes.DefaultMaxContracts, cwHooksStore.params.MaxContracts) + require.Equal(t, uint64(250_000), cwHooksStore.params.ContractGasLimit) + require.Equal(t, uint64(3), cwHooksStore.params.ContractFailureRemovalThreshold) +} + +type migrationRunnerStub struct { + gotVersionMap module.VersionMap + versionMap module.VersionMap + err error +} + +func (s *migrationRunnerStub) RunMigrations(_ context.Context, _ module.Configurator, vm module.VersionMap) (module.VersionMap, error) { + s.gotVersionMap = vm + return s.versionMap, s.err +} + +func TestUpgradeIdentityAndStoreUpgrades(t *testing.T) { + require.Equal(t, "v31", UpgradeName) + require.Equal(t, UpgradeName, Upgrade.UpgradeName) + require.Equal(t, storetypes.StoreUpgrades{}, Upgrade.StoreUpgrades) + require.Empty(t, Upgrade.StoreUpgrades.Added) + require.Empty(t, Upgrade.StoreUpgrades.Deleted) + require.Empty(t, Upgrade.StoreUpgrades.Renamed) +} + +func TestUpgradeHandlerReturnsMigrationVersionMap(t *testing.T) { + input := module.VersionMap{"bank": 3} + expected := module.VersionMap{"bank": 4} + runner := &migrationRunnerStub{versionMap: expected} + + got, err := createV31UpgradeHandler(runner, nil)(context.Background(), upgradetypes.Plan{Name: UpgradeName}, input) + + require.NoError(t, err) + require.Equal(t, input, runner.gotVersionMap) + require.Equal(t, expected, got) +} + +func TestUpgradeHandlerPropagatesMigrationError(t *testing.T) { + expectedErr := errMigrationFailed + runner := &migrationRunnerStub{err: expectedErr} + + got, err := createV31UpgradeHandler(runner, nil)(context.Background(), upgradetypes.Plan{Name: UpgradeName}, module.VersionMap{"bank": 3}) + + require.Nil(t, got) + require.ErrorIs(t, err, expectedErr) +} diff --git a/app/upgrades_v31_test.go b/app/upgrades_v31_test.go new file mode 100644 index 000000000..e93808f84 --- /dev/null +++ b/app/upgrades_v31_test.go @@ -0,0 +1,21 @@ +package app + +import ( + "testing" + + "github.com/stretchr/testify/require" + + v31 "github.com/CosmosContracts/juno/v31/app/upgrades/v31" +) + +func TestV31UpgradeRegistered(t *testing.T) { + matches := 0 + for _, upgrade := range Upgrades { + if upgrade.UpgradeName == v31.UpgradeName { + matches++ + require.Equal(t, v31.Upgrade.StoreUpgrades, upgrade.StoreUpgrades) + require.NotNil(t, upgrade.CreateUpgradeHandler) + } + } + require.Equal(t, 1, matches) +} diff --git a/buf.yaml b/buf.yaml index 46e949903..0523c5a85 100644 --- a/buf.yaml +++ b/buf.yaml @@ -4,10 +4,10 @@ modules: name: buf.build/CosmosContracts/juno deps: - buf.build/cosmos/cosmos-sdk:34ac2e8322d44db08830e553ad21b93c - - buf.build/cosmos/cosmos-proto - - buf.build/cosmos/gogo-proto - - buf.build/googleapis/googleapis - - buf.build/protocolbuffers/wellknowntypes + - buf.build/cosmos/cosmos-proto:04467658e59e44bbb22fe568206e1f70 + - buf.build/cosmos/gogo-proto:88ef6483f90f478fb938c37dde52ece3 + - buf.build/googleapis/googleapis:c17df5b2beca46928cc87d5656bd5343 + - buf.build/protocolbuffers/wellknowntypes:122a3d2fdc814e0bb6fcf821bcce7957 breaking: use: - FILE diff --git a/cmd/junod/cmd/balances_from_state_export.go b/cmd/junod/cmd/balances_from_state_export.go index be54f3171..6d81b33e9 100644 --- a/cmd/junod/cmd/balances_from_state_export.go +++ b/cmd/junod/cmd/balances_from_state_export.go @@ -1,7 +1,7 @@ package cmd // modified from osmosis -// https://github.com/CosmosContracts/juno/v30/blob/main/cmd/osmosisd/cmd/balances_from_state_export.go +// https://github.com/CosmosContracts/juno/v31/blob/main/cmd/osmosisd/cmd/balances_from_state_export.go import ( "encoding/csv" diff --git a/cmd/junod/cmd/commands.go b/cmd/junod/cmd/commands.go index dd2b587c8..14153a783 100644 --- a/cmd/junod/cmd/commands.go +++ b/cmd/junod/cmd/commands.go @@ -27,8 +27,8 @@ import ( authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - "github.com/CosmosContracts/juno/v30/app" - "github.com/CosmosContracts/juno/v30/cmd/junod/cmd/stream" + "github.com/CosmosContracts/juno/v31/app" + "github.com/CosmosContracts/juno/v31/cmd/junod/cmd/stream" ) var tempDir = func() string { diff --git a/cmd/junod/cmd/root.go b/cmd/junod/cmd/root.go index 3de450874..803fa5848 100644 --- a/cmd/junod/cmd/root.go +++ b/cmd/junod/cmd/root.go @@ -39,8 +39,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" - "github.com/CosmosContracts/juno/v30/app" - "github.com/CosmosContracts/juno/v30/cmd/junod/cmd/stream" + "github.com/CosmosContracts/juno/v31/app" + "github.com/CosmosContracts/juno/v31/cmd/junod/cmd/stream" ) var ( diff --git a/cmd/junod/cmd/stream/query.go b/cmd/junod/cmd/stream/query.go index f945b05d0..0cef98158 100644 --- a/cmd/junod/cmd/stream/query.go +++ b/cmd/junod/cmd/stream/query.go @@ -16,7 +16,7 @@ import ( "cosmossdk.io/client/v2/autocli" flagbuilder "cosmossdk.io/client/v2/autocli/flag" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) const StreamFlagName = "stream" diff --git a/cmd/junod/cmd/stream/runtime.go b/cmd/junod/cmd/stream/runtime.go index 0dbba0464..c53d824e9 100644 --- a/cmd/junod/cmd/stream/runtime.go +++ b/cmd/junod/cmd/stream/runtime.go @@ -23,8 +23,8 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - streamtypes "github.com/CosmosContracts/juno/v30/x/stream/types" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + streamtypes "github.com/CosmosContracts/juno/v31/x/stream/types" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) func runDynamicStreamCommand(cmd *cobra.Command, ctx client.Context, descriptor *encoding.MethodDescriptor, params map[string]string) error { diff --git a/cmd/junod/cmd/stream/utils.go b/cmd/junod/cmd/stream/utils.go index a67ec0502..db12c3760 100644 --- a/cmd/junod/cmd/stream/utils.go +++ b/cmd/junod/cmd/stream/utils.go @@ -15,7 +15,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) type methodContext struct { diff --git a/cmd/junod/main.go b/cmd/junod/main.go index bf70c0b6d..6d9c22d0a 100644 --- a/cmd/junod/main.go +++ b/cmd/junod/main.go @@ -7,8 +7,8 @@ import ( svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" - "github.com/CosmosContracts/juno/v30/app" - "github.com/CosmosContracts/juno/v30/cmd/junod/cmd" + "github.com/CosmosContracts/juno/v31/app" + "github.com/CosmosContracts/juno/v31/cmd/junod/cmd" ) func main() { diff --git a/docs/V31_STATE_REHEARSAL.md b/docs/V31_STATE_REHEARSAL.md new file mode 100644 index 000000000..d3c93fe8d --- /dev/null +++ b/docs/V31_STATE_REHEARSAL.md @@ -0,0 +1,205 @@ +# v31 state rehearsal + +This is the release-candidate gate for restarting representative Juno state on +v31. A unit test, a node merely reaching the tip, or an unrecorded successful +command is not sufficient. + +## Mandate + +Prove all three paths using immutable binaries and a mainnet-derived state +volume or representative extracted subset: + +1. `v30.0.0` export followed by a clean v31 genesis import. +2. Snapshot-based state sync into a clean v31 node. +3. The exact in-place `v30.0.0 -> v31` upgrade path. + +Never operate on the canonical validator home. Work on a read-only snapshot or +a cloned volume. Keep keys and private-validator state out of the rehearsal. + +## Inputs + +Record before execution in the evidence JSON: + +- source tag, full commit, and `sha256:` image digest; +- target full commit and `sha256:` image digest; +- chain ID and a non-empty, sanitized description of the source-state + provenance (provider/snapshot identity and source height, but no secrets); +- export, snapshot, trust, upgrade, and verification heights; +- every command used for the export/import, state-sync, and upgrade gates; +- the runner's identity and execution environment. + +Resolve tags to commits and images to registry digests before starting. The +source version must be exactly `v30.0.0`; do not substitute `latest` or a moving +branch. + +## Local deterministic gate + +```sh +go test ./app -run '^TestExportImportPreservesV31State$' -count=1 +go test ./x/feepay/types ./x/feepay/keeper -count=1 +python3 -m unittest scripts/rehearsal/test_validate_evidence.py +``` + +The app test performs a real application export into a fresh `InitChain` and +asserts that the FeePay ledger, module backing, wallet-use counters, +voting-snapshot current total, and module version map survive. + +## Docker state-sync gate + +From the repository root with the exact candidate image configured: + +```sh +make ictest-node +``` + +`TestStateSync` waits for a real application snapshot, creates a clean node, +state-syncs it through two providers, and verifies at one exact height: + +- provider and restored-node app hashes match; +- voting-snapshot parameters match; +- current total voting power matches; +- the node catches the provider tip. + +Preserve the test line beginning `state-sync verified:` in the evidence record. + +## Mainnet-derived rehearsal + +1. Clone the prepared state volume and remove all keyring, node key, and + private-validator files from the clone. +2. Start the clone with the digest-pinned `v30.0.0` binary and verify its app + hash against the source node at the same height. +3. Query and save the module version map, FeePay contracts/usages and module + account backing, and current voting-snapshot totals. For each module-version + map and wallet-usage snapshot, save the raw JSON array plus its canonical + count and SHA-256 as described below. +4. Stop v30 and export at the recorded height. Import that export into a clean + v31 home, start it at the documented initial height, and wait for a committed + block strictly after the export height before collecting post-import evidence. +5. Separately run the repository upgrade interchaintest using exact + `v30.0.0 -> v31` images from the repository root: + + ```sh + make ictest-upgrade + ``` +6. Query the same invariants after import/upgrade. Do not mark the run passed if + FeePay is under-backed, wallet usages reset, voting power changes, module + versions regress, or any node fails to catch up. +7. Save the result as JSON and validate it: + +```sh +python3 scripts/rehearsal/validate_evidence.py /path/to/evidence.json +``` + +## Evidence schema + +The validator is the executable schema. Use this shape (values are illustrative): + +```json +{ + "source": { + "version": "v30.0.0", + "git_commit": "<40 lowercase hex>", + "image_digest": "sha256:<64 lowercase hex>", + "chain_id": "juno-1", + "state_provenance": "sanitized snapshot/provider and source-height description" + }, + "target": { + "version": "v31", + "git_commit": "<40 lowercase hex>", + "image_digest": "sha256:<64 lowercase hex>" + }, + "runner": {"identity": "operator or CI identity", "environment": "runner/OS/architecture"}, + "commands": { + "export_import": ["", ""], + "state_sync": [""], + "upgrade": [""] + }, + "export_import": { + "export_height": 100, + "pre_export_app_hash_height": 100, + "pre_export_app_hash": "<64 lowercase hex>", + "post_import_app_hash_height": 101, + "post_import_app_hash": "<64 lowercase hex>", + "module_version_map": { + "pre_export": {"count": 3, "sha256": "<64 lowercase hex>"}, + "post_import": {"count": 3, "sha256": ""} + } + }, + "state_sync": { + "snapshot_height": 120, + "trust_height": 110, + "verified_height": 130, + "provider_app_hash_height": 130, + "provider_app_hash": "<64 lowercase hex>", + "synced_app_hash_height": 130, + "synced_app_hash": "<64 lowercase hex>" + }, + "upgrade": {"upgrade_height": 140, "verified_height": 141}, + "modules": { + "feepay": { + "pre_restart": { + "height": 100, + "ledger_total": "1000000ujuno", + "module_backing": "1000001ujuno", + "wallet_usages": {"count": 2, "sha256": "<64 lowercase hex>"} + }, + "post_restart": { + "height": 101, + "ledger_total": "1000000ujuno", + "module_backing": "1000001ujuno", + "wallet_usages": {"count": 2, "sha256": ""} + } + }, + "voting_snapshot": { + "pre_restart": {"height": 100, "total": "42"}, + "post_restart": {"height": 101, "total": "42"}, + "queryable": true + } + }, + "result": {"export_import_passed": true, "state_sync_passed": true, "upgrade_passed": true} +} +``` + +All heights are positive JSON integers (not strings or booleans). The +`pre_export_app_hash_height` must equal `export_height`, while +`post_import_app_hash_height` must be strictly greater than `export_height` so +that the evidence proves the imported node committed a post-restart block. App +hashes are exactly 64 lowercase hexadecimal characters, and provider/restored +hashes are compared only at the shared `verified_height`. FeePay totals are +structured as pre/post evidence at exact heights. Coin strings are +comma-separated positive arbitrary-precision integer amounts with denoms; +backing may contain surplus amounts or additional denoms, but must cover every +ledger denom and amount. Pre/post ledgers must be equal. Voting totals are +positive integer strings, must be non-zero, and must be equal across the +restart. + +### Canonical collection evidence + +Boolean claims are not evidence. `module_version_map_preserved` and +`wallet_usages_preserved` are unsupported. For each phase, retain the raw JSON +array and record both its element count and the SHA-256 of a canonical JSON +line: + +```sh +# Input arrays are extracted from the exact-height query/export JSON first. +jq -cS 'sort_by(.name, .version)' module-versions-array.json \ + | tee module-versions.canonical.json | sha256sum +jq 'length' module-versions-array.json + +jq -cS 'sort_by(.contract_address, .wallet_address, .uses)' wallet-usages-array.json \ + | tee wallet-usages.canonical.json | sha256sum +jq 'length' wallet-usages-array.json +``` + +The SHA-256 covers the UTF-8 bytes emitted by `jq`, including its terminating +newline. `-S` sorts every object's keys; `sort_by` fixes array order. Extract +FeePay arrays from `app_state.feepay.wallet_usages` in the export at the exact +pre/post heights, and extract module versions from the exact-height upgrade +module-version query response. Store the raw source JSON, canonical JSON, count, +and checksum in the rehearsal attachment. The validator requires non-negative +integer counts and lowercase 64-hex SHA-256 values, and compares the complete +`(count, sha256)` pair across pre/post phases. A zero-count wallet-usage array is +valid evidence; it still has a deterministic SHA-256. + +Attach sanitized logs, the JSON record, and checksums to the release candidate; +never attach homes, databases, keys, or private validator state. diff --git a/go.mod b/go.mod index e10ba1f2f..ee91667e3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ -module github.com/CosmosContracts/juno/v30 +module github.com/CosmosContracts/juno/v31 -go 1.25.2 +go 1.25.10 tool ( github.com/bufbuild/buf/cmd/buf @@ -27,17 +27,18 @@ require ( cosmossdk.io/x/feegrant v0.2.0 cosmossdk.io/x/tx v0.14.0 cosmossdk.io/x/upgrade v0.2.0 - github.com/CosmWasm/wasmd v0.61.11 - github.com/CosmWasm/wasmvm/v3 v3.0.4 + github.com/CosmWasm/wasmd v0.61.14 + github.com/CosmWasm/wasmvm/v3 v3.0.7 + github.com/CosmosContracts/juno/v30 v30.0.0 github.com/bdpiprava/scalar-go v0.12.1 - github.com/cometbft/cometbft v0.38.23 + github.com/cometbft/cometbft v0.38.25 github.com/cosmos/cosmos-db v1.1.3 - github.com/cosmos/cosmos-sdk v0.53.7 + github.com/cosmos/cosmos-sdk v0.53.8 github.com/cosmos/gogoproto v1.7.2 github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v10 v10.6.0 github.com/cosmos/ibc-apps/modules/ibc-hooks/v10 v10.0.0 github.com/cosmos/ibc-go/modules/capability v1.0.1 - github.com/cosmos/ibc-go/v10 v10.6.0 + github.com/cosmos/ibc-go/v10 v10.7.0 github.com/golang/protobuf v1.5.4 github.com/google/uuid v1.6.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 @@ -47,8 +48,8 @@ require ( github.com/spf13/viper v1.21.0 github.com/stretchr/testify v1.11.1 go.uber.org/mock v0.6.0 - google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b - google.golang.org/grpc v1.79.3 + google.golang.org/genproto/googleapis/api v0.0.0-20260414002931-afd174a4e478 + google.golang.org/grpc v1.82.1 gopkg.in/yaml.v3 v3.0.1 gotest.tools/v3 v3.5.2 ) @@ -144,7 +145,7 @@ require ( github.com/DataDog/datadog-go v4.8.3+incompatible // indirect github.com/DataDog/zstd v1.5.7 // indirect github.com/Djarvur/go-err113 v0.1.1 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 // indirect github.com/Masterminds/semver/v3 v3.3.1 // indirect @@ -189,7 +190,7 @@ require ( github.com/chzyer/readline v1.5.1 // indirect github.com/ckaznocha/intrange v0.3.1 // indirect github.com/cloudwego/base64x v0.1.6 // indirect - github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 // indirect + github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/errors v1.12.0 // indirect github.com/cockroachdb/fifo v0.0.0-20240616162244-4768e80dfb9a // indirect @@ -222,8 +223,8 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/envoyproxy/go-control-plane/envoy v1.36.0 // indirect - github.com/envoyproxy/protoc-gen-validate v1.3.0 // indirect + github.com/envoyproxy/go-control-plane/envoy v1.37.0 // indirect + github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect github.com/ettle/strcase v0.2.0 // indirect github.com/fatih/color v1.18.0 // indirect github.com/fatih/structtag v1.2.0 // indirect @@ -428,35 +429,35 @@ require ( go.etcd.io/bbolt v1.4.0-alpha.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/contrib/detectors/gcp v1.39.0 // indirect + go.opentelemetry.io/contrib/detectors/gcp v1.44.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect - go.opentelemetry.io/otel v1.40.0 // indirect - go.opentelemetry.io/otel/metric v1.40.0 // indirect - go.opentelemetry.io/otel/sdk v1.40.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.40.0 // indirect - go.opentelemetry.io/otel/trace v1.40.0 // indirect + go.opentelemetry.io/otel v1.44.0 // indirect + go.opentelemetry.io/otel/metric v1.44.0 // indirect + go.opentelemetry.io/otel/sdk v1.44.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.44.0 // indirect + go.opentelemetry.io/otel/trace v1.44.0 // indirect go.uber.org/automaxprocs v1.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/arch v0.17.0 // indirect - golang.org/x/crypto v0.51.0 // indirect + golang.org/x/crypto v0.53.0 // indirect golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b // indirect golang.org/x/exp/typeparams v0.0.0-20250911091902-df9299821621 // indirect - golang.org/x/mod v0.35.0 // indirect - golang.org/x/net v0.55.0 // indirect - golang.org/x/oauth2 v0.34.0 // indirect - golang.org/x/sync v0.20.0 // indirect - golang.org/x/sys v0.45.0 // indirect - golang.org/x/term v0.43.0 // indirect - golang.org/x/text v0.37.0 // indirect + golang.org/x/mod v0.37.0 // indirect + golang.org/x/net v0.56.0 // indirect + golang.org/x/oauth2 v0.36.0 // indirect + golang.org/x/sync v0.21.0 // indirect + golang.org/x/sys v0.46.0 // indirect + golang.org/x/term v0.44.0 // indirect + golang.org/x/text v0.39.0 // indirect golang.org/x/time v0.12.0 // indirect - golang.org/x/tools v0.44.0 // indirect + golang.org/x/tools v0.47.0 // indirect google.golang.org/api v0.247.0 // indirect google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 // indirect google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 // indirect google.golang.org/protobuf v1.36.11 gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 9f4d397c4..812c5ad5a 100644 --- a/go.sum +++ b/go.sum @@ -713,10 +713,12 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/toml v1.5.0 h1:W5quZX/G/csjUnuI8SUYlsHs9M38FC7znL0lIO+DvMg= github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/CosmWasm/wasmd v0.61.11 h1:p7kAJACHHexQQSdoFgCvxa1pkbZotDEeAZCsyJhvFrE= -github.com/CosmWasm/wasmd v0.61.11/go.mod h1:pfuEzkWBQ24nVfMrMBNGHh5Gmr/RBk4kIdQGiIIV68A= -github.com/CosmWasm/wasmvm/v3 v3.0.4 h1:nccZU7jzH3bSMnHzXE7JjpSfeXayv6IUcpugdRVX5uc= -github.com/CosmWasm/wasmvm/v3 v3.0.4/go.mod h1:oknpb1bFERvvKcY7vHRp1F/Y/z66xVrsl7n9uWkOAlM= +github.com/CosmWasm/wasmd v0.61.14 h1:SUWM32AC/i1RiAedvJdCxR74YLzqZlwUD+9TRHCEUB4= +github.com/CosmWasm/wasmd v0.61.14/go.mod h1:T61FkmvyR7FUpI0LJ++tqUJwUynRLROgKQVIr4RLKnc= +github.com/CosmWasm/wasmvm/v3 v3.0.7 h1:jNndgpVJ1EFAY61oy6GhmZCSCWbd+rp1LlkTftHPW+A= +github.com/CosmWasm/wasmvm/v3 v3.0.7/go.mod h1:oknpb1bFERvvKcY7vHRp1F/Y/z66xVrsl7n9uWkOAlM= +github.com/CosmosContracts/juno/v30 v30.0.0 h1:J6PYFK+1gSfRDrDDiSwaT8zkhrrnL1VxwzzWDCeZWDg= +github.com/CosmosContracts/juno/v30 v30.0.0/go.mod h1:HH0XppeC35N3holZ3MGzTcAUsFi2Z+o4gngXYWduvy4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= @@ -724,8 +726,8 @@ github.com/DataDog/zstd v1.5.7 h1:ybO8RBeh29qrxIhCA9E8gKY6xfONU9T6G6aP9DTKfLE= github.com/DataDog/zstd v1.5.7/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Djarvur/go-err113 v0.1.1 h1:eHfopDqXRwAi+YmCUas75ZE0+hoBHJ2GQNLYRSxao4g= github.com/Djarvur/go-err113 v0.1.1/go.mod h1:IaWJdYFLg76t2ihfflPZnM1LIQszWOsFDh2hhhAVF6k= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 h1:sBEjpZlNHzK1voKq9695PJSX2o5NEXl7/OL3coiIY0c= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0/go.mod h1:P4WPRUkOhJC13W//jWpyfJNDAIpvRbAUIYLX/4jtlE0= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 h1:rIkQfkCOVKc1OiRCNcSDD8ml5RJlZbH/Xsq7lbpynwc= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0/go.mod h1:RD2SsorTmYhF6HkTmDw7KmPYQk8OBYwTkuasChwv7R4= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 h1:fYE9p3esPxA/C0rQ0AHhP0drtPXDRhaWiwg1DPqO7IU= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0/go.mod h1:BnBReJLvVYx2CS/UHOgVz2BXKXD9wsQPxZug20nZhd0= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.51.0 h1:OqVGm6Ei3x5+yZmSJG1Mh2NwHvpVmZ08CB5qJhT9Nuk= @@ -924,8 +926,8 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 h1:6xNmx7iTtyBRev0+D/Tv1FZd4SCg8axKApyNyRsAt/w= -github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5/go.mod h1:KdCmV+x/BuvyMxRnYBlmVaq4OLiKW6iRQfvC62cvdkI= +github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 h1:aBangftG7EVZoUb69Os8IaYg++6uMOdKK83QtkkvJik= +github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2/go.mod h1:qwXFYgsP6T7XnJtbKlf1HP8AjxZZyzxMmc+Lq5GjlU4= 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/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= @@ -944,8 +946,8 @@ github.com/cockroachdb/redact v1.1.6/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.23 h1:jtCe5Do4EcHVf/FCyZMvkBm+AmsRGGyvswImXYAabdM= -github.com/cometbft/cometbft v0.38.23/go.mod h1:jtH//cs5e2U5dNiaYIPMBwWXZsedXJfIie77gVhuRaA= +github.com/cometbft/cometbft v0.38.25 h1:jtGSyssudmkjED2fk9wFGfd/fNyPKvLIinW62ELxZH4= +github.com/cometbft/cometbft v0.38.25/go.mod h1:jtH//cs5e2U5dNiaYIPMBwWXZsedXJfIie77gVhuRaA= github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -968,8 +970,8 @@ github.com/cosmos/cosmos-db v1.1.3 h1:7QNT77+vkefostcKkhrzDK9uoIEryzFrU9eoMeaQOP github.com/cosmos/cosmos-db v1.1.3/go.mod h1:kN+wGsnwUJZYn8Sy5Q2O0vCYA99MJllkKASbs6Unb9U= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.53.7 h1:CqY48EB118WuR2EcTobiFACOQbfP8Dyyb5C5nAOq3XM= -github.com/cosmos/cosmos-sdk v0.53.7/go.mod h1:N6YuprhAabInbT3YGumGDKONbvPX5dNro7RjHvkQoKE= +github.com/cosmos/cosmos-sdk v0.53.8 h1:rKQIgqifo3Izv/JQLpPIjReOJ7jK+Qh8Rt8GIttDADw= +github.com/cosmos/cosmos-sdk v0.53.8/go.mod h1:b/De6uhCfooGEy4kE5G4C0A+MxK9aPr0nZNMyR+PmY0= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -985,8 +987,8 @@ github.com/cosmos/ibc-apps/modules/ibc-hooks/v10 v10.0.0 h1:mQHn+4JZDq+woZPS8/T3 github.com/cosmos/ibc-apps/modules/ibc-hooks/v10 v10.0.0/go.mod h1:YQmJRjlqccu5hFwnPeY4xcOQoJ2SEuMQGD1u32jREc0= github.com/cosmos/ibc-go/modules/capability v1.0.1 h1:ibwhrpJ3SftEEZRxCRkH0fQZ9svjthrX2+oXdZvzgGI= github.com/cosmos/ibc-go/modules/capability v1.0.1/go.mod h1:rquyOV262nGJplkumH+/LeYs04P3eV8oB7ZM4Ygqk4E= -github.com/cosmos/ibc-go/v10 v10.6.0 h1:k7PZVSLXFtCdoWlU+ERGn2m1Np4Tw8BF8WyPGl0DOi4= -github.com/cosmos/ibc-go/v10 v10.6.0/go.mod h1:a74pAPUSJ7NewvmvELU74hUClJhwnmm5MGbEaiTw/kE= +github.com/cosmos/ibc-go/v10 v10.7.0 h1:lE1nsilDP4SUiD7mhgdF9X3f1T4sa7Lt8CiH8Qy1jzg= +github.com/cosmos/ibc-go/v10 v10.7.0/go.mod h1:a74pAPUSJ7NewvmvELU74hUClJhwnmm5MGbEaiTw/kE= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= @@ -1077,16 +1079,16 @@ github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJ github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= github.com/envoyproxy/go-control-plane v0.14.0 h1:hbG2kr4RuFj222B6+7T83thSPqLjwBIfQawTkC++2HA= github.com/envoyproxy/go-control-plane v0.14.0/go.mod h1:NcS5X47pLl/hfqxU70yPwL9ZMkUlwlKxtAohpi2wBEU= -github.com/envoyproxy/go-control-plane/envoy v1.36.0 h1:yg/JjO5E7ubRyKX3m07GF3reDNEnfOboJ0QySbH736g= -github.com/envoyproxy/go-control-plane/envoy v1.36.0/go.mod h1:ty89S1YCCVruQAm9OtKeEkQLTb+Lkz0k8v9W0Oxsv98= +github.com/envoyproxy/go-control-plane/envoy v1.37.0 h1:u3riX6BoYRfF4Dr7dwSOroNfdSbEPe9Yyl09/B6wBrQ= +github.com/envoyproxy/go-control-plane/envoy v1.37.0/go.mod h1:DReE9MMrmecPy+YvQOAOHNYMALuowAnbjjEMkkWOi6A= github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 h1:/G9QYbddjL25KvtKTv3an9lx6VBE2cnb8wp1vEGNYGI= github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJPzVVHnPgRKdUdwW/KdbRt94AzgRee4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= -github.com/envoyproxy/protoc-gen-validate v1.3.0 h1:TvGH1wof4H33rezVKWSpqKz5NXWg5VPuZ0uONDT6eb4= -github.com/envoyproxy/protoc-gen-validate v1.3.0/go.mod h1:HvYl7zwPa5mffgyeTUHA9zHIH36nmrm7oCbo4YKoSWA= +github.com/envoyproxy/protoc-gen-validate v1.3.3 h1:MVQghNeW+LZcmXe7SY1V36Z+WFMDjpqGAGacLe2T0ds= +github.com/envoyproxy/protoc-gen-validate v1.3.3/go.mod h1:TsndJ/ngyIdQRhMcVVGDDHINPLWB7C82oDArY51KfB0= github.com/ethereum/go-ethereum v1.17.0 h1:2D+1Fe23CwZ5tQoAS5DfwKFNI1HGcTwi65/kRlAVxes= github.com/ethereum/go-ethereum v1.17.0/go.mod h1:2W3msvdosS/MCWytpqTcqgFiRYbTH59FxDJzqah120o= github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= @@ -2075,28 +2077,30 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/contrib/detectors/gcp v1.39.0 h1:kWRNZMsfBHZ+uHjiH4y7Etn2FK26LAGkNFw7RHv1DhE= -go.opentelemetry.io/contrib/detectors/gcp v1.39.0/go.mod h1:t/OGqzHBa5v6RHZwrDBJ2OirWc+4q/w2fTbLZwAKjTk= +go.opentelemetry.io/contrib/detectors/gcp v1.44.0 h1:NmLfL734pJhM0JKaYd2Y28+nY9dPRWYAAbxhRCrKXPw= +go.opentelemetry.io/contrib/detectors/gcp v1.44.0/go.mod h1:tNAsgd8avTGke1+MndXlU5Cru4PQ9Ai/cCNWQv/ZJ/s= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 h1:q4XOmH/0opmeuJtPsbFNivyl7bCt7yRBbeEm2sC/XtQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0/go.mod h1:snMWehoOh2wsEwnvvwtDyFCxVeDAODenXHtn5vzrKjo= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.40.0 h1:oA5YeOcpRTXq6NN7frwmwFR0Cn3RhTVZvXsP4duvCms= -go.opentelemetry.io/otel v1.40.0/go.mod h1:IMb+uXZUKkMXdPddhwAHm6UfOwJyh4ct1ybIlV14J0g= +go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= +go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 h1:f0cb2XPmrqn4XMy9PNliTgRKJgS5WcL/u0/WRYGz4t0= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0/go.mod h1:vnakAaFckOMiMtOIhFI2MNH4FYrZzXCYxmb1LlhoGz8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 h1:Ckwye2FpXkYgiHX7fyVrN1uA/UYd9ounqqTuSNAv0k4= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0/go.mod h1:teIFJh5pW2y+AN7riv6IBPX2DuesS3HgP39mwOspKwU= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.35.0 h1:PB3Zrjs1sG1GBX51SXyTSoOTqcDglmsk7nT6tkKPb/k= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.35.0/go.mod h1:U2R3XyVPzn0WX7wOIypPuptulsMcPDPs/oiSVOMVnHY= -go.opentelemetry.io/otel/metric v1.40.0 h1:rcZe317KPftE2rstWIBitCdVp89A2HqjkxR3c11+p9g= -go.opentelemetry.io/otel/metric v1.40.0/go.mod h1:ib/crwQH7N3r5kfiBZQbwrTge743UDc7DTFVZrrXnqc= -go.opentelemetry.io/otel/sdk v1.40.0 h1:KHW/jUzgo6wsPh9At46+h4upjtccTmuZCFAc9OJ71f8= -go.opentelemetry.io/otel/sdk v1.40.0/go.mod h1:Ph7EFdYvxq72Y8Li9q8KebuYUr2KoeyHx0DRMKrYBUE= -go.opentelemetry.io/otel/sdk/metric v1.40.0 h1:mtmdVqgQkeRxHgRv4qhyJduP3fYJRMX4AtAlbuWdCYw= -go.opentelemetry.io/otel/sdk/metric v1.40.0/go.mod h1:4Z2bGMf0KSK3uRjlczMOeMhKU2rhUqdWNoKcYrtcBPg= -go.opentelemetry.io/otel/trace v1.40.0 h1:WA4etStDttCSYuhwvEa8OP8I5EWu24lkOzp+ZYblVjw= -go.opentelemetry.io/otel/trace v1.40.0/go.mod h1:zeAhriXecNGP/s2SEG3+Y8X9ujcJOTqQ5RgdEJcawiA= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/metric/x v0.66.0 h1:YkCrx1zLOChi9ZcZ6euupOcsgzbVlec7D/xoEU1+cTA= +go.opentelemetry.io/otel/metric/x v0.66.0/go.mod h1:d1+BDj9t96do0/1LoU1ayfCv79ZgNE41qbhBvnMOBZk= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI= +go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= @@ -2150,8 +2154,8 @@ golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= -golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI= -golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= +golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= +golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -2221,8 +2225,8 @@ golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.13.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= -golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ= +golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -2298,8 +2302,8 @@ golang.org/x/net v0.16.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= -golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= -golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= +golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= +golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -2329,8 +2333,8 @@ golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= -golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= -golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= +golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= 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= @@ -2352,8 +2356,8 @@ golang.org/x/sync v0.4.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= 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= @@ -2468,8 +2472,8 @@ golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= -golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= 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= @@ -2485,8 +2489,8 @@ golang.org/x/term v0.13.0/go.mod h1:LTmsnFJwVN6bCy1rVCoS+qHT1HhALEFxKncY3WNNh4U= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= -golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= -golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= +golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2507,8 +2511,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/text v0.39.0 h1:UbZz4pLOvn600D6Oh6GGEI6VAmndrEBLv8/6BEXzyus= +golang.org/x/text v0.39.0/go.mod h1:3UwRclnC2g0TU9x8PZiyfOajCd1zaUNHF9cvqcQZ+ZM= 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= @@ -2597,8 +2601,8 @@ golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.14.0/go.mod h1:uYBEerGOWcJyEORxN+Ek8+TT266gXkNlHdJBwexUsBg= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= -golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +golang.org/x/tools v0.47.0 h1:7Kn5x/d1svx/PzryTsqeoZN4TZwqeH5pGWjefhLi/1Q= +golang.org/x/tools v0.47.0/go.mod h1:dFHnyTvFWY212G+h7ZY4Vsp/K3U4/7W9TyVaAul8uCA= golang.org/x/tools/go/expect v0.1.1-deprecated h1:jpBZDwmgPhXsKZC6WhL20P4b/wmnpsEAGHaNy0n/rJM= golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated h1:1h2MnaIAIXISqTFKdENegdpAgUXz6NrPEsbIeWaBRvM= @@ -2615,8 +2619,8 @@ gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJ gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= @@ -2828,10 +2832,10 @@ google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOl google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/genproto v0.0.0-20250603155806-513f23925822 h1:rHWScKit0gvAPuOnu87KpaYtjK5zBMLcULh7gxkCXu4= google.golang.org/genproto v0.0.0-20250603155806-513f23925822/go.mod h1:HubltRL7rMh0LfnQPkMH4NPDFEWp0jw3vixw7jEM53s= -google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b h1:uA40e2M6fYRBf0+8uN5mLlqUtV192iiksiICIBkYJ1E= -google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:Xa7le7qx2vmqB/SzWUBa7KdMjpdpAHlh5QCSnjessQk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3 h1:C4WAdL+FbjnGlpp2S+HMVhBeCq2Lcib4xZqfPNF6OoQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/genproto/googleapis/api v0.0.0-20260414002931-afd174a4e478 h1:yQugLulqltosq0B/f8l4w9VryjV+N/5gcW0jQ3N8Qec= +google.golang.org/genproto/googleapis/api v0.0.0-20260414002931-afd174a4e478/go.mod h1:C6ADNqOxbgdUUeRTU+LCHDPB9ttAMCTff6auwCVa4uc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 h1:RmoJA1ujG+/lRGNfUnOMfhCy5EipVMyvUE+KNbPbTlw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= 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= @@ -2879,8 +2883,8 @@ google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5v google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE= -google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= +google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE= +google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1 h1:F29+wU6Ee6qgu9TddPgooOdaqsxTMunOoj8KA5yuS5A= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.5.1/go.mod h1:5KF+wpkbTSbGcR9zteSqZV6fqFOWBl4Yde8En8MryZA= diff --git a/interchaintest/contracts/DAO_DAO_ARTIFACTS.md b/interchaintest/contracts/DAO_DAO_ARTIFACTS.md new file mode 100644 index 000000000..117e4ef57 --- /dev/null +++ b/interchaintest/contracts/DAO_DAO_ARTIFACTS.md @@ -0,0 +1,28 @@ +# DAO DAO cw4 interchaintest artifacts + +These WebAssembly binaries are checked in so the interchaintest has no network +dependency and never downloads executable bytes at runtime. The test computes +SHA-256 over every required file before storing any contract on chain. + +## Provenance + +| File | Authoritative tagged release asset | SHA-256 | +| --- | --- | --- | +| `dao_dao_core.wasm` | [`DA0-DA0/dao-contracts` v2.7.0](https://github.com/DA0-DA0/dao-contracts/releases/download/v2.7.0/dao_dao_core.wasm) | `5d078fc9aec04df18c335446eb8df03d24c73ee745f76fd39624d4c5fa768b4c` | +| `dao_proposal_single.wasm` | [`DA0-DA0/dao-contracts` v2.7.0](https://github.com/DA0-DA0/dao-contracts/releases/download/v2.7.0/dao_proposal_single.wasm) | `e38fc5bb1b5e74ef154340567c673492515498b2120e5f15b0c990cd9fa5fe6a` | +| `dao_voting_cw4.wasm` | [`DA0-DA0/dao-contracts` v2.7.0](https://github.com/DA0-DA0/dao-contracts/releases/download/v2.7.0/dao_voting_cw4.wasm) | `d0e6bac4d7c1861f36328e7c0367f863999f999e2ae21df612e301eea5fe90d8` | +| `cw4_group.wasm` | [`CosmWasm/cw-plus` v1.1.2](https://github.com/CosmWasm/cw-plus/releases/download/v1.1.2/cw4_group.wasm) | `dd2216f1114fc68bc4c043701b02e55ce3e5598cdeb616985388215a400db277` | +| `voting_power_probe.wasm` | Source-controlled build in [`voting-power-probe/`](voting-power-probe/) | `124d427ff478ec1d026f5412b72892db76a961b066989a299f66bcfb13d0b11a` | + +The DAO DAO values are copied from that tagged GitHub release's +`checksums.txt`. The cw4-group value is copied from the cw-plus v1.1.2 +release's `checksums.txt`. Release assets were fetched once during repository +maintenance, compared with those manifests, and then committed. They are not +built ad hoc or fetched by test code. + +To audit the checked-in bytes locally: + +```sh +cd interchaintest/contracts +sha256sum cw4_group.wasm dao_voting_cw4.wasm dao_proposal_single.wasm dao_dao_core.wasm voting_power_probe.wasm +``` diff --git a/interchaintest/contracts/cw4_group.wasm b/interchaintest/contracts/cw4_group.wasm index 57bc3199c..18c226142 100644 Binary files a/interchaintest/contracts/cw4_group.wasm and b/interchaintest/contracts/cw4_group.wasm differ diff --git a/interchaintest/contracts/dao_dao_core.wasm b/interchaintest/contracts/dao_dao_core.wasm index 1d6772684..4c6da6fb2 100644 Binary files a/interchaintest/contracts/dao_dao_core.wasm and b/interchaintest/contracts/dao_dao_core.wasm differ diff --git a/interchaintest/contracts/dao_proposal_single.wasm b/interchaintest/contracts/dao_proposal_single.wasm index b158efd9a..12541f19d 100644 Binary files a/interchaintest/contracts/dao_proposal_single.wasm and b/interchaintest/contracts/dao_proposal_single.wasm differ diff --git a/interchaintest/contracts/dao_voting_cw4.wasm b/interchaintest/contracts/dao_voting_cw4.wasm index 82a67bf89..82edb5e7b 100644 Binary files a/interchaintest/contracts/dao_voting_cw4.wasm and b/interchaintest/contracts/dao_voting_cw4.wasm differ diff --git a/interchaintest/contracts/voting-power-probe/.cargo/config.toml b/interchaintest/contracts/voting-power-probe/.cargo/config.toml new file mode 100644 index 000000000..363ae406a --- /dev/null +++ b/interchaintest/contracts/voting-power-probe/.cargo/config.toml @@ -0,0 +1,6 @@ +[target.wasm32-unknown-unknown] +# CosmWasm contracts intentionally import host functions (storage, address, +# cryptography, debug, and chain queries) supplied by wasmvm at runtime. +# Rust 1.85's bundled wasm-ld rejects those imports unless this target-only +# policy is explicit. Bulk memory is disabled for wasmvm compatibility. +rustflags = ["-C", "target-feature=-bulk-memory", "-C", "link-arg=--allow-undefined"] diff --git a/interchaintest/contracts/voting-power-probe/.dockerignore b/interchaintest/contracts/voting-power-probe/.dockerignore new file mode 100644 index 000000000..2f7896d1d --- /dev/null +++ b/interchaintest/contracts/voting-power-probe/.dockerignore @@ -0,0 +1 @@ +target/ diff --git a/interchaintest/contracts/voting-power-probe/.gitignore b/interchaintest/contracts/voting-power-probe/.gitignore new file mode 100644 index 000000000..2f7896d1d --- /dev/null +++ b/interchaintest/contracts/voting-power-probe/.gitignore @@ -0,0 +1 @@ +target/ diff --git a/interchaintest/contracts/voting-power-probe/Cargo.lock b/interchaintest/contracts/voting-power-probe/Cargo.lock new file mode 100644 index 000000000..d808730db --- /dev/null +++ b/interchaintest/contracts/voting-power-probe/Cargo.lock @@ -0,0 +1,1061 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "rayon", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rayon", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", + "rayon", +] + +[[package]] +name = "autocfg" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bech32" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32637268377fc7b10a8c6d51de3e7fba1ce5dd371a96e342b34e6078db558e7f" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bnum" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "cosmwasm-core" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9899c6499b006d10e5dc64052e642d365f239ba00339615e2714c50c6aa86389" + +[[package]] +name = "cosmwasm-crypto" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55a3f5419d8f6ee9ae698db5a3d5d34ecd4ff82e8b5694bba7a620403c862717" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "cosmwasm-core", + "curve25519-dalek", + "digest", + "ecdsa", + "ed25519-zebra", + "k256", + "num-traits", + "p256", + "rand_core", + "rayon", + "sha2", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a625e259b6ab0cae1a758adf9a68a11ecddd023d1ab3d9c5d1785c144663c81" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "cosmwasm-schema" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede043e335be6ab524be4f16de872f7172e8a8a5751498a81467e054db6c569" +dependencies = [ + "cosmwasm-schema-derive", + "schemars", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cosmwasm-schema-derive" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e05cba18647b211a79b337d64049af2bdba2e88714374c55eb569436f7b699b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "cosmwasm-std" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26819b0207082f8045d710ebd532f53c545798983d601647245869b81fb63759" +dependencies = [ + "base64", + "bech32", + "bnum", + "cosmwasm-core", + "cosmwasm-crypto", + "cosmwasm-derive", + "derive_more", + "hex", + "rand_core", + "rmp-serde", + "schemars", + "serde", + "serde-json-wasm", + "sha2", + "static_assertions", + "thiserror", +] + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5181e0de7b61eb03a81e347d6dd8797bae9da5146707b51077e2d71a54ec0ceb" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d6914041f254d6e9176c01941b21115dcfb7089e55135a35411081bd106ef3f" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61803da095bee82a81bb1a452ecc25d3b2f1416d1897eb86430c6159ef717c17" + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", + "unicode-xid", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.5", + "hex", + "rand_core", + "sha2", + "zeroize", +] + +[[package]] +name = "either" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5e8f6c15a24b9a3ee5efec809ccd006d3b30e8b3bb63c39af737c7f87daa1d" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "generic-array" +version = "0.14.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bb6743198531e02858aeaea5398fcc883e71851fcbcb5a2f773e2fb6cb1edf2" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "libc" +version = "0.2.189" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3eaf3ede3fee6db1a4c2ee091bf8a8b4dccdc6d17f656fb07896ee72867612f2" + +[[package]] +name = "memchr" +version = "2.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" + +[[package]] +name = "num-bigint" +version = "0.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro2" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985e7ec9bb745e6ce6535b544d84d6cd6f7ad8bd711c398938ae983b91a766d9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fbf4db142a473a8d80c26bbf18454ed458bf8d26c8219c331daecfdbd079001" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" +dependencies = [ + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb39b166781f92d482534ef4b4b1b2568f42613b53e5b6c160e24cfbfa30926d" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22e18b0f0062d30d4230b2e85ff77fdfe4326feb054b9783a3460d8435c8ab91" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rmp" +version = "0.8.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ba8be72d372b2c9b35542551678538b562e7cf86c3315773cae48dfbfe7790c" +dependencies = [ + "num-traits", +] + +[[package]] +name = "rmp-serde" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72f81bee8c8ef9b577d1681a70ebbc962c232461e397b22c208c43c04b67a155" +dependencies = [ + "rmp", + "serde", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.119", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4148590afebada386688f18773da617792bf2ef03ffc1e4cbd2b1d45b023e0ba" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde-json-wasm" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f05da0d153dd4595bdffd5099dc0e9ce425b205ee648eb93437ff7302af8c9a5" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_core" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67dca2c9c51e58a4791a4b1ed58308b39c64224d349a935ab5039aa360942a48" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.229" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348" +dependencies = [ + "proc-macro2", + "quote", + "syn 3.0.3", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "serde_json" +version = "1.0.151" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.119" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e9bae58849f64dfa4f5d5ae372c8341f7305f82a3868709269343628b659a3" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "typenum" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "voting-power-probe" +version = "0.1.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "schemars", + "serde", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "zerocopy" +version = "0.8.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "556764e583adb45a9f8d413c2a147fa7e8d821e48e12b14fd560b607998b75eb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2ab42fc20575779bd240faa45f94a74256f755c0fa9e89f0ede20d91d0cdfc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zeroize" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13c156562582aa81c60cb29407084cdb54c4164760106ab78e6c5b0858cf64e" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c50655cbb0fe3fc43170059e702f1ce5e19b84cec58dc87b037a09935c2f328" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "zmij" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29666d0abbfad1e3dc4dcf6144730dd3a3ab225bbbdac83319345b1b44ccfc1b" diff --git a/interchaintest/contracts/voting-power-probe/Cargo.toml b/interchaintest/contracts/voting-power-probe/Cargo.toml new file mode 100644 index 000000000..8f1615581 --- /dev/null +++ b/interchaintest/contracts/voting-power-probe/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "voting-power-probe" +version = "0.1.0" +edition = "2021" +license = "Apache-2.0" +publish = false + +[lib] +crate-type = ["cdylib", "rlib"] + +[dependencies] +cosmwasm-schema = "2.2.2" +cosmwasm-std = "2.2.2" +schemars = "0.8.22" +serde = { version = "1.0", features = ["derive"] } + +[profile.release] +codegen-units = 1 +incremental = false +lto = true +opt-level = "z" +overflow-checks = true +panic = "abort" +strip = true diff --git a/interchaintest/contracts/voting-power-probe/Dockerfile b/interchaintest/contracts/voting-power-probe/Dockerfile new file mode 100644 index 000000000..63a259f3b --- /dev/null +++ b/interchaintest/contracts/voting-power-probe/Dockerfile @@ -0,0 +1,33 @@ +# syntax=docker/dockerfile:1 +# linux/amd64 manifest for the official rust:1.85.1-bookworm image. +FROM rust:1.85.1-bookworm@sha256:bf7d87666c4da6eace19e06d21bc4859c6e2a5c97a21ac273b0e082112753cf0 AS builder + +ARG BINARYEN_VERSION=120 +ARG BINARYEN_SHA256=ddb097af51d1bdb17300d986b0de7d97422f1933dedb4c9eda3510e0bf4076cc +ARG ARTIFACT_SHA256=124d427ff478ec1d026f5412b72892db76a961b066989a299f66bcfb13d0b11a + +RUN rustc --version | grep -Fx 'rustc 1.85.1 (4eb161250 2025-03-15)' \ + && rustup target add wasm32-unknown-unknown \ + && curl -fsSL \ + "https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/binaryen-version_${BINARYEN_VERSION}-x86_64-linux.tar.gz" \ + -o /tmp/binaryen.tar.gz \ + && echo "${BINARYEN_SHA256} /tmp/binaryen.tar.gz" | sha256sum --check --strict \ + && tar -xzf /tmp/binaryen.tar.gz -C /opt \ + && ln -s "/opt/binaryen-version_${BINARYEN_VERSION}/bin/wasm-opt" /usr/local/bin/wasm-opt \ + && wasm-opt --version | grep -Fx "wasm-opt version ${BINARYEN_VERSION} (version_${BINARYEN_VERSION})" \ + && rm /tmp/binaryen.tar.gz + +WORKDIR /build +COPY Cargo.toml Cargo.lock ./ +COPY .cargo .cargo +COPY src src + +RUN cargo test --locked \ + && cargo build --release --locked --target wasm32-unknown-unknown \ + && wasm-opt --disable-bulk-memory -Oz \ + target/wasm32-unknown-unknown/release/voting_power_probe.wasm \ + -o /voting_power_probe.wasm \ + && echo "${ARTIFACT_SHA256} /voting_power_probe.wasm" | sha256sum --check --strict + +FROM scratch AS artifact +COPY --from=builder /voting_power_probe.wasm /voting_power_probe.wasm diff --git a/interchaintest/contracts/voting-power-probe/README.md b/interchaintest/contracts/voting-power-probe/README.md new file mode 100644 index 000000000..62edaefba --- /dev/null +++ b/interchaintest/contracts/voting-power-probe/README.md @@ -0,0 +1,45 @@ +# Voting-power probe contract + +Minimal, stateless CosmWasm contract used by the v31 interchaintest to exercise all three Juno `x/voting-snapshot` custom queries from inside wasmvm: + +- `voting_power_at` +- `total_voting_power_at` +- `voting_power_over_range` + +The checked-in optimized artifact is `../voting_power_probe.wasm`. + +## Reproducible build + +The authoritative build is the source-controlled [`Dockerfile`](Dockerfile). It pins: + +- the official `rust:1.85.1-bookworm` linux/amd64 image by its platform-manifest digest (`sha256:bf7d87666c4da6eace19e06d21bc4859c6e2a5c97a21ac273b0e082112753cf0`); and +- Binaryen `version_120` by the SHA-256 of its upstream linux/amd64 release archive (`ddb097af51d1bdb17300d986b0de7d97422f1933dedb4c9eda3510e0bf4076cc`). + +The image verifies `rustc` and `wasm-opt` version output, runs the Rust tests, builds with `Cargo.lock`, optimizes the contract, and rejects an artifact whose checksum is not the expected value. BuildKit can export only the resulting Wasm file: + +```sh +cd interchaintest/contracts/voting-power-probe +rm -rf target/reproducible +docker buildx build --target artifact --output type=local,dest=target/reproducible . +cmp target/reproducible/voting_power_probe.wasm ../voting_power_probe.wasm +sha256sum target/reproducible/voting_power_probe.wasm ../voting_power_probe.wasm +``` + +This build is intentionally linux/amd64 because the pinned Binaryen archive is architecture-specific. The tag in the `FROM` line is descriptive; the digest, not the mutable tag, selects the Rust image. `rust-toolchain.toml` also pins direct host Cargo invocations to Rust 1.85.1, but host rebuilds are only equivalent when `wasm-opt --version` identifies version 120: + +```sh +cargo test --locked +cargo build --release --locked --target wasm32-unknown-unknown +wasm-opt --disable-bulk-memory -Oz \ + target/wasm32-unknown-unknown/release/voting_power_probe.wasm \ + -o target/voting_power_probe.host.wasm +cmp target/voting_power_probe.host.wasm ../voting_power_probe.wasm +``` + +Expected SHA-256: + +```text +124d427ff478ec1d026f5412b72892db76a961b066989a299f66bcfb13d0b11a voting_power_probe.wasm +``` + +`.cargo/config.toml` makes CosmWasm's wasmvm host imports explicit for the pinned Rust toolchain's bundled linker. The setting applies only to the Wasm target. diff --git a/interchaintest/contracts/voting-power-probe/rust-toolchain.toml b/interchaintest/contracts/voting-power-probe/rust-toolchain.toml new file mode 100644 index 000000000..5cfcda6fb --- /dev/null +++ b/interchaintest/contracts/voting-power-probe/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "1.85.1" +profile = "minimal" +targets = ["wasm32-unknown-unknown"] diff --git a/interchaintest/contracts/voting-power-probe/src/lib.rs b/interchaintest/contracts/voting-power-probe/src/lib.rs new file mode 100644 index 000000000..06b9f1578 --- /dev/null +++ b/interchaintest/contracts/voting-power-probe/src/lib.rs @@ -0,0 +1,172 @@ +use cosmwasm_schema::{cw_serde, QueryResponses}; +use cosmwasm_std::{ + entry_point, to_json_binary, Binary, Deps, DepsMut, Env, MessageInfo, QueryRequest, + Response, StdResult, +}; +use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; + +#[cw_serde] +pub struct InstantiateMsg {} + +#[cw_serde] +#[derive(QueryResponses)] +pub enum QueryMsg { + #[returns(VotingPowerResponse)] + VotingPowerAt { address: String, height: i64 }, + #[returns(VotingPowerResponse)] + TotalVotingPowerAt { height: i64 }, + #[returns(VotingPowerOverRangeResponse)] + VotingPowerOverRange { + address: String, + from_height: i64, + to_height: i64, + }, +} + +#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)] +#[serde(rename_all = "snake_case")] +pub enum JunoQuery { + VotingPowerAt { address: String, height: i64 }, + TotalVotingPowerAt { height: i64 }, + VotingPowerOverRange { + address: String, + from_height: i64, + to_height: i64, + }, +} + +impl cosmwasm_std::CustomQuery for JunoQuery {} + +#[cw_serde] +pub struct VotingPowerResponse { + pub power: String, +} + +#[cw_serde] +pub struct HeightPowerPair { + pub height: i64, + pub power: String, +} + +#[cw_serde] +pub struct VotingPowerOverRangeResponse { + pub rows: Vec, +} + +#[entry_point] +pub fn instantiate( + _deps: DepsMut, + _env: Env, + _info: MessageInfo, + _msg: InstantiateMsg, +) -> StdResult { + Ok(Response::new().add_attribute("action", "instantiate_voting_power_probe")) +} + +#[entry_point] +pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { + match msg { + QueryMsg::VotingPowerAt { address, height } => { + let response: VotingPowerResponse = deps.querier.query(&QueryRequest::Custom( + JunoQuery::VotingPowerAt { address, height }, + ))?; + to_json_binary(&response) + } + QueryMsg::TotalVotingPowerAt { height } => { + let response: VotingPowerResponse = deps.querier.query(&QueryRequest::Custom( + JunoQuery::TotalVotingPowerAt { height }, + ))?; + to_json_binary(&response) + } + QueryMsg::VotingPowerOverRange { + address, + from_height, + to_height, + } => { + let response: VotingPowerOverRangeResponse = deps.querier.query( + &QueryRequest::Custom(JunoQuery::VotingPowerOverRange { + address, + from_height, + to_height, + }), + )?; + to_json_binary(&response) + } + } +} + +#[cfg(test)] +mod tests { + use super::*; + use cosmwasm_std::testing::{message_info, mock_env, MockApi, MockQuerier, MockStorage}; + use cosmwasm_std::{from_json, Addr, ContractResult, OwnedDeps, SystemResult}; + use std::marker::PhantomData; + + fn deps_with_custom_handler() -> OwnedDeps, JunoQuery> { + let querier = MockQuerier::new(&[]).with_custom_handler(|query| { + let response = match query { + JunoQuery::VotingPowerAt { .. } | JunoQuery::TotalVotingPowerAt { .. } => { + to_json_binary(&VotingPowerResponse { power: "42".to_owned() }).unwrap() + } + JunoQuery::VotingPowerOverRange { .. } => to_json_binary( + &VotingPowerOverRangeResponse { + rows: vec![HeightPowerPair { height: 7, power: "42".to_owned() }], + }, + ) + .unwrap(), + }; + SystemResult::Ok(ContractResult::Ok(response)) + }); + OwnedDeps { + storage: MockStorage::default(), + api: MockApi::default(), + querier, + custom_query_type: PhantomData, + } + } + + #[test] + fn forwards_all_custom_query_variants() { + let mut deps = deps_with_custom_handler(); + instantiate( + deps.as_mut(), + mock_env(), + message_info(&Addr::unchecked("creator"), &[]), + InstantiateMsg {}, + ) + .unwrap(); + + let power: VotingPowerResponse = from_json( + query( + deps.as_ref(), + mock_env(), + QueryMsg::VotingPowerAt { address: "juno1voter".to_owned(), height: 12 }, + ) + .unwrap(), + ) + .unwrap(); + assert_eq!(power.power, "42"); + + let total: VotingPowerResponse = from_json( + query(deps.as_ref(), mock_env(), QueryMsg::TotalVotingPowerAt { height: 12 }).unwrap(), + ) + .unwrap(); + assert_eq!(total.power, "42"); + + let range: VotingPowerOverRangeResponse = from_json( + query( + deps.as_ref(), + mock_env(), + QueryMsg::VotingPowerOverRange { + address: "juno1voter".to_owned(), + from_height: 7, + to_height: 12, + }, + ) + .unwrap(), + ) + .unwrap(); + assert_eq!(range.rows, vec![HeightPowerPair { height: 7, power: "42".to_owned() }]); + } +} diff --git a/interchaintest/contracts/voting_power_probe.wasm b/interchaintest/contracts/voting_power_probe.wasm new file mode 100644 index 000000000..eee54c2bf Binary files /dev/null and b/interchaintest/contracts/voting_power_probe.wasm differ diff --git a/interchaintest/go.mod b/interchaintest/go.mod index fcb002b5c..3604eb118 100644 --- a/interchaintest/go.mod +++ b/interchaintest/go.mod @@ -1,18 +1,18 @@ module github.com/CosmosContracts/juno/tests/interchaintest -go 1.25.2 +go 1.25.10 // For this nested module, you always want to replace the parent reference with the current worktree. -replace github.com/CosmosContracts/juno/v30 v30.0.0 => ../ +replace github.com/CosmosContracts/juno/v31 v31.0.0 => ../ require ( cosmossdk.io/math v1.5.3 cosmossdk.io/x/nft v0.2.0 cosmossdk.io/x/upgrade v0.2.0 - github.com/CosmWasm/wasmd v0.61.11 - github.com/CosmosContracts/juno/v30 v30.0.0 - github.com/cosmos/cosmos-sdk v0.53.7 - github.com/cosmos/ibc-go/v10 v10.6.0 + github.com/CosmWasm/wasmd v0.61.14 + github.com/CosmosContracts/juno/v31 v31.0.0 + github.com/cosmos/cosmos-sdk v0.53.8 + github.com/cosmos/ibc-go/v10 v10.7.0 github.com/cosmos/interchaintest/v10 v10.0.0 github.com/moby/moby v27.5.1+incompatible // main branch of x/builder with sdk 0.5x support @@ -45,10 +45,10 @@ require ( github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.2 // indirect github.com/BurntSushi/toml v1.5.0 // indirect - github.com/CosmWasm/wasmvm/v3 v3.0.4 // indirect + github.com/CosmWasm/wasmvm/v3 v3.0.7 // indirect github.com/DataDog/datadog-go v4.8.3+incompatible // indirect github.com/DataDog/zstd v1.5.7 // indirect - github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect + github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 // indirect github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 // indirect github.com/Microsoft/go-winio v0.6.2 // indirect @@ -65,14 +65,14 @@ require ( github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cloudwego/base64x v0.1.6 // indirect - github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 // indirect + github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 // indirect github.com/cockroachdb/errors v1.12.0 // indirect github.com/cockroachdb/fifo v0.0.0-20240616162244-4768e80dfb9a // indirect github.com/cockroachdb/logtags v0.0.0-20241215232642-bb51bb14a506 // indirect github.com/cockroachdb/pebble v1.1.5 // indirect github.com/cockroachdb/redact v1.1.6 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.23 + github.com/cometbft/cometbft v0.38.25 github.com/cometbft/cometbft-db v0.14.1 // indirect github.com/consensys/gnark-crypto v0.18.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -101,8 +101,8 @@ require ( github.com/dustin/go-humanize v1.0.1 // indirect github.com/dvsekhvalnov/jose2go v1.7.0 // indirect github.com/emicklei/dot v1.6.2 // indirect - github.com/envoyproxy/go-control-plane/envoy v1.36.0 // indirect - github.com/envoyproxy/protoc-gen-validate v1.3.0 // indirect + github.com/envoyproxy/go-control-plane/envoy v1.37.0 // indirect + github.com/envoyproxy/protoc-gen-validate v1.3.3 // indirect github.com/ethereum/c-kzg-4844/v2 v2.1.5 // indirect github.com/ethereum/go-ethereum v1.17.0 // indirect github.com/fatih/color v1.18.0 // indirect @@ -223,35 +223,35 @@ require ( go.etcd.io/bbolt v1.4.0-alpha.1 // indirect go.opencensus.io v0.24.0 // indirect go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/contrib/detectors/gcp v1.39.0 // indirect + go.opentelemetry.io/contrib/detectors/gcp v1.44.0 // indirect go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect - go.opentelemetry.io/otel v1.40.0 // indirect - go.opentelemetry.io/otel/metric v1.40.0 // indirect - go.opentelemetry.io/otel/sdk v1.40.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.40.0 // indirect - go.opentelemetry.io/otel/trace v1.40.0 // indirect + go.opentelemetry.io/otel v1.44.0 // indirect + go.opentelemetry.io/otel/metric v1.44.0 // indirect + go.opentelemetry.io/otel/sdk v1.44.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.44.0 // indirect + go.opentelemetry.io/otel/trace v1.44.0 // indirect go.uber.org/mock v0.6.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.yaml.in/yaml/v2 v2.4.3 // indirect go.yaml.in/yaml/v3 v3.0.4 // indirect golang.org/x/arch v0.17.0 // indirect - golang.org/x/crypto v0.51.0 // indirect + golang.org/x/crypto v0.53.0 // indirect golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b // indirect - golang.org/x/mod v0.35.0 // indirect - golang.org/x/net v0.55.0 // indirect - golang.org/x/oauth2 v0.34.0 // indirect - golang.org/x/sync v0.20.0 - golang.org/x/sys v0.45.0 // indirect - golang.org/x/term v0.43.0 // indirect - golang.org/x/text v0.37.0 // indirect + golang.org/x/mod v0.37.0 // indirect + golang.org/x/net v0.56.0 // indirect + golang.org/x/oauth2 v0.36.0 // indirect + golang.org/x/sync v0.21.0 + golang.org/x/sys v0.46.0 // indirect + golang.org/x/term v0.44.0 // indirect + golang.org/x/text v0.39.0 // indirect golang.org/x/time v0.12.0 // indirect - golang.org/x/tools v0.44.0 // indirect + golang.org/x/tools v0.47.0 // indirect google.golang.org/api v0.247.0 // indirect google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3 // indirect - google.golang.org/grpc v1.79.3 + google.golang.org/genproto/googleapis/api v0.0.0-20260414002931-afd174a4e478 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 // indirect + google.golang.org/grpc v1.82.1 google.golang.org/protobuf v1.36.11 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/interchaintest/go.sum b/interchaintest/go.sum index a1b1f01ac..6dc01b7f0 100644 --- a/interchaintest/go.sum +++ b/interchaintest/go.sum @@ -659,17 +659,17 @@ github.com/BurntSushi/toml v1.5.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= -github.com/CosmWasm/wasmd v0.61.11 h1:p7kAJACHHexQQSdoFgCvxa1pkbZotDEeAZCsyJhvFrE= -github.com/CosmWasm/wasmd v0.61.11/go.mod h1:pfuEzkWBQ24nVfMrMBNGHh5Gmr/RBk4kIdQGiIIV68A= -github.com/CosmWasm/wasmvm/v3 v3.0.4 h1:nccZU7jzH3bSMnHzXE7JjpSfeXayv6IUcpugdRVX5uc= -github.com/CosmWasm/wasmvm/v3 v3.0.4/go.mod h1:oknpb1bFERvvKcY7vHRp1F/Y/z66xVrsl7n9uWkOAlM= +github.com/CosmWasm/wasmd v0.61.14 h1:SUWM32AC/i1RiAedvJdCxR74YLzqZlwUD+9TRHCEUB4= +github.com/CosmWasm/wasmd v0.61.14/go.mod h1:T61FkmvyR7FUpI0LJ++tqUJwUynRLROgKQVIr4RLKnc= +github.com/CosmWasm/wasmvm/v3 v3.0.7 h1:jNndgpVJ1EFAY61oy6GhmZCSCWbd+rp1LlkTftHPW+A= +github.com/CosmWasm/wasmvm/v3 v3.0.7/go.mod h1:oknpb1bFERvvKcY7vHRp1F/Y/z66xVrsl7n9uWkOAlM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/datadog-go v4.8.3+incompatible h1:fNGaYSuObuQb5nzeTQqowRAd9bpDIRRV4/gUtIBjh8Q= github.com/DataDog/datadog-go v4.8.3+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.7 h1:ybO8RBeh29qrxIhCA9E8gKY6xfONU9T6G6aP9DTKfLE= github.com/DataDog/zstd v1.5.7/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 h1:sBEjpZlNHzK1voKq9695PJSX2o5NEXl7/OL3coiIY0c= -github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0/go.mod h1:P4WPRUkOhJC13W//jWpyfJNDAIpvRbAUIYLX/4jtlE0= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0 h1:rIkQfkCOVKc1OiRCNcSDD8ml5RJlZbH/Xsq7lbpynwc= +github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.32.0/go.mod h1:RD2SsorTmYhF6HkTmDw7KmPYQk8OBYwTkuasChwv7R4= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0 h1:fYE9p3esPxA/C0rQ0AHhP0drtPXDRhaWiwg1DPqO7IU= github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.51.0/go.mod h1:BnBReJLvVYx2CS/UHOgVz2BXKXD9wsQPxZug20nZhd0= github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/cloudmock v0.51.0 h1:OqVGm6Ei3x5+yZmSJG1Mh2NwHvpVmZ08CB5qJhT9Nuk= @@ -801,8 +801,8 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20220314180256-7f1daf1720fc/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230105202645-06c439db220b/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= -github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5 h1:6xNmx7iTtyBRev0+D/Tv1FZd4SCg8axKApyNyRsAt/w= -github.com/cncf/xds/go v0.0.0-20251210132809-ee656c7534f5/go.mod h1:KdCmV+x/BuvyMxRnYBlmVaq4OLiKW6iRQfvC62cvdkI= +github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2 h1:aBangftG7EVZoUb69Os8IaYg++6uMOdKK83QtkkvJik= +github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2/go.mod h1:qwXFYgsP6T7XnJtbKlf1HP8AjxZZyzxMmc+Lq5GjlU4= 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/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= @@ -821,8 +821,8 @@ github.com/cockroachdb/redact v1.1.6/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.23 h1:jtCe5Do4EcHVf/FCyZMvkBm+AmsRGGyvswImXYAabdM= -github.com/cometbft/cometbft v0.38.23/go.mod h1:jtH//cs5e2U5dNiaYIPMBwWXZsedXJfIie77gVhuRaA= +github.com/cometbft/cometbft v0.38.25 h1:jtGSyssudmkjED2fk9wFGfd/fNyPKvLIinW62ELxZH4= +github.com/cometbft/cometbft v0.38.25/go.mod h1:jtH//cs5e2U5dNiaYIPMBwWXZsedXJfIie77gVhuRaA= github.com/cometbft/cometbft-db v0.14.1 h1:SxoamPghqICBAIcGpleHbmoPqy+crij/++eZz3DlerQ= github.com/cometbft/cometbft-db v0.14.1/go.mod h1:KHP1YghilyGV/xjD5DP3+2hyigWx0WTp9X+0Gnx0RxQ= github.com/consensys/gnark-crypto v0.18.1 h1:RyLV6UhPRoYYzaFnPQA4qK3DyuDgkTgskDdoGqFt3fI= @@ -843,8 +843,8 @@ github.com/cosmos/cosmos-db v1.1.3 h1:7QNT77+vkefostcKkhrzDK9uoIEryzFrU9eoMeaQOP github.com/cosmos/cosmos-db v1.1.3/go.mod h1:kN+wGsnwUJZYn8Sy5Q2O0vCYA99MJllkKASbs6Unb9U= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.53.7 h1:CqY48EB118WuR2EcTobiFACOQbfP8Dyyb5C5nAOq3XM= -github.com/cosmos/cosmos-sdk v0.53.7/go.mod h1:N6YuprhAabInbT3YGumGDKONbvPX5dNro7RjHvkQoKE= +github.com/cosmos/cosmos-sdk v0.53.8 h1:rKQIgqifo3Izv/JQLpPIjReOJ7jK+Qh8Rt8GIttDADw= +github.com/cosmos/cosmos-sdk v0.53.8/go.mod h1:b/De6uhCfooGEy4kE5G4C0A+MxK9aPr0nZNMyR+PmY0= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -854,8 +854,8 @@ github.com/cosmos/gogoproto v1.7.2 h1:5G25McIraOC0mRFv9TVO139Uh3OklV2hczr13KKVHC github.com/cosmos/gogoproto v1.7.2/go.mod h1:8S7w53P1Y1cHwND64o0BnArT6RmdgIvsBuco6uTllsk= github.com/cosmos/iavl v1.2.6 h1:Hs3LndJbkIB+rEvToKJFXZvKo6Vy0Ex1SJ54hhtioIs= github.com/cosmos/iavl v1.2.6/go.mod h1:GiM43q0pB+uG53mLxLDzimxM9l/5N9UuSY3/D0huuVw= -github.com/cosmos/ibc-go/v10 v10.6.0 h1:k7PZVSLXFtCdoWlU+ERGn2m1Np4Tw8BF8WyPGl0DOi4= -github.com/cosmos/ibc-go/v10 v10.6.0/go.mod h1:a74pAPUSJ7NewvmvELU74hUClJhwnmm5MGbEaiTw/kE= +github.com/cosmos/ibc-go/v10 v10.7.0 h1:lE1nsilDP4SUiD7mhgdF9X3f1T4sa7Lt8CiH8Qy1jzg= +github.com/cosmos/ibc-go/v10 v10.7.0/go.mod h1:a74pAPUSJ7NewvmvELU74hUClJhwnmm5MGbEaiTw/kE= github.com/cosmos/ics23/go v0.11.0 h1:jk5skjT0TqX5e5QJbEnwXIS2yI2vnmLOgpQPeM5RtnU= github.com/cosmos/ics23/go v0.11.0/go.mod h1:A8OjxPE67hHST4Icw94hOxxFEJMBG031xIGF/JHNIY0= github.com/cosmos/interchain-security/v7 v7.0.0-20250408210344-06e0dc6bf6d6 h1:SzJ/+uqrTsJmI+f/GqPdC4lGxgDQKYvtRCMXFdJljNM= @@ -935,16 +935,16 @@ github.com/envoyproxy/go-control-plane v0.10.3/go.mod h1:fJJn/j26vwOu972OllsvAgJ github.com/envoyproxy/go-control-plane v0.11.1-0.20230524094728-9239064ad72f/go.mod h1:sfYdkwUW4BA3PbKjySwjJy+O4Pu0h62rlqCMHNk+K+Q= github.com/envoyproxy/go-control-plane v0.14.0 h1:hbG2kr4RuFj222B6+7T83thSPqLjwBIfQawTkC++2HA= github.com/envoyproxy/go-control-plane v0.14.0/go.mod h1:NcS5X47pLl/hfqxU70yPwL9ZMkUlwlKxtAohpi2wBEU= -github.com/envoyproxy/go-control-plane/envoy v1.36.0 h1:yg/JjO5E7ubRyKX3m07GF3reDNEnfOboJ0QySbH736g= -github.com/envoyproxy/go-control-plane/envoy v1.36.0/go.mod h1:ty89S1YCCVruQAm9OtKeEkQLTb+Lkz0k8v9W0Oxsv98= +github.com/envoyproxy/go-control-plane/envoy v1.37.0 h1:u3riX6BoYRfF4Dr7dwSOroNfdSbEPe9Yyl09/B6wBrQ= +github.com/envoyproxy/go-control-plane/envoy v1.37.0/go.mod h1:DReE9MMrmecPy+YvQOAOHNYMALuowAnbjjEMkkWOi6A= github.com/envoyproxy/go-control-plane/ratelimit v0.1.0 h1:/G9QYbddjL25KvtKTv3an9lx6VBE2cnb8wp1vEGNYGI= github.com/envoyproxy/go-control-plane/ratelimit v0.1.0/go.mod h1:Wk+tMFAFbCXaJPzVVHnPgRKdUdwW/KdbRt94AzgRee4= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/envoyproxy/protoc-gen-validate v0.6.7/go.mod h1:dyJXwwfPK2VSqiB9Klm1J6romD608Ba7Hij42vrOBCo= github.com/envoyproxy/protoc-gen-validate v0.9.1/go.mod h1:OKNgG7TCp5pF4d6XftA0++PMirau2/yoOwVac3AbF2w= github.com/envoyproxy/protoc-gen-validate v0.10.1/go.mod h1:DRjgyB0I43LtJapqN6NiRwroiAU2PaFuvk/vjgh61ss= -github.com/envoyproxy/protoc-gen-validate v1.3.0 h1:TvGH1wof4H33rezVKWSpqKz5NXWg5VPuZ0uONDT6eb4= -github.com/envoyproxy/protoc-gen-validate v1.3.0/go.mod h1:HvYl7zwPa5mffgyeTUHA9zHIH36nmrm7oCbo4YKoSWA= +github.com/envoyproxy/protoc-gen-validate v1.3.3 h1:MVQghNeW+LZcmXe7SY1V36Z+WFMDjpqGAGacLe2T0ds= +github.com/envoyproxy/protoc-gen-validate v1.3.3/go.mod h1:TsndJ/ngyIdQRhMcVVGDDHINPLWB7C82oDArY51KfB0= github.com/ethereum/c-kzg-4844/v2 v2.1.5 h1:aVtoLK5xwJ6c5RiqO8g8ptJ5KU+2Hdquf6G3aXiHh5s= github.com/ethereum/c-kzg-4844/v2 v2.1.5/go.mod h1:u59hRTTah4Co6i9fDWtiCjTrblJv0UwsqZKCc0GfgUs= github.com/ethereum/go-bigmodexpfix v0.0.0-20250911101455-f9e208c548ab h1:rvv6MJhy07IMfEKuARQ9TKojGqLVNxQajaXEp/BoqSk= @@ -1735,28 +1735,30 @@ go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= -go.opentelemetry.io/contrib/detectors/gcp v1.39.0 h1:kWRNZMsfBHZ+uHjiH4y7Etn2FK26LAGkNFw7RHv1DhE= -go.opentelemetry.io/contrib/detectors/gcp v1.39.0/go.mod h1:t/OGqzHBa5v6RHZwrDBJ2OirWc+4q/w2fTbLZwAKjTk= +go.opentelemetry.io/contrib/detectors/gcp v1.44.0 h1:NmLfL734pJhM0JKaYd2Y28+nY9dPRWYAAbxhRCrKXPw= +go.opentelemetry.io/contrib/detectors/gcp v1.44.0/go.mod h1:tNAsgd8avTGke1+MndXlU5Cru4PQ9Ai/cCNWQv/ZJ/s= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 h1:q4XOmH/0opmeuJtPsbFNivyl7bCt7yRBbeEm2sC/XtQ= go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0/go.mod h1:snMWehoOh2wsEwnvvwtDyFCxVeDAODenXHtn5vzrKjo= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 h1:RbKq8BG0FI8OiXhBfcRtqqHcZcka+gU3cskNuf05R18= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0/go.mod h1:h06DGIukJOevXaj/xrNjhi/2098RZzcLTbc0jDAUbsg= -go.opentelemetry.io/otel v1.40.0 h1:oA5YeOcpRTXq6NN7frwmwFR0Cn3RhTVZvXsP4duvCms= -go.opentelemetry.io/otel v1.40.0/go.mod h1:IMb+uXZUKkMXdPddhwAHm6UfOwJyh4ct1ybIlV14J0g= +go.opentelemetry.io/otel v1.44.0 h1:JjwHmHpA4iZ3wBxluu2fbbE7j4kqlE8jXyAyPXH7HqU= +go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0 h1:f0cb2XPmrqn4XMy9PNliTgRKJgS5WcL/u0/WRYGz4t0= go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.39.0/go.mod h1:vnakAaFckOMiMtOIhFI2MNH4FYrZzXCYxmb1LlhoGz8= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0 h1:Ckwye2FpXkYgiHX7fyVrN1uA/UYd9ounqqTuSNAv0k4= go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.39.0/go.mod h1:teIFJh5pW2y+AN7riv6IBPX2DuesS3HgP39mwOspKwU= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.35.0 h1:PB3Zrjs1sG1GBX51SXyTSoOTqcDglmsk7nT6tkKPb/k= go.opentelemetry.io/otel/exporters/stdout/stdoutmetric v1.35.0/go.mod h1:U2R3XyVPzn0WX7wOIypPuptulsMcPDPs/oiSVOMVnHY= -go.opentelemetry.io/otel/metric v1.40.0 h1:rcZe317KPftE2rstWIBitCdVp89A2HqjkxR3c11+p9g= -go.opentelemetry.io/otel/metric v1.40.0/go.mod h1:ib/crwQH7N3r5kfiBZQbwrTge743UDc7DTFVZrrXnqc= -go.opentelemetry.io/otel/sdk v1.40.0 h1:KHW/jUzgo6wsPh9At46+h4upjtccTmuZCFAc9OJ71f8= -go.opentelemetry.io/otel/sdk v1.40.0/go.mod h1:Ph7EFdYvxq72Y8Li9q8KebuYUr2KoeyHx0DRMKrYBUE= -go.opentelemetry.io/otel/sdk/metric v1.40.0 h1:mtmdVqgQkeRxHgRv4qhyJduP3fYJRMX4AtAlbuWdCYw= -go.opentelemetry.io/otel/sdk/metric v1.40.0/go.mod h1:4Z2bGMf0KSK3uRjlczMOeMhKU2rhUqdWNoKcYrtcBPg= -go.opentelemetry.io/otel/trace v1.40.0 h1:WA4etStDttCSYuhwvEa8OP8I5EWu24lkOzp+ZYblVjw= -go.opentelemetry.io/otel/trace v1.40.0/go.mod h1:zeAhriXecNGP/s2SEG3+Y8X9ujcJOTqQ5RgdEJcawiA= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/metric/x v0.66.0 h1:YkCrx1zLOChi9ZcZ6euupOcsgzbVlec7D/xoEU1+cTA= +go.opentelemetry.io/otel/metric/x v0.66.0/go.mod h1:d1+BDj9t96do0/1LoU1ayfCv79ZgNE41qbhBvnMOBZk= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/metric v1.44.0 h1:3LlKgI+VjbVsjNRFZJZAJ30WjXC5VkNRks6si09iEfI= +go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.opentelemetry.io/proto/otlp v0.15.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= go.opentelemetry.io/proto/otlp v0.19.0/go.mod h1:H7XAot3MsfNsj7EXtrA2q5xSNQ10UqI405h3+duxN4U= @@ -1805,8 +1807,8 @@ golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliY golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= -golang.org/x/crypto v0.51.0 h1:IBPXwPfKxY7cWQZ38ZCIRPI50YLeevDLlLnyC5wRGTI= -golang.org/x/crypto v0.51.0/go.mod h1:8AdwkbraGNABw2kOX6YFPs3WM22XqI4EXEd8g+x7Oc8= +golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= +golang.org/x/crypto v0.53.0/go.mod h1:DNLU434OwVakk9PzuwV8w62mAJpRJL3vsgcfp4Qnsio= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1870,8 +1872,8 @@ golang.org/x/mod v0.9.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= -golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM= -golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU= +golang.org/x/mod v0.37.0 h1:vF1DjpVEshcIqoEaauuHebaLk1O1forxjxBaVn884JQ= +golang.org/x/mod v0.37.0/go.mod h1:m8S8VeM9r4dzDwjrKO0a1sZP3YjeMamRRlD+fmR2Q/0= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1946,8 +1948,8 @@ golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= -golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8= -golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww= +golang.org/x/net v0.56.0 h1:Rw8j/hFzGvJUZwNBXnAtf5sVDVt+65SK2C7IxCxZt5o= +golang.org/x/net v0.56.0/go.mod h1:D3Ku6r+V6JROoZK144D2XfMHFcMq/0zSfLelVTCFKec= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1977,8 +1979,8 @@ golang.org/x/oauth2 v0.4.0/go.mod h1:RznEsdpjGAINPTOF0UH/t+xJ75L18YO3Ho6Pyn+uRec golang.org/x/oauth2 v0.5.0/go.mod h1:9/XBHVqLaWO3/BRHs5jbpYCnOZVjj5V0ndyaAM7KB4I= golang.org/x/oauth2 v0.6.0/go.mod h1:ycmewcwgD4Rpr3eZJLSB4Kyyljb3qDh40vJ8STE5HKw= golang.org/x/oauth2 v0.7.0/go.mod h1:hPLQkd9LyjfXTiRohC/41GhcFqxisoUQ99sCUOHO9x4= -golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw= -golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs= +golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= 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= @@ -1999,8 +2001,8 @@ golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= -golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4= -golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sync v0.21.0 h1:HLII4xRRTtCRkxYp4HNFF0Js/Og6q2i++KXbg0gHCwM= +golang.org/x/sync v0.21.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= 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= @@ -2112,8 +2114,8 @@ golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY= -golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/sys v0.46.0 h1:noSf2Fq6F8DBgS+LysIkx7rIExoNHJsxOAtPp4rthXw= +golang.org/x/sys v0.46.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE= 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= @@ -2128,8 +2130,8 @@ golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= -golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4= -golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk= +golang.org/x/term v0.44.0 h1:0rLvDRCtNj0gZkyIXhCyOb2OAzEhLVqc4B+hrsBhrmc= +golang.org/x/term v0.44.0/go.mod h1:7ze4MdzUzLXpSAoFP1H0bOI9aXDqveSvatT5vKcFh2Y= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2150,8 +2152,8 @@ golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= -golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc= -golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38= +golang.org/x/text v0.39.0 h1:UbZz4pLOvn600D6Oh6GGEI6VAmndrEBLv8/6BEXzyus= +golang.org/x/text v0.39.0/go.mod h1:3UwRclnC2g0TU9x8PZiyfOajCd1zaUNHF9cvqcQZ+ZM= 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= @@ -2235,8 +2237,8 @@ golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= golang.org/x/tools v0.7.0/go.mod h1:4pg6aUX35JBAogB10C9AtvVL+qowtN4pT3CGSQex14s= golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= -golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c= -golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI= +golang.org/x/tools v0.47.0 h1:7Kn5x/d1svx/PzryTsqeoZN4TZwqeH5pGWjefhLi/1Q= +golang.org/x/tools v0.47.0/go.mod h1:dFHnyTvFWY212G+h7ZY4Vsp/K3U4/7W9TyVaAul8uCA= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -2249,8 +2251,8 @@ gonum.org/v1/gonum v0.0.0-20180816165407-929014505bf4/go.mod h1:Y+Yx5eoAFn32cQvJ gonum.org/v1/gonum v0.8.2/go.mod h1:oe/vMfY3deqTw+1EZJhuvEW2iwGF1bW9wwu7XCu0+v0= gonum.org/v1/gonum v0.9.3/go.mod h1:TZumC3NeyVQskjXqmyWt4S3bINhy7B4eYwW69EbyX+0= gonum.org/v1/gonum v0.11.0/go.mod h1:fSG4YDCxxUZQJ7rKsQrj0gMOg00Il0Z96/qMA4bVQhA= -gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk= -gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw= gonum.org/v1/plot v0.0.0-20190515093506-e2840ee46a6b/go.mod h1:Wt8AAjI+ypCyYX3nZBvf6cAIx93T+c/OS2HFAYskSZc= gonum.org/v1/plot v0.9.0/go.mod h1:3Pcqqmp6RHvJI72kgb8fThyUnav364FOsdDo2aGW5lY= @@ -2462,10 +2464,10 @@ google.golang.org/genproto v0.0.0-20230331144136-dcfb400f0633/go.mod h1:UUQDJDOl google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1/go.mod h1:nKE/iIaLqn2bQwXBg8f1g2Ylh6r5MN5CmZvuzZCgsCU= google.golang.org/genproto v0.0.0-20250603155806-513f23925822 h1:rHWScKit0gvAPuOnu87KpaYtjK5zBMLcULh7gxkCXu4= google.golang.org/genproto v0.0.0-20250603155806-513f23925822/go.mod h1:HubltRL7rMh0LfnQPkMH4NPDFEWp0jw3vixw7jEM53s= -google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b h1:uA40e2M6fYRBf0+8uN5mLlqUtV192iiksiICIBkYJ1E= -google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b/go.mod h1:Xa7le7qx2vmqB/SzWUBa7KdMjpdpAHlh5QCSnjessQk= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3 h1:C4WAdL+FbjnGlpp2S+HMVhBeCq2Lcib4xZqfPNF6OoQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20260114163908-3f89685c29c3/go.mod h1:j9x/tPzZkyxcgEFkiKEEGxfvyumM01BEtsW8xzOahRQ= +google.golang.org/genproto/googleapis/api v0.0.0-20260414002931-afd174a4e478 h1:yQugLulqltosq0B/f8l4w9VryjV+N/5gcW0jQ3N8Qec= +google.golang.org/genproto/googleapis/api v0.0.0-20260414002931-afd174a4e478/go.mod h1:C6ADNqOxbgdUUeRTU+LCHDPB9ttAMCTff6auwCVa4uc= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478 h1:RmoJA1ujG+/lRGNfUnOMfhCy5EipVMyvUE+KNbPbTlw= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260414002931-afd174a4e478/go.mod h1:4Hqkh8ycfw05ld/3BWL7rJOSfebL2Q+DVDeRgYgxUU8= 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= @@ -2513,8 +2515,8 @@ google.golang.org/grpc v1.52.3/go.mod h1:pu6fVzoFb+NBYNAvQL08ic+lvB2IojljRYuun5v google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw= google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g= google.golang.org/grpc v1.56.3/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s= -google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE= -google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ= +google.golang.org/grpc v1.82.1 h1:NnAxzGRA0677vCa4BUkOAnO5+FfQqVl9iUXeD0IqcGE= +google.golang.org/grpc v1.82.1/go.mod h1:yzTZ1TB1Z3SG+LIYaI+WiE8D5+PZ3ArnrSp8zF3+/ZA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/interchaintest/suite/feepay.go b/interchaintest/suite/feepay.go index 4b5ddcf98..3266cba1f 100644 --- a/interchaintest/suite/feepay.go +++ b/interchaintest/suite/feepay.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" - feepaytypes "github.com/CosmosContracts/juno/v30/x/feepay/types" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" ) func (s *E2ETestSuite) RegisterFeePay(chain *cosmos.CosmosChain, user ibc.Wallet, contract string, walletLimit int) { diff --git a/interchaintest/suite/lib.go b/interchaintest/suite/lib.go index 6ec972e28..61b892f08 100644 --- a/interchaintest/suite/lib.go +++ b/interchaintest/suite/lib.go @@ -179,12 +179,12 @@ func FourChainInterchainConstructor(ctx context.Context, t *testing.T, chains [] Path: pathCD, }) - ctx, cancel := context.WithTimeout(ctx, 2*time.Minute) + ctx, cancel := context.WithTimeout(ctx, 5*time.Minute) defer cancel() - // build the interchain + // Build creates relayer keys and wallets, but link the three paths below. err := ic.Build(ctx, eRep, interchaintest.InterchainBuildOptions{ - SkipPathCreation: false, + SkipPathCreation: true, Client: client, NetworkID: networkID, TestName: t.Name(), @@ -192,6 +192,23 @@ func FourChainInterchainConstructor(ctx context.Context, t *testing.T, chains [] }) require.NoError(t, err) + // A single rly home backs all three links. Build creates links concurrently, + // which races rly's shared path config and can leave a path with empty client + // IDs. Generate and link each path serially instead. + links := []struct { + path string + source *cosmos.CosmosChain + dest *cosmos.CosmosChain + }{ + {pathAB, chains[0], chains[1]}, + {pathBC, chains[1], chains[2]}, + {pathCD, chains[2], chains[3]}, + } + for _, link := range links { + require.NoError(t, r.GeneratePath(ctx, eRep, link.source.Config().ChainID, link.dest.Config().ChainID, link.path)) + require.NoError(t, r.LinkPath(ctx, eRep, link.path, ibc.DefaultChannelOpts(), ibc.DefaultClientOpts())) + } + return ic, client, r } diff --git a/interchaintest/suite/query.go b/interchaintest/suite/query.go index b0a762839..2bd140e2c 100644 --- a/interchaintest/suite/query.go +++ b/interchaintest/suite/query.go @@ -4,9 +4,9 @@ import ( "context" "encoding/json" - cwhooktypes "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - votingsnapshottypes "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + cwhooktypes "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + votingsnapshottypes "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" coretypes "github.com/cometbft/cometbft/rpc/core/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/interchaintest/suite/setup.go b/interchaintest/suite/setup.go index fec36c922..59927943b 100644 --- a/interchaintest/suite/setup.go +++ b/interchaintest/suite/setup.go @@ -13,12 +13,12 @@ import ( testutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - clocktypes "github.com/CosmosContracts/juno/v30/x/clock/types" - driptypes "github.com/CosmosContracts/juno/v30/x/drip/types" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - feepaytypes "github.com/CosmosContracts/juno/v30/x/feepay/types" - feesharetypes "github.com/CosmosContracts/juno/v30/x/feeshare/types" - tokenfactorytypes "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + clocktypes "github.com/CosmosContracts/juno/v31/x/clock/types" + driptypes "github.com/CosmosContracts/juno/v31/x/drip/types" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" + feesharetypes "github.com/CosmosContracts/juno/v31/x/feeshare/types" + tokenfactorytypes "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) const ( diff --git a/interchaintest/suite/suite.go b/interchaintest/suite/suite.go index 4e6dbfabf..bdf66883e 100644 --- a/interchaintest/suite/suite.go +++ b/interchaintest/suite/suite.go @@ -38,12 +38,12 @@ import ( nft "cosmossdk.io/x/nft" upgradetypes "cosmossdk.io/x/upgrade/types" - clocktypes "github.com/CosmosContracts/juno/v30/x/clock/types" - cwhooktypes "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" - driptypes "github.com/CosmosContracts/juno/v30/x/drip/types" - feepaytypes "github.com/CosmosContracts/juno/v30/x/feepay/types" - feesharetypes "github.com/CosmosContracts/juno/v30/x/feeshare/types" - tokenfactorytypes "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + clocktypes "github.com/CosmosContracts/juno/v31/x/clock/types" + cwhooktypes "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" + driptypes "github.com/CosmosContracts/juno/v31/x/drip/types" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" + feesharetypes "github.com/CosmosContracts/juno/v31/x/feeshare/types" + tokenfactorytypes "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" interchaintest "github.com/cosmos/interchaintest/v10" "github.com/cosmos/interchaintest/v10/chain/cosmos" @@ -56,10 +56,10 @@ import ( dockerclient "github.com/moby/moby/client" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - minttypes "github.com/CosmosContracts/juno/v30/x/mint/types" - streamtypes "github.com/CosmosContracts/juno/v30/x/stream/types" - votingsnapshottypes "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + minttypes "github.com/CosmosContracts/juno/v31/x/mint/types" + streamtypes "github.com/CosmosContracts/juno/v31/x/stream/types" + votingsnapshottypes "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" ) // E2ETestSuite runs the feemarket e2e test-suite against a given interchaintest specification diff --git a/interchaintest/tests/cosmwasm/clock_test.go b/interchaintest/tests/cosmwasm/clock_test.go index a3b9f541e..3912491ef 100644 --- a/interchaintest/tests/cosmwasm/clock_test.go +++ b/interchaintest/tests/cosmwasm/clock_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" - clocktypes "github.com/CosmosContracts/juno/v30/x/clock/types" + clocktypes "github.com/CosmosContracts/juno/v31/x/clock/types" e2esuite "github.com/CosmosContracts/juno/tests/interchaintest/suite" ) diff --git a/interchaintest/tests/dao-dao/dao_dao_helpers_test.go b/interchaintest/tests/dao-dao/dao_dao_helpers_test.go new file mode 100644 index 000000000..1f8ffad6f --- /dev/null +++ b/interchaintest/tests/dao-dao/dao_dao_helpers_test.go @@ -0,0 +1,44 @@ +package daodao_test + +import ( + "encoding/json" + "path/filepath" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestBuildCw4DaoInstantiate(t *testing.T) { + msg, err := buildDaoInstantiate("juno1member", "2", "3", "1") + require.NoError(t, err) + + var core map[string]any + require.NoError(t, json.Unmarshal([]byte(msg), &core)) + require.Equal(t, "DAO DAO cw4 lifecycle", core["name"]) + require.NotNil(t, core["voting_module_instantiate_info"]) + require.Len(t, core["proposal_modules_instantiate_info"], 1) +} + +func TestCw4ArtifactChecksums(t *testing.T) { + require.NoError(t, verifyCw4Artifacts(filepath.Join("..", "..", "contracts"))) +} + +func TestDecodeContractQueryResponse(t *testing.T) { + t.Run("enveloped scalar", func(t *testing.T) { + var address string + require.NoError(t, decodeContractQueryResponse([]byte(`{"data":"juno1contract"}`), &address)) + require.Equal(t, "juno1contract", address) + }) + + t.Run("enveloped object", func(t *testing.T) { + var response votingPowerResponse + require.NoError(t, decodeContractQueryResponse([]byte(`{"data":{"power":"7"}}`), &response)) + require.Equal(t, "7", response.Power) + }) + + t.Run("direct response", func(t *testing.T) { + var response votingPowerResponse + require.NoError(t, decodeContractQueryResponse([]byte(`{"power":"9"}`), &response)) + require.Equal(t, "9", response.Power) + }) +} diff --git a/interchaintest/tests/dao-dao/dao_dao_test.go b/interchaintest/tests/dao-dao/dao_dao_test.go index adec2ae1a..f836be996 100644 --- a/interchaintest/tests/dao-dao/dao_dao_test.go +++ b/interchaintest/tests/dao-dao/dao_dao_test.go @@ -1,34 +1,44 @@ -// Package dao_dao_test exercises DAO DAO v2.7.0 contracts against the -// v30 chain binary. Per planning/09-deferred-work.md §A1, this is the -// gate test for "DAO DAO contracts continue to work after the wasmvm -// v3 / sdk v0.53.7 / ibc-go v10 upgrade." -// -// Three legs: -// 1. cw4-group voting + proposal-single (smallest path; proves the -// module contracts instantiate + interact) -// 2. cw20-staked voting + proposal-single (heavier path; cw20 token -// + staking module contracts plus the voting+proposal pair) -// 3. wasmbinding smoke for VotingPowerAt (target of the new -// x/voting-snapshot module) -// -// Run with `make ictest-dao-dao` once that target lands. +// Package daodao_test exercises released DAO DAO contracts against the +// candidate Juno image. Contract bytes are checked in and verified before use; +// the test never downloads artifacts at runtime. package daodao_test import ( "context" + "crypto/sha256" + "encoding/hex" "encoding/json" "fmt" + "io" + "os" + "path/filepath" + "strconv" "testing" "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" "github.com/cosmos/interchaintest/v10" "github.com/cosmos/interchaintest/v10/chain/cosmos" "github.com/stretchr/testify/suite" e2esuite "github.com/CosmosContracts/juno/tests/interchaintest/suite" + votingsnapshottypes "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" ) +const ( + contractsDir = "../../contracts" + proposalID = uint64(1) +) + +var cw4Artifacts = map[string]string{ + "cw4_group.wasm": "dd2216f1114fc68bc4c043701b02e55ce3e5598cdeb616985388215a400db277", + "dao_voting_cw4.wasm": "d0e6bac4d7c1861f36328e7c0367f863999f999e2ae21df612e301eea5fe90d8", + "dao_proposal_single.wasm": "e38fc5bb1b5e74ef154340567c673492515498b2120e5f15b0c990cd9fa5fe6a", + "dao_dao_core.wasm": "5d078fc9aec04df18c335446eb8df03d24c73ee745f76fd39624d4c5fa768b4c", + "voting_power_probe.wasm": "124d427ff478ec1d026f5412b72892db76a961b066989a299f66bcfb13d0b11a", +} + type DaoDaoTestSuite struct { *e2esuite.E2ETestSuite } @@ -50,130 +60,388 @@ func TestDaoDaoTestSuite(t *testing.T) { suite.Run(t, testSuite) } -// TestCw4GroupDao instantiates a minimal DAO DAO setup with cw4-group -// voting + proposal-single, opens a no-op proposal, votes it through, -// and executes it. Pass criterion: every step returns success and the -// proposal moves through Open → Passed → Executed. +// TestCw4GroupDao stores authentic release artifacts, instantiates a DAO whose +// voting module creates its cw4 group, discovers all child contracts, and +// asserts the proposal's Open -> Passed -> Executed lifecycle. func (s *DaoDaoTestSuite) TestCw4GroupDao() { t := s.T() - - // TODO(v30.x): the helpers below (buildDaoInstantiate, queryVotingModule, - // openProposal, voteOnProposal, executeProposal, queryProposalStatus) are - // still stubs — buildDaoInstantiate emits an incomplete daoMsg that the - // dao-dao-core schema rejects on instantiate, and every other helper calls - // t.Skip. Skip the whole test until those helpers are fleshed out so we - // don't fail CI on a scaffolding-only test. - t.Skip("TODO(v30.x): finish DAO instantiate helper + per-step query helpers before un-skipping") - require := s.Require() + require.NoError(verifyCw4Artifacts(contractsDir), "checked-in release artifacts must match documented SHA-256 sums") + user := s.GetAndFundTestUser(t.Name(), 10_000_000_000, s.Chain) fees := sdk.NewCoins(sdk.NewCoin(s.Denom, math.NewInt(1_000_000))) - // Store the four contracts the cw4-group path needs: - // dao-dao-core, dao-proposal-single, dao-voting-cw4, cw4-group - cw4GroupCodeID := s.StoreContract(s.Chain, user.KeyName(), "../../contracts/cw4_group.wasm", fees) - votingCodeID := s.StoreContract(s.Chain, user.KeyName(), "../../contracts/dao_voting_cw4.wasm", fees) - proposalCodeID := s.StoreContract(s.Chain, user.KeyName(), "../../contracts/dao_proposal_single.wasm", fees) - coreCodeID := s.StoreContract(s.Chain, user.KeyName(), "../../contracts/dao_dao_core.wasm", fees) - - // Instantiate the DAO. The dao-dao-core constructor takes - // instantiate-info structs for the voting and proposal modules; - // see dao-contracts/packages/dao-interface for the schema. - daoMsg := buildDaoInstantiate(user.FormattedAddress(), votingCodeID, proposalCodeID, cw4GroupCodeID) - dao, err := s.InstantiateContract(s.Chain, user.KeyName(), coreCodeID, daoMsg, fees, false, false) - require.NoError(err) - require.NotEmpty(dao) - - // Discover the child voting + proposal contract addresses. - voting := queryVotingModule(t, s.Chain, dao) - proposal := queryProposalModule(t, s.Chain, dao) - require.NotEmpty(voting) - require.NotEmpty(proposal) - - // Open a no-op proposal, vote yes from the single member, execute. - proposalID := openProposal(t, s.Chain, user.KeyName(), proposal, "test", "no-op proposal") - voteOnProposal(t, s.Chain, user.KeyName(), proposal, proposalID, "yes") - executeProposal(t, s.Chain, user.KeyName(), proposal, proposalID) - - status := queryProposalStatus(t, s.Chain, proposal, proposalID) - require.Equal("executed", status) -} - -// TestCw20StakedDao exercises the staked-token voting path. Stakers -// contribute voting power proportional to their staked balance; the -// proposal threshold is a percentage of the snapshot supply. Pass -// criterion: a single staker can pass a no-op proposal that crosses -// the threshold. + cw4GroupCodeID := s.StoreContract(s.Chain, user.KeyName(), filepath.Join(contractsDir, "cw4_group.wasm"), fees) + votingCodeID := s.StoreContract(s.Chain, user.KeyName(), filepath.Join(contractsDir, "dao_voting_cw4.wasm"), fees) + proposalCodeID := s.StoreContract(s.Chain, user.KeyName(), filepath.Join(contractsDir, "dao_proposal_single.wasm"), fees) + coreCodeID := s.StoreContract(s.Chain, user.KeyName(), filepath.Join(contractsDir, "dao_dao_core.wasm"), fees) + require.NotEmpty(cw4GroupCodeID) + require.NotEmpty(votingCodeID) + require.NotEmpty(proposalCodeID) + require.NotEmpty(coreCodeID) + + daoMsg, err := buildDaoInstantiate(user.FormattedAddress(), votingCodeID, proposalCodeID, cw4GroupCodeID) + require.NoError(err) + dao, err := s.InstantiateContract(s.Chain, user.KeyName(), coreCodeID, daoMsg, fees, true, false) + require.NoError(err) + require.NotEmpty(dao, "core must be instantiated") + + voting, err := queryVotingModule(s.Ctx, s.Chain, dao) + require.NoError(err) + require.NotEmpty(voting, "core must report its voting child") + proposal, err := queryProposalModule(s.Ctx, s.Chain, dao) + require.NoError(err) + require.NotEmpty(proposal, "core must report its enabled proposal child") + group, err := queryGroupContract(s.Ctx, s.Chain, voting) + require.NoError(err) + require.NotEmpty(group, "voting module must report its cw4 group child") + + power, err := queryVotingPower(s.Ctx, s.Chain, dao, user.FormattedAddress()) + require.NoError(err) + require.Equal("1", power, "the sole cw4 member must have voting power") + + require.NoError(openProposal(s.Ctx, s.Chain, user.KeyName(), proposal, "cw4 lifecycle", "no-op proposal", fees)) + status, err := queryProposalStatus(s.Ctx, s.Chain, proposal, proposalID) + require.NoError(err) + require.Equal("open", status, "proposal must be open before voting") + + require.NoError(voteOnProposal(s.Ctx, s.Chain, user.KeyName(), proposal, proposalID, "yes", fees)) + status, err = queryProposalStatus(s.Ctx, s.Chain, proposal, proposalID) + require.NoError(err) + require.Equal("passed", status, "the sole member's yes vote must pass the proposal") + + require.NoError(executeProposal(s.Ctx, s.Chain, user.KeyName(), proposal, proposalID, fees)) + status, err = queryProposalStatus(s.Ctx, s.Chain, proposal, proposalID) + require.NoError(err) + require.Equal("executed", status, "executing the passed proposal must be persisted") +} + +// The cw20-staked and custom-binding legs remain explicit follow-up scope; issue +// #14's release gate is the cw4 lifecycle above. func (s *DaoDaoTestSuite) TestCw20StakedDao() { - t := s.T() - t.Skip("TODO(v30.x): implement once the cw4-group leg passes — same scaffold, swap voting module for cw20-staked + add cw20 token + cw20-stake setup") + s.T().Skip("follow-up: cw20-staked is outside issue #14") } -// TestWasmbindingsVotingPowerAt verifies the x/voting-snapshot -// custom binding. Deploys a small "echo" contract that calls -// JunoQuery::VotingPowerAt and emits the result as an event; -// asserts the result matches the staker's bonded amount. +// TestWasmbindingsVotingPowerAt deploys a source-controlled probe contract, +// delegates real stake, and compares current, historical, total, and range +// custom-query responses against the module's gRPC API. func (s *DaoDaoTestSuite) TestWasmbindingsVotingPowerAt() { t := s.T() - t.Skip("TODO(v30.x): build a minimal Rust contract that invokes JunoQuery::VotingPowerAt; embed wasm at interchaintest/contracts/voting_power_probe.wasm") + require := s.Require() + const stakeAmount = int64(1_000_000) + + require.NoError(verifyCw4Artifacts(contractsDir), "checked-in probe must match its source-controlled SHA-256") + user := s.GetAndFundTestUser(t.Name(), 10_000_000_000, s.Chain) + fees := sdk.NewCoins(sdk.NewCoin(s.Denom, math.NewInt(1_000_000))) + + probeCodeID := s.StoreContract(s.Chain, user.KeyName(), filepath.Join(contractsDir, "voting_power_probe.wasm"), fees) + require.NotEmpty(probeCodeID) + probe, err := s.InstantiateContract(s.Chain, user.KeyName(), probeCodeID, `{}`, fees, true, false) + require.NoError(err) + require.NotEmpty(probe) + + beforeHeight, err := s.Chain.Height(s.Ctx) + require.NoError(err) + before, err := s.VotingSnapshotClient.VotingPowerAt(s.Ctx, &votingsnapshottypes.QueryVotingPowerAtRequest{ + Address: user.FormattedAddress(), AtHeight: beforeHeight, + }) + require.NoError(err) + require.Equal("0", before.Power) + + validators, err := s.StakingClient.Validators(s.Ctx, &stakingtypes.QueryValidatorsRequest{ + Status: stakingtypes.BondStatusBonded, + }) + require.NoError(err) + require.NotEmpty(validators.Validators) + s.StakeTokens( + s.Chain, + user, + validators.Validators[0].OperatorAddress, + sdk.NewInt64Coin(s.Denom, stakeAmount).String(), + fees, + false, + ) + + afterHeight, err := s.Chain.Height(s.Ctx) + require.NoError(err) + require.Greater(afterHeight, beforeHeight) + + directPower, err := s.VotingSnapshotClient.VotingPowerAt(s.Ctx, &votingsnapshottypes.QueryVotingPowerAtRequest{ + Address: user.FormattedAddress(), AtHeight: afterHeight, + }) + require.NoError(err) + require.Equal(fmt.Sprint(stakeAmount), directPower.Power) + directTotal, err := s.VotingSnapshotClient.TotalVotingPowerAt(s.Ctx, &votingsnapshottypes.QueryTotalVotingPowerAtRequest{ + AtHeight: afterHeight, + }) + require.NoError(err) + directRange, err := s.VotingSnapshotClient.VotingPowerOverRange(s.Ctx, &votingsnapshottypes.QueryVotingPowerOverRangeRequest{ + Address: user.FormattedAddress(), FromHeight: beforeHeight, ToHeight: afterHeight, + }) + require.NoError(err) + require.NotEmpty(directRange.Rows) + + var historical votingPowerResponse + require.NoError(queryContract(s.Ctx, s.Chain, probe, map[string]any{ + "voting_power_at": map[string]any{"address": user.FormattedAddress(), "height": beforeHeight}, + }, &historical)) + require.Equal(before.Power, historical.Power) + + var current votingPowerResponse + require.NoError(queryContract(s.Ctx, s.Chain, probe, map[string]any{ + "voting_power_at": map[string]any{"address": user.FormattedAddress(), "height": afterHeight}, + }, ¤t)) + require.Equal(directPower.Power, current.Power) + + var total votingPowerResponse + require.NoError(queryContract(s.Ctx, s.Chain, probe, map[string]any{ + "total_voting_power_at": map[string]any{"height": afterHeight}, + }, &total)) + require.Equal(directTotal.Power, total.Power) + + var powerRange votingPowerRangeResponse + require.NoError(queryContract(s.Ctx, s.Chain, probe, map[string]any{ + "voting_power_over_range": map[string]any{ + "address": user.FormattedAddress(), "from_height": beforeHeight, "to_height": afterHeight, + }, + }, &powerRange)) + require.Len(powerRange.Rows, len(directRange.Rows)) + for i := range directRange.Rows { + require.Equal(directRange.Rows[i].Height, powerRange.Rows[i].Height) + require.Equal(directRange.Rows[i].Power, powerRange.Rows[i].Power) + } +} + +type votingPowerResponse struct { + Power string `json:"power"` +} + +type votingPowerRangeResponse struct { + Rows []struct { + Height int64 `json:"height"` + Power string `json:"power"` + } `json:"rows"` +} + +type moduleInstantiateInfo struct { + CodeID uint64 `json:"code_id"` + Msg json.RawMessage `json:"-"` + Admin map[string]any `json:"admin"` + Funds any `json:"funds"` + Label string `json:"label"` + Salt any `json:"salt"` +} + +func (m moduleInstantiateInfo) MarshalJSON() ([]byte, error) { + type wire struct { + CodeID uint64 `json:"code_id"` + Msg []byte `json:"msg"` + Admin map[string]any `json:"admin"` + Funds any `json:"funds"` + Label string `json:"label"` + Salt any `json:"salt"` + } + return json.Marshal(wire{m.CodeID, []byte(m.Msg), m.Admin, m.Funds, m.Label, m.Salt}) +} + +func buildDaoInstantiate(member, votingCodeID, proposalCodeID, cw4CodeID string) (string, error) { + votingID, err := strconv.ParseUint(votingCodeID, 10, 64) + if err != nil { + return "", fmt.Errorf("parse voting code ID: %w", err) + } + proposalID, err := strconv.ParseUint(proposalCodeID, 10, 64) + if err != nil { + return "", fmt.Errorf("parse proposal code ID: %w", err) + } + groupID, err := strconv.ParseUint(cw4CodeID, 10, 64) + if err != nil { + return "", fmt.Errorf("parse cw4 code ID: %w", err) + } + + votingMsg, err := json.Marshal(map[string]any{ + "group_contract": map[string]any{ + "new": map[string]any{ + "cw4_group_code_id": groupID, + "cw4_group_salt": nil, + "initial_members": []map[string]any{{ + "addr": member, "weight": 1, + }}, + }, + }, + }) + if err != nil { + return "", err + } + proposalMsg, err := json.Marshal(map[string]any{ + "threshold": map[string]any{"absolute_percentage": map[string]any{"percentage": map[string]any{"majority": map[string]any{}}}}, + "max_voting_period": map[string]any{"height": 100}, + "min_voting_period": nil, + "only_members_execute": false, + "allow_revoting": false, + "pre_propose_info": map[string]any{"anyone_may_propose": map[string]any{}}, + "close_proposal_on_execution_failure": false, + "veto": nil, + "delegation_module": nil, + }) + if err != nil { + return "", err + } + + coreMsg := map[string]any{ + "admin": nil, + "name": "DAO DAO cw4 lifecycle", + "description": "Juno candidate image compatibility test", + "image_url": nil, + "automatically_add_cw20s": false, + "automatically_add_cw721s": false, + "voting_module_instantiate_info": moduleInstantiateInfo{ + CodeID: votingID, Msg: votingMsg, Admin: map[string]any{"core_module": map[string]any{}}, + Funds: nil, Label: "cw4 voting module", Salt: nil, + }, + "proposal_modules_instantiate_info": []moduleInstantiateInfo{{ + CodeID: proposalID, Msg: proposalMsg, Admin: map[string]any{"core_module": map[string]any{}}, + Funds: nil, Label: "single proposal module", Salt: nil, + }}, + "initial_items": nil, + "initial_actions": nil, + "dao_uri": nil, + } + encoded, err := json.Marshal(coreMsg) + if err != nil { + return "", fmt.Errorf("marshal core instantiate message: %w", err) + } + return string(encoded), nil } -// helpers — TODO(v30.x): flesh out once the test runs in CI and we can -// iterate on real msg shapes. Keeping these as stubs so the test file -// compiles; the cw4-group leg's first concrete pass is the next-session -// goal. +func queryVotingModule(ctx context.Context, chain *cosmos.CosmosChain, dao string) (string, error) { + var address string + err := queryContract(ctx, chain, dao, map[string]any{"voting_module": map[string]any{}}, &address) + return address, err +} -func buildDaoInstantiate(creator string, votingCodeID, proposalCodeID, cw4CodeID string) string { - // Skeleton — fill in once we have a concrete schema reference. - type instantiateInfo struct { - CodeID string `json:"code_id"` - Msg json.RawMessage `json:"msg"` - Funds []sdk.Coin `json:"funds"` - Label string `json:"label"` - Admin *string `json:"admin"` +func queryProposalModule(ctx context.Context, chain *cosmos.CosmosChain, dao string) (string, error) { + var modules []struct { + Address string `json:"address"` + Status string `json:"status"` + } + err := queryContract(ctx, chain, dao, map[string]any{ + "proposal_modules": map[string]any{"start_after": nil, "limit": nil}, + }, &modules) + if err != nil { + return "", err + } + if len(modules) != 1 { + return "", fmt.Errorf("expected one proposal module, got %d", len(modules)) + } + if modules[0].Status != "enabled" { + return "", fmt.Errorf("proposal module %s is %q, want enabled", modules[0].Address, modules[0].Status) } - _ = instantiateInfo{} - _ = creator - _ = votingCodeID - _ = proposalCodeID - _ = cw4CodeID - return `{"name":"test-dao","description":"v30 ictest DAO","voting_module_instantiate_info":null,"proposal_modules_instantiate_info":[]}` + return modules[0].Address, nil } -func queryVotingModule(t *testing.T, chain *cosmos.CosmosChain, dao string) string { - _ = chain - _ = dao - t.Skip("queryVotingModule helper unimplemented") - return "" +func queryGroupContract(ctx context.Context, chain *cosmos.CosmosChain, voting string) (string, error) { + var address string + err := queryContract(ctx, chain, voting, map[string]any{"group_contract": map[string]any{}}, &address) + return address, err } -func queryProposalModule(t *testing.T, chain *cosmos.CosmosChain, dao string) string { - _ = chain - _ = dao - t.Skip("queryProposalModule helper unimplemented") - return "" +func queryVotingPower(ctx context.Context, chain *cosmos.CosmosChain, dao, member string) (string, error) { + var response struct { + Power string `json:"power"` + } + err := queryContract(ctx, chain, dao, map[string]any{ + "voting_power_at_height": map[string]any{"address": member, "height": nil}, + }, &response) + return response.Power, err } -func openProposal(t *testing.T, chain *cosmos.CosmosChain, key, proposal, title, desc string) uint64 { - _, _, _, _, _ = chain, key, proposal, title, desc - t.Skip("openProposal helper unimplemented") - return 0 +func openProposal(ctx context.Context, chain *cosmos.CosmosChain, key, proposal, title, description string, fees sdk.Coins) error { + msg, err := json.Marshal(map[string]any{"propose": map[string]any{ + "title": title, "description": description, "msgs": []any{}, "proposer": nil, "vote": nil, + }}) + if err != nil { + return err + } + _, err = chain.ExecuteContract(ctx, key, proposal, string(msg), "--gas", "auto", "--fees", fees.String()) + return err } -func voteOnProposal(t *testing.T, chain *cosmos.CosmosChain, key, proposal string, id uint64, vote string) { - _, _, _, _, _ = chain, key, proposal, id, vote - t.Skip("voteOnProposal helper unimplemented") +func voteOnProposal(ctx context.Context, chain *cosmos.CosmosChain, key, proposal string, id uint64, vote string, fees sdk.Coins) error { + msg, err := json.Marshal(map[string]any{"vote": map[string]any{ + "proposal_id": id, "vote": vote, "rationale": nil, + }}) + if err != nil { + return err + } + _, err = chain.ExecuteContract(ctx, key, proposal, string(msg), "--gas", "auto", "--fees", fees.String()) + return err } -func executeProposal(t *testing.T, chain *cosmos.CosmosChain, key, proposal string, id uint64) { - _, _, _, _ = chain, key, proposal, id - t.Skip("executeProposal helper unimplemented") +func executeProposal(ctx context.Context, chain *cosmos.CosmosChain, key, proposal string, id uint64, fees sdk.Coins) error { + msg, err := json.Marshal(map[string]any{"execute": map[string]any{"proposal_id": id}}) + if err != nil { + return err + } + _, err = chain.ExecuteContract(ctx, key, proposal, string(msg), "--gas", "auto", "--fees", fees.String()) + return err +} + +func queryProposalStatus(ctx context.Context, chain *cosmos.CosmosChain, proposal string, id uint64) (string, error) { + var response struct { + Proposal struct { + Status string `json:"status"` + } `json:"proposal"` + } + err := queryContract(ctx, chain, proposal, map[string]any{ + "proposal": map[string]any{"proposal_id": id}, + }, &response) + return response.Proposal.Status, err } -func queryProposalStatus(t *testing.T, chain *cosmos.CosmosChain, proposal string, id uint64) string { - _ = context.Background() - _, _, _ = chain, proposal, id - t.Skip("queryProposalStatus helper unimplemented") - return fmt.Sprintf("status-stub-%d", id) +func queryContract(ctx context.Context, chain *cosmos.CosmosChain, contract string, msg, response any) error { + query, err := json.Marshal(msg) + if err != nil { + return fmt.Errorf("marshal contract query: %w", err) + } + stdout, _, err := chain.GetNode().ExecQuery(ctx, "wasm", "contract-state", "smart", contract, string(query)) + if err != nil { + return err + } + + return decodeContractQueryResponse(stdout, response) +} + +func decodeContractQueryResponse(stdout []byte, response any) error { + var envelope map[string]json.RawMessage + if err := json.Unmarshal(stdout, &envelope); err != nil { + return err + } + if data, ok := envelope["data"]; ok { + return json.Unmarshal(data, response) + } + return json.Unmarshal(stdout, response) +} + +func verifyCw4Artifacts(dir string) error { + for name, expected := range cw4Artifacts { + file, err := os.Open(filepath.Join(dir, name)) + if err != nil { + return fmt.Errorf("open %s: %w", name, err) + } + hash := sha256.New() + _, copyErr := io.Copy(hash, file) + closeErr := file.Close() + if copyErr != nil { + return fmt.Errorf("hash %s: %w", name, copyErr) + } + if closeErr != nil { + return fmt.Errorf("close %s: %w", name, closeErr) + } + actual := hex.EncodeToString(hash.Sum(nil)) + if actual != expected { + return fmt.Errorf("%s SHA-256 mismatch: got %s, want %s", name, actual, expected) + } + } + return nil } diff --git a/interchaintest/tests/feemarket/helpers_test.go b/interchaintest/tests/feemarket/helpers_test.go index f54d95018..4c4da3ac2 100644 --- a/interchaintest/tests/feemarket/helpers_test.go +++ b/interchaintest/tests/feemarket/helpers_test.go @@ -9,8 +9,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/interchaintest/v10/ibc" - feemarketypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - streamtypes "github.com/CosmosContracts/juno/v30/x/stream/types" + feemarketypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + streamtypes "github.com/CosmosContracts/juno/v31/x/stream/types" ) // monitorGasPrice continuously monitors gas price changes diff --git a/interchaintest/tests/fees/feepay_test.go b/interchaintest/tests/fees/feepay_test.go index 47418f0a1..0a6ecf223 100644 --- a/interchaintest/tests/fees/feepay_test.go +++ b/interchaintest/tests/fees/feepay_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/suite" e2esuite "github.com/CosmosContracts/juno/tests/interchaintest/suite" - "github.com/CosmosContracts/juno/v30/x/feepay/types" + "github.com/CosmosContracts/juno/v31/x/feepay/types" ) type FeesTestSuite struct { diff --git a/interchaintest/tests/ibc-hooks/ibc_hooks_test.go b/interchaintest/tests/ibc-hooks/ibc_hooks_test.go index 1427e0c79..87a98c244 100644 --- a/interchaintest/tests/ibc-hooks/ibc_hooks_test.go +++ b/interchaintest/tests/ibc-hooks/ibc_hooks_test.go @@ -16,7 +16,7 @@ import ( "github.com/stretchr/testify/suite" e2esuite "github.com/CosmosContracts/juno/tests/interchaintest/suite" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) var genesisWalletAmount = int64(10_000_000) diff --git a/interchaintest/tests/ibc/ibc_transfer_test.go b/interchaintest/tests/ibc/ibc_transfer_test.go index b5df3641f..d295420c3 100644 --- a/interchaintest/tests/ibc/ibc_transfer_test.go +++ b/interchaintest/tests/ibc/ibc_transfer_test.go @@ -16,7 +16,7 @@ import ( transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) var genesisWalletAmount = int64(10_000_000) diff --git a/interchaintest/tests/node/state_sync_helpers_test.go b/interchaintest/tests/node/state_sync_helpers_test.go new file mode 100644 index 000000000..1baab0267 --- /dev/null +++ b/interchaintest/tests/node/state_sync_helpers_test.go @@ -0,0 +1,42 @@ +package node_test + +import ( + "testing" + + "github.com/cosmos/interchaintest/v10/testutil" + "github.com/stretchr/testify/require" + + e2esuite "github.com/CosmosContracts/juno/tests/interchaintest/suite" +) + +func TestStateSyncSpecIsIsolatedAndPreconfiguresSnapshotProviderTopology(t *testing.T) { + originalFullNodes := *e2esuite.DefaultSpec.NumFullNodes + originalOverrides := e2esuite.DefaultConfig.ConfigFileOverrides + + spec := stateSyncSpec() + + require.Equal(t, 2, *spec.NumFullNodes) + require.NotSame(t, e2esuite.DefaultSpec.NumFullNodes, spec.NumFullNodes) + require.Equal(t, originalFullNodes, *e2esuite.DefaultSpec.NumFullNodes) + require.Equal(t, originalOverrides, e2esuite.DefaultConfig.ConfigFileOverrides) + require.NotNil(t, spec.ChainConfig.ConfigFileOverrides) + + appToml, ok := spec.ChainConfig.ConfigFileOverrides["config/app.toml"].(testutil.Toml) + require.True(t, ok) + snapshotToml, ok := appToml["state-sync"].(testutil.Toml) + require.True(t, ok) + require.Equal(t, stateSyncSnapshotInterval, snapshotToml["snapshot-interval"]) + require.Equal(t, "custom", appToml["pruning"]) +} + +func TestStateSyncNodeOverridesRequireDistinctRPCProviders(t *testing.T) { + overrides := stateSyncNodeOverrides(20, "ABC123", []string{"provider-a", "provider-b"}) + configToml := overrides["config/config.toml"].(testutil.Toml) + stateSyncToml := configToml["statesync"].(testutil.Toml) + + require.Equal(t, true, stateSyncToml["enable"]) + require.Equal(t, "tcp://provider-a:26657,tcp://provider-b:26657", stateSyncToml["rpc_servers"]) + require.EqualValues(t, 20, stateSyncToml["trust_height"]) + require.Equal(t, "ABC123", stateSyncToml["trust_hash"]) + require.Equal(t, "1h", stateSyncToml["trust_period"]) +} diff --git a/interchaintest/tests/node/state_sync_test.go b/interchaintest/tests/node/state_sync_test.go index 16505fc07..1076e4ef7 100644 --- a/interchaintest/tests/node/state_sync_test.go +++ b/interchaintest/tests/node/state_sync_test.go @@ -1,29 +1,91 @@ package node_test import ( - "context" "encoding/hex" "fmt" + "strings" "testing" "time" "github.com/cosmos/interchaintest/v10" + "github.com/cosmos/interchaintest/v10/chain/cosmos" "github.com/cosmos/interchaintest/v10/testutil" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" e2esuite "github.com/CosmosContracts/juno/tests/interchaintest/suite" + votingsnapshottypes "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" ) -const stateSyncSnapshotInterval = 10 +const ( + stateSyncSnapshotInterval = 10 + stateSyncTimeout = 3 * time.Minute +) type NodeTestSuite struct { *e2esuite.E2ETestSuite } +// stateSyncSpec returns an isolated topology. In particular, it does not add +// overrides to suite.DefaultConfig or change the integer pointers in +// suite.DefaultSpec, both of which are shared by parallel E2E packages. +func stateSyncSpec() *interchaintest.ChainSpec { + numValidators := 1 + numFullNodes := 2 // CometBFT requires two RPC entries; use distinct live nodes. + noHostMount := e2esuite.DefaultNoHostMount + + config := e2esuite.DefaultConfig.Clone() + config.ConfigFileOverrides = snapshotConfigOverrides() + + return &interchaintest.ChainSpec{ + ChainName: e2esuite.DefaultSpec.ChainName, + Name: e2esuite.DefaultSpec.Name, + NumValidators: &numValidators, + NumFullNodes: &numFullNodes, + Version: e2esuite.DefaultSpec.Version, + NoHostMount: &noHostMount, + ChainConfig: config, + } +} + +func snapshotConfigOverrides() map[string]any { + return map[string]any{ + "config/app.toml": testutil.Toml{ + "state-sync": testutil.Toml{ + "snapshot-interval": stateSyncSnapshotInterval, + "snapshot-keep-recent": 2, + }, + "pruning": "custom", + "pruning-keep-recent": stateSyncSnapshotInterval, + "pruning-interval": stateSyncSnapshotInterval, + }, + } +} + +func stateSyncNodeOverrides(trustHeight int64, trustHash string, providerHosts []string) map[string]any { + rpcServers := make([]string, len(providerHosts)) + for i, host := range providerHosts { + rpcServers[i] = fmt.Sprintf("tcp://%s:26657", host) + } + + return map[string]any{ + "config/config.toml": testutil.Toml{ + "statesync": testutil.Toml{ + "enable": true, + "rpc_servers": strings.Join(rpcServers, ","), + "trust_height": trustHeight, + "trust_hash": trustHash, + "trust_period": "1h", + "discovery_time": "15s", + "chunk_request_timeout": "10s", + }, + }, + } +} + func TestNodeTestSuite(t *testing.T) { s := e2esuite.NewE2ETestSuite( - []*interchaintest.ChainSpec{e2esuite.DefaultSpec}, + []*interchaintest.ChainSpec{stateSyncSpec()}, e2esuite.DefaultTxCfg, ) @@ -42,66 +104,70 @@ func (s *NodeTestSuite) TestStateSync() { t.Skip("skipping in short mode") } - // The suite spec uses DefaultSpec which doesn't provision any full nodes - // (NumFullNodes defaults to 0). The test below indexes s.Chain.FullNodes[0] - // to fetch a trusted block, so it panics on a zero-length slice. Until the - // spec is updated to spin up a full node alongside the validator (and the - // node addition is added to the upgrade path), skip rather than panic. - if len(s.Chain.FullNodes) == 0 { - t.Skip("TestStateSync requires at least one full node in the chain spec; current spec provisions only validators") - } - - configFileOverrides := make(map[string]any) - appTomlOverrides := make(testutil.Toml) - - // state sync snapshots every stateSyncSnapshotInterval blocks. - stateSync := make(testutil.Toml) - stateSync["snapshot-interval"] = stateSyncSnapshotInterval - appTomlOverrides["state-sync"] = stateSync - - // state sync snapshot interval must be a multi^ple of pruning keep every interval. - appTomlOverrides["pruning"] = "custom" - appTomlOverrides["pruning-keep-recent"] = stateSyncSnapshotInterval - appTomlOverrides["pruning-keep-every"] = stateSyncSnapshotInterval - appTomlOverrides["pruning-interval"] = stateSyncSnapshotInterval - - configFileOverrides["config/app.toml"] = appTomlOverrides + require.Len(t, s.Chain.Validators, 1, "state-sync suite must start a snapshot validator") + require.Len(t, s.Chain.FullNodes, 2, "state-sync suite must start two independent RPC providers") + providers := []*cosmos.ChainNode{s.Chain.Validators[0], s.Chain.FullNodes[0]} + providerHosts := []string{providers[0].HostName(), providers[1].HostName()} - // Wait for blocks so that nodes have a few state sync snapshot available + // Snapshot metadata uses the live application database, so querying it from + // a second process races the running node's database lock. Advancing two + // intervals and then successfully state-syncing the new node proves that a + // complete snapshot was produced and served. require.NoError(t, testutil.WaitForBlocks(s.Ctx, stateSyncSnapshotInterval*2, s.Chain)) - latestHeight, err := s.Chain.Height(s.Ctx) - require.NoError(t, err, "failed to fetch latest chain height") - - // Trusted height should be state sync snapshot interval blocks ago. - trustHeight := int64(latestHeight) - stateSyncSnapshotInterval - - firstFullNode := s.Chain.FullNodes[0] - - // Fetch block hash for trusted height. - blockRes, err := firstFullNode.Client.Block(s.Ctx, &trustHeight) - require.NoError(t, err, "failed to fetch trusted block") - trustHash := hex.EncodeToString(blockRes.BlockID.Hash) - - // Construct statesync parameters for new node to get in sync. - configFileOverrides = make(map[string]any) - configTomlOverrides := make(testutil.Toml) + require.NoError(t, err) + trustHeight := latestHeight - stateSyncSnapshotInterval + blockRes, err := providers[0].Client.Block(s.Ctx, &trustHeight) + require.NoError(t, err, + "trusted block query failed: provider=%s trust_height=%d latest_height=%d", + providerHosts[0], trustHeight, latestHeight, + ) + trustHash := strings.ToUpper(hex.EncodeToString(blockRes.BlockID.Hash)) + require.NotEmpty(t, trustHash, "empty trust hash: provider=%s trust_height=%d", providerHosts[0], trustHeight) - // Set trusted parameters and rpc servers for verification. - stateSync = make(testutil.Toml) - stateSync["trust_hash"] = trustHash - stateSync["trust_height"] = trustHeight - // State sync requires minimum of two RPC servers for verification. We can provide the same RPC twice though. - stateSync["rpc_servers"] = fmt.Sprintf("tcp://%s:26657,tcp://%s:26657", firstFullNode.HostName(), firstFullNode.HostName()) - configTomlOverrides["statesync"] = stateSync + t.Logf("state-sync diagnostics: providers=%v latest_height=%d trust_height=%d trust_hash=%s", + providerHosts, latestHeight, trustHeight, trustHash) - configFileOverrides["config/config.toml"] = configTomlOverrides + require.NoError(t, s.Chain.AddFullNodes(s.Ctx, stateSyncNodeOverrides(trustHeight, trustHash, providerHosts), 1), + "add state-sync node failed: providers=%v latest_height=%d trust_height=%d trust_hash=%s", + providerHosts, latestHeight, trustHeight, trustHash, + ) + stateSyncNode := s.Chain.FullNodes[len(s.Chain.FullNodes)-1] + + var providerHeight, syncedHeight int64 + var providerHeightErr, syncedHeightErr error + require.Eventually(t, func() bool { + providerHeight, providerHeightErr = providers[0].Height(s.Ctx) + syncedHeight, syncedHeightErr = stateSyncNode.Height(s.Ctx) + return providerHeightErr == nil && syncedHeightErr == nil && syncedHeight >= providerHeight-1 + }, stateSyncTimeout, time.Second, + "state-sync node did not catch tip: node=%s node_height=%d node_error=%v provider=%s provider_height=%d provider_error=%v trust_height=%d trust_hash=%s rpc_providers=%v", + stateSyncNode.HostName(), syncedHeight, syncedHeightErr, providerHosts[0], providerHeight, providerHeightErr, + trustHeight, trustHash, providerHosts, + ) - // Now that nodes are providing state sync snapshots, state sync a new node. - require.NoError(t, s.Chain.AddFullNodes(s.Ctx, configFileOverrides, 1)) + // Catching the tip proves liveness, not restored-state correctness. Compare + // one exact app hash and query consensus-sensitive module state through the + // new node's own gRPC connection. + verifyHeight := syncedHeight + providerBlock, err := providers[0].Client.Block(s.Ctx, &verifyHeight) + require.NoError(t, err) + syncedBlock, err := stateSyncNode.Client.Block(s.Ctx, &verifyHeight) + require.NoError(t, err) + require.Equal(t, providerBlock.Block.Header.AppHash, syncedBlock.Block.Header.AppHash) + + expectedParams := s.QueryVotingSnapshotParams() + expectedTotal := s.QueryTotalVotingPowerAt(verifyHeight) + syncedVotingClient := votingsnapshottypes.NewQueryClient(stateSyncNode.GrpcConn) + paramsResp, err := syncedVotingClient.Params(s.Ctx, &votingsnapshottypes.QueryParamsRequest{}) + require.NoError(t, err) + require.Equal(t, expectedParams, paramsResp.Params) + totalResp, err := syncedVotingClient.TotalVotingPowerAt(s.Ctx, &votingsnapshottypes.QueryTotalVotingPowerAtRequest{ + AtHeight: verifyHeight, + }) + require.NoError(t, err) + require.Equal(t, expectedTotal, totalResp.Power) - // Wait for new node to be in sync. - ctx, cancel := context.WithTimeout(s.Ctx, 30*time.Second) - defer cancel() - require.NoError(t, testutil.WaitForInSync(ctx, s.Chain, s.Chain.FullNodes[len(s.Chain.FullNodes)-1])) + t.Logf("state-sync verified: initial_height=%d trust_height=%d verified_height=%d app_hash=%X voting_power=%s", + latestHeight, trustHeight, verifyHeight, syncedBlock.Block.Header.AppHash, totalResp.Power) } diff --git a/interchaintest/tests/pfm/escrow_test.go b/interchaintest/tests/pfm/escrow_test.go new file mode 100644 index 000000000..2f4466e34 --- /dev/null +++ b/interchaintest/tests/pfm/escrow_test.go @@ -0,0 +1,33 @@ +package ibc_test + +import ( + "testing" + + "github.com/cosmos/interchaintest/v10/ibc" + "github.com/stretchr/testify/require" + + sdk "github.com/cosmos/cosmos-sdk/types" + transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" +) + +func TestPFMEscrowAccountsUseEachHopsChannel(t *testing.T) { + prefixes := [3]string{"juno-a", "juno-b", "juno-c"} + abChan := &ibc.ChannelOutput{PortID: "transfer", ChannelID: "channel-0"} + bcChan := ibc.ChannelCounterparty{PortID: "transfer", ChannelID: "channel-7"} + cdChan := ibc.ChannelCounterparty{PortID: "transfer", ChannelID: "channel-42"} + + accounts := pfmEscrowAccounts(prefixes, abChan, bcChan, cdChan) + + channels := [3]ibc.ChannelCounterparty{ + {PortID: abChan.PortID, ChannelID: abChan.ChannelID}, + bcChan, + cdChan, + } + for i, channel := range channels { + expected := sdk.MustBech32ifyAddressBytes( + prefixes[i], + transfertypes.GetEscrowAddress(channel.PortID, channel.ChannelID), + ) + require.Equal(t, expected, accounts[i], "hop %d must use its own channel ID", i+1) + } +} diff --git a/interchaintest/tests/pfm/pfm_test.go b/interchaintest/tests/pfm/pfm_test.go index 7aa1145fc..bd74b6212 100644 --- a/interchaintest/tests/pfm/pfm_test.go +++ b/interchaintest/tests/pfm/pfm_test.go @@ -15,7 +15,7 @@ import ( "github.com/stretchr/testify/suite" e2esuite "github.com/CosmosContracts/juno/tests/interchaintest/suite" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" sdk "github.com/cosmos/cosmos-sdk/types" transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" ) @@ -34,6 +34,18 @@ type ForwardMetadata struct { RefundSequence *uint64 `json:"refund_sequence,omitempty"` } +func pfmEscrowAccounts( + prefixes [3]string, + abChan *ibc.ChannelOutput, + bcChan, cdChan ibc.ChannelCounterparty, +) [3]string { + return [3]string{ + sdk.MustBech32ifyAddressBytes(prefixes[0], transfertypes.GetEscrowAddress(abChan.PortID, abChan.ChannelID)), + sdk.MustBech32ifyAddressBytes(prefixes[1], transfertypes.GetEscrowAddress(bcChan.PortID, bcChan.ChannelID)), + sdk.MustBech32ifyAddressBytes(prefixes[2], transfertypes.GetEscrowAddress(cdChan.PortID, cdChan.ChannelID)), + } +} + type PfmTestSuite struct { *e2esuite.E2ETestSuite @@ -187,9 +199,16 @@ func (s *PfmTestSuite) TestPacketForwardMiddlewareRouter() { secondHopIBCDenom := secondHopDenomTrace.IBCDenom() thirdHopIBCDenom := thirdHopDenomTrace.IBCDenom() - firstHopEscrowAccount := sdk.MustBech32ifyAddressBytes(s.Chain.Config().Bech32Prefix, transfertypes.GetEscrowAddress(abChan.PortID, abChan.ChannelID)) - secondHopEscrowAccount := sdk.MustBech32ifyAddressBytes(s.Chains[1].Config().Bech32Prefix, transfertypes.GetEscrowAddress(bcChan.PortID, bcChan.ChannelID)) - thirdHopEscrowAccount := sdk.MustBech32ifyAddressBytes(s.Chains[2].Config().Bech32Prefix, transfertypes.GetEscrowAddress(cdChan.PortID, abChan.ChannelID)) + escrowAccounts := pfmEscrowAccounts( + [3]string{ + s.Chain.Config().Bech32Prefix, + s.Chains[1].Config().Bech32Prefix, + s.Chains[2].Config().Bech32Prefix, + }, + abChan, + bcChan, + cdChan, + ) t.Run("multi-hop a->b->c->d", func(t *testing.T) { // Send packet from Chain A->Chain B->Chain C->Chain D @@ -253,22 +272,22 @@ func (s *PfmTestSuite) TestPacketForwardMiddlewareRouter() { require.True(t, chainABalance.LTE(expectedChainA) && chainABalance.GTE(expectedChainA.Sub(sdkmath.NewInt(1_000_000))), "chainABalance %s outside fee tolerance of expected %s", chainABalance, expectedChainA) - require.Equal(t, sdkmath.NewInt(0), chainBBalance) - require.Equal(t, sdkmath.NewInt(0), chainCBalance) - require.Equal(t, transferAmount.Int64(), chainDBalance.Int64()) + require.Equal(t, sdkmath.ZeroInt(), chainBBalance, "first-hop receiver balance") + require.Equal(t, sdkmath.ZeroInt(), chainCBalance, "second-hop receiver balance") + require.Equal(t, transferAmount, chainDBalance, "third-hop receiver balance") - firstHopEscrowBalance, err := s.Chain.GetBalance(s.Ctx, firstHopEscrowAccount, s.Chain.Config().Denom) + firstHopEscrowBalance, err := s.Chain.GetBalance(s.Ctx, escrowAccounts[0], s.Chain.Config().Denom) require.NoError(t, err) - secondHopEscrowBalance, err := s.Chains[1].GetBalance(s.Ctx, secondHopEscrowAccount, firstHopIBCDenom) + secondHopEscrowBalance, err := s.Chains[1].GetBalance(s.Ctx, escrowAccounts[1], firstHopIBCDenom) require.NoError(t, err) - thirdHopEscrowBalance, err := s.Chains[2].GetBalance(s.Ctx, thirdHopEscrowAccount, secondHopIBCDenom) + thirdHopEscrowBalance, err := s.Chains[2].GetBalance(s.Ctx, escrowAccounts[2], secondHopIBCDenom) require.NoError(t, err) - require.Equal(t, transferAmount.Int64(), firstHopEscrowBalance.Int64()) - require.Equal(t, transferAmount.Int64(), secondHopEscrowBalance.Int64()) - require.Equal(t, transferAmount.Int64(), thirdHopEscrowBalance.Int64()) + require.Equal(t, transferAmount, firstHopEscrowBalance, "first-hop escrow balance") + require.Equal(t, transferAmount, secondHopEscrowBalance, "second-hop escrow balance") + require.Equal(t, transferAmount, thirdHopEscrowBalance, "third-hop escrow balance") }) err = s.Relayer.StopRelayer(s.Ctx, s.eRep) diff --git a/interchaintest/tests/tokenfactory/tokenfactory_test.go b/interchaintest/tests/tokenfactory/tokenfactory_test.go index df2543f04..537dbe79f 100644 --- a/interchaintest/tests/tokenfactory/tokenfactory_test.go +++ b/interchaintest/tests/tokenfactory/tokenfactory_test.go @@ -11,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - tftypes "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + tftypes "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) type TokenfactoryTestSuite struct { diff --git a/interchaintest/tests/upgrade/chain_upgrade_helpers_test.go b/interchaintest/tests/upgrade/chain_upgrade_helpers_test.go new file mode 100644 index 000000000..646bef429 --- /dev/null +++ b/interchaintest/tests/upgrade/chain_upgrade_helpers_test.go @@ -0,0 +1,28 @@ +package upgrade_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + e2esuite "github.com/CosmosContracts/juno/tests/interchaintest/suite" +) + +func TestUpgradeChainSpecsPinV30AndTwoChainTopology(t *testing.T) { + require.Equal(t, "v31", upgradeName) + const expectedBaseImage = "v30.0.0@sha256:081346b118fd327afb6f688ae6d6c6a430a8ff6260d9cd56e0db06630560c4db" + + specs := upgradeChainSpecs() + require.Len(t, specs, 2) + + for i, spec := range specs { + require.Equal(t, expectedBaseImage, spec.Version, "chain %d must start at the exact immutable image under test", i) + require.Equal(t, expectedBaseImage, spec.ChainConfig.Images[0].Version) + require.Equal(t, e2esuite.JunoRepo, spec.ChainConfig.Images[0].Repository) + require.Equal(t, "0.075"+e2esuite.DefaultDenom, spec.ChainConfig.GasPrices) + } + + require.Equal(t, "juno-upgrade-1", specs[0].ChainConfig.ChainID) + require.Equal(t, "juno-upgrade-2", specs[1].ChainConfig.ChainID) + require.NotEqual(t, specs[0].ChainConfig.ChainID, specs[1].ChainConfig.ChainID) +} diff --git a/interchaintest/tests/upgrade/chain_upgrade_test.go b/interchaintest/tests/upgrade/chain_upgrade_test.go index 26c13efd3..38aeed0b5 100644 --- a/interchaintest/tests/upgrade/chain_upgrade_test.go +++ b/interchaintest/tests/upgrade/chain_upgrade_test.go @@ -1,252 +1,254 @@ package upgrade_test import ( - "encoding/json" "fmt" "strconv" "testing" "cosmossdk.io/math" "github.com/cosmos/interchaintest/v10" - "github.com/cosmos/interchaintest/v10/chain/cosmos" "github.com/cosmos/interchaintest/v10/ibc" + "github.com/cosmos/interchaintest/v10/testreporter" "github.com/cosmos/interchaintest/v10/testutil" - "github.com/stretchr/testify/suite" sdk "github.com/cosmos/cosmos-sdk/types" + transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types" e2esuite "github.com/CosmosContracts/juno/tests/interchaintest/suite" ) const ( - upgradeName = "v30" - // Deliberately different from the handler's 25M fallback so the - // post-upgrade assertion proves feemarket read consensus max_gas - // rather than silently falling back. - expectedConsensusMaxGas = uint64(30_000_000) + upgradeName = "v31" + baseVersion = "v30.0.0" + baseImageDigest = "sha256:081346b118fd327afb6f688ae6d6c6a430a8ff6260d9cd56e0db06630560c4db" + ibcPath = "ab" ) -// baseChain is the current version of the chain that will be upgraded from +var baseImageVersion = baseVersion + "@" + baseImageDigest + var baseChain = ibc.DockerImage{ Repository: e2esuite.JunoRepo, - Version: "v29.0.0", + Version: baseImageVersion, UIDGID: "1025:1025", } +func TestV30BaseImageIsDigestPinned(t *testing.T) { + const expected = "v30.0.0@sha256:081346b118fd327afb6f688ae6d6c6a430a8ff6260d9cd56e0db06630560c4db" + if baseChain.Version != expected { + t.Fatalf("base image must be immutable: got %q, want %q", baseChain.Version, expected) + } +} + type UpgradeTestSuite struct { *e2esuite.E2ETestSuite -} -func TestUpgradeTestSuite(t *testing.T) { - cfg := e2esuite.DefaultConfig - cfg.Images = []ibc.DockerImage{baseChain} + eRep *testreporter.RelayerExecReporter +} +func upgradeChainSpecs() []*interchaintest.ChainSpec { numValidators := 2 numFullNodes := 1 - previousVersionGenesis := []cosmos.GenesisKV{ - { - Key: "app_state.gov.params.voting_period", - Value: e2esuite.DefaultVotingPeriod, - }, - { - Key: "app_state.gov.params.max_deposit_period", - Value: e2esuite.DefaultMaxDepositPeriod, - }, - { - Key: "app_state.gov.params.min_deposit.0.denom", - Value: e2esuite.DefaultDenom, - }, - { - Key: "consensus.params.block.max_gas", - Value: strconv.FormatUint(expectedConsensusMaxGas, 10), - }, + newSpec := func(chainID string) *interchaintest.ChainSpec { + cfg := e2esuite.DefaultConfig + cfg.ChainID = chainID + cfg.Images = []ibc.DockerImage{baseChain} + cfg.GasPrices = "0.075" + e2esuite.DefaultDenom + + return &interchaintest.ChainSpec{ + ChainName: chainID, + Name: "juno", + NumValidators: &numValidators, + NumFullNodes: &numFullNodes, + Version: baseImageVersion, + NoHostMount: &e2esuite.DefaultNoHostMount, + ChainConfig: cfg, + } } - cfg.ModifyGenesis = cosmos.ModifyGenesis(previousVersionGenesis) - - spec := &interchaintest.ChainSpec{ - ChainName: "juno", - Name: "juno", - NumValidators: &numValidators, - NumFullNodes: &numFullNodes, - Version: baseChain.Version, - NoHostMount: &e2esuite.DefaultNoHostMount, - ChainConfig: cfg, + + return []*interchaintest.ChainSpec{ + newSpec("juno-upgrade-1"), + newSpec("juno-upgrade-2"), } - specs := []*interchaintest.ChainSpec{spec} +} +func TestUpgradeTestSuite(t *testing.T) { s := e2esuite.NewE2ETestSuite( - specs, + upgradeChainSpecs(), e2esuite.DefaultTxCfg, + e2esuite.WithChainConstructor(e2esuite.MultipleChainsConstructor), + e2esuite.WithInterchainConstructor(e2esuite.TwoChainInterchainConstructor), ) + rep := testreporter.NewNopReporter() + eRep := rep.RelayerExecReporter(t) + t.Cleanup(func() { - _ = s.Ic.Close() + if s.Relayer != nil { + if err := s.Relayer.StopRelayer(s.Ctx, eRep); err != nil { + t.Logf("stopping relayer: %v", err) + } + } + if s.Ic != nil { + _ = s.Ic.Close() + } }) - testSuite := &UpgradeTestSuite{E2ETestSuite: s} + testSuite := &UpgradeTestSuite{E2ETestSuite: s, eRep: eRep} suite.Run(t, testSuite) } -func (s *UpgradeTestSuite) TestV30ChainUpgrade() { +func (s *UpgradeTestSuite) TestV31ChainUpgrade() { t := s.T() require := s.Require() if testing.Short() { t.Skip("skipping in short mode") } - fees := sdk.NewCoins(sdk.NewCoin(s.Denom, math.NewInt(100_000))) - user := s.GetAndFundTestUser(t.Name(), 10_000_000_000, s.Chain) + juno, counterparty := s.Chain, s.Chains[1] + fees := sdk.NewCoins(sdk.NewCoin(s.Denom, math.NewInt(1_000_000))) + user := s.GetAndFundTestUser(t.Name()+"-upgrade", 10_000_000_000, juno) + feeRecipient := s.GetAndFundTestUser(t.Name()+"-fee-recipient", 10_000_000, juno) + ibcRecipient := s.GetAndFundTestUser(t.Name()+"-ibc-recipient", 10_000_000, counterparty) + + // Build created the clients, connection and transfer channel while both + // chains still run v30. Start the relayer before the upgrade so the + // post-upgrade packet probes continuity of that existing IBC path. + channel, err := ibc.GetTransferChannel(s.Ctx, s.Relayer, s.eRep, juno.Config().ChainID, counterparty.Config().ChainID) + require.NoError(err) + require.NoError(s.Relayer.StartRelayer(s.Ctx, s.eRep, ibcPath)) + require.NoError(testutil.WaitForBlocks(s.Ctx, 2, juno, counterparty)) + + // Instantiate and execute an ordinary Wasm contract before the upgrade. + // Its code, instance and state are queried and mutated again on v31. + _, wasmContract := s.SetupContract(juno, user.KeyName(), "../../contracts/cw_template.wasm", `{"count":0}`, false, fees) + _, err = s.ExecuteMsgWithFeeReturn(juno, user, wasmContract, "", `{"increment":{}}`, false, fees) + require.NoError(err) + require.Equal(int64(1), s.queryWasmCount(wasmContract)) - // prepare a cw-hooks staking contract and ensure it is functional prior to upgrade - const cwHooksExampleWasm = "../../contracts/juno_staking_hooks_example.wasm" - _, hookContract := s.SetupContract(s.Chain, user.KeyName(), cwHooksExampleWasm, `{}`, false, fees) - s.legacyCwHooksCmd("register-staking", user, hookContract, fees) - stakingContracts := s.legacyGetCwHooksContracts("staking-contracts") - require.Contains(stakingContracts, hookContract, "cw-hooks contract was not registered with the staking module") + // Register a cw-hooks staking contract and prove it receives an event on v30. + _, hookContract := s.SetupContract(juno, user.KeyName(), "../../contracts/juno_staking_hooks_example.wasm", `{}`, false, fees) + s.RegisterCwHooksStaking(juno, user, hookContract) + require.Contains(s.GetCwHooksStakingContracts(), hookContract) - vals := s.QueryValidators(s.Chain) + vals := s.QueryValidators(juno) require.NotEmpty(vals, "expected at least one validator") valoper := vals[0] initialStakeAmt := int64(1_000_000) - initialStakeCoins := fmt.Sprintf("%d%s", initialStakeAmt, s.Denom) - s.StakeTokens(s.Chain, user, valoper.String(), initialStakeCoins, fees, false) - - initialHookState := s.GetCwStakingHookLastDelegationChange(s.Chain, hookContract, user.FormattedAddress()) - require.NotNil(initialHookState.Data, "pre-upgrade cw-hooks contract did not record the delegation event") - require.Equal(user.FormattedAddress(), initialHookState.Data.DelegatorAddress) - require.Equal(valoper, sdk.MustValAddressFromBech32(initialHookState.Data.ValidatorAddress)) - require.Equal(fmt.Sprintf("%d.000000000000000000", initialStakeAmt), initialHookState.Data.Shares) + s.StakeTokens(juno, user, valoper.String(), fmt.Sprintf("%d%s", initialStakeAmt, s.Denom), fees, false) + s.requireDelegationHook(hookContract, user.FormattedAddress(), valoper, initialStakeAmt) - // upgrade - height, err := s.Chain.Height(s.Ctx) + // Submit the exact v31 software-upgrade name to an exact v30.0.0 base. + height, err := juno.Height(s.Ctx) require.NoError(err, "error fetching height before submit upgrade proposal") - haltHeight := height + e2esuite.DefaultHaltHeightDelta - proposalID := s.SubmitSoftwareUpgradeProposal(s.Chain, user, upgradeName, haltHeight, e2esuite.DefaultAuthority) - + proposalID := s.SubmitSoftwareUpgradeProposal(juno, user, upgradeName, haltHeight, e2esuite.DefaultAuthority) proposalIDInt, err := strconv.ParseUint(proposalID, 10, 64) require.NoError(err, "failed to parse proposal ID") + s.ValidatorVoting(juno, proposalIDInt, height, haltHeight) - s.ValidatorVoting(s.Chain, proposalIDInt, height, haltHeight) + // The candidate remains the image selected by the normal ictest CI/local gate. repo, version := e2esuite.GetDockerImageInfo() - s.UpgradeNodes(s.Chain, s.DockerClient, haltHeight, repo, version) + s.UpgradeNodes(juno, s.DockerClient, haltHeight, repo, version) - // verify cw-hooks state survived the migration - postUpgradeContracts := s.GetCwHooksStakingContracts() - require.Contains(postUpgradeContracts, hookContract, "cw-hooks contract no longer registered after migration") - - cwHooksParams := s.QueryCwHooksParams() - require.Equal(uint64(3), cwHooksParams.ContractFailureRemovalThreshold, - "cw-hooks contract failure removal threshold should be migrated") + // Explicit fee execution: a real post-upgrade bank send must execute, credit + // the recipient exactly, and debit the sender by more than the sent amount. + feeProbeAmount := math.NewInt(123_456) + senderBefore, err := juno.GetBalance(s.Ctx, user.FormattedAddress(), s.Denom) + require.NoError(err) + recipientBefore, err := juno.GetBalance(s.Ctx, feeRecipient.FormattedAddress(), s.Denom) + require.NoError(err) + _, err = s.SendCoins(juno, user.KeyName(), user.FormattedAddress(), feeRecipient.FormattedAddress(), sdk.NewCoins(sdk.NewCoin(s.Denom, feeProbeAmount)), fees) + require.NoError(err) + senderAfter, err := juno.GetBalance(s.Ctx, user.FormattedAddress(), s.Denom) + require.NoError(err) + recipientAfter, err := juno.GetBalance(s.Ctx, feeRecipient.FormattedAddress(), s.Denom) + require.NoError(err) + require.Equal(recipientBefore.Add(feeProbeAmount), recipientAfter, "post-upgrade fee probe must deliver its bank send") + require.True(senderBefore.Sub(senderAfter).GT(feeProbeAmount), "sender must pay a non-zero fee in addition to the transfer") - additionalStakeAmt := int64(500_000) - additionalStakeCoins := fmt.Sprintf("%d%s", additionalStakeAmt, s.Denom) - s.StakeTokens(s.Chain, user, valoper.String(), additionalStakeCoins, fees, false) - - postHookState := s.GetCwStakingHookLastDelegationChange(s.Chain, hookContract, user.FormattedAddress()) - require.NotNil(postHookState.Data, "post-upgrade cw-hooks contract failed to record delegation event") - require.Equal(user.FormattedAddress(), postHookState.Data.DelegatorAddress) - require.Equal(valoper, sdk.MustValAddressFromBech32(postHookState.Data.ValidatorAddress)) - require.Equal(fmt.Sprintf("%d.000000000000000000", initialStakeAmt+additionalStakeAmt), postHookState.Data.Shares) - - // --- new v30 modules: feemarket (added store) must be initialized --- - // Params/State/GasPrice must all resolve to sane, positive dynamic-fee - // values after InitGenesis of the freshly-added feemarket store. + // Feemarket query probes complement the paid execution above. feemarketParams := s.QueryFeemarketParams() - require.True(feemarketParams.Enabled, "feemarket should be enabled after upgrade") - require.False(feemarketParams.MinBaseGasPrice.IsNil(), "feemarket min base gas price should be set") - require.True(feemarketParams.MinBaseGasPrice.IsPositive(), "feemarket min base gas price should be positive") - require.Equal(expectedConsensusMaxGas, feemarketParams.MaxBlockUtilization, - "feemarket max block utilization should match consensus block max gas") - - feemarketState := s.QueryFeemarketState() - require.False(feemarketState.BaseGasPrice.IsNil(), "feemarket base gas price state should be set") - require.True(feemarketState.BaseGasPrice.IsPositive(), "feemarket base gas price should be positive after upgrade") - + require.True(feemarketParams.Enabled) + require.True(feemarketParams.MinBaseGasPrice.IsPositive()) + require.Positive(feemarketParams.MaxBlockUtilization) + require.True(s.QueryFeemarketState().BaseGasPrice.IsPositive()) gasPrice := s.QueryFeemarketGasPrice(s.Denom) require.Equal(s.Denom, gasPrice.Denom) - require.True(gasPrice.Amount.IsPositive(), "feemarket gas price for %s should be positive", s.Denom) + require.True(gasPrice.Amount.IsPositive()) - // --- new v30 modules: voting-snapshot (added store) must be initialized --- - // InitGenesis seeds active delegators, and the post-upgrade delegation - // above writes a fresh snapshot. Both the module params and the gRPC power - // queries must return sane values. - vsParams := s.QueryVotingSnapshotParams() - require.Positive(vsParams.PruneInterval, "voting-snapshot prune interval should be a sane positive default") + // Wasm code/instance/state continuity: query pre-upgrade state, execute with + // an explicit fee on v31, then query the incremented value. + require.Equal(int64(1), s.queryWasmCount(wasmContract)) + _, err = s.ExecuteMsgWithFeeReturn(juno, user, wasmContract, "", `{"increment":{}}`, false, fees) + require.NoError(err) + require.Equal(int64(2), s.queryWasmCount(wasmContract)) - snapHeight, err := s.Chain.Height(s.Ctx) - require.NoError(err, "error fetching height for voting-snapshot query") + // cw-hooks registration and event delivery must both survive. A fresh v31 + // delegation event has cumulative shares distinct from the v30 event. + require.Contains(s.GetCwHooksStakingContracts(), hookContract) + cwHooksParams := s.QueryCwHooksParams() + require.Positive(cwHooksParams.ContractGasLimit) + additionalStakeAmt := int64(500_000) + s.StakeTokens(juno, user, valoper.String(), fmt.Sprintf("%d%s", additionalStakeAmt, s.Denom), fees, false) + s.requireDelegationHook(hookContract, user.FormattedAddress(), valoper, initialStakeAmt+additionalStakeAmt) - // Pre-upgrade delegator's snapshotted (LST-excluded) voting power must be - // positive — proving the store was initialized and hooks/backfill ran. + // Query voting-snapshot at a post-upgrade height after the fresh delegation. + vsParams := s.QueryVotingSnapshotParams() + require.Positive(vsParams.PruneInterval) + snapHeight, err := juno.Height(s.Ctx) + require.NoError(err) powerStr := s.QueryVotingPowerAt(user.FormattedAddress(), snapHeight) power, ok := math.NewIntFromString(powerStr) require.True(ok, "voting power %q should parse as an integer", powerStr) - require.True(power.IsPositive(), "pre-upgrade delegator should have positive snapshotted voting power") - - // It should not exceed the user's actual bonded delegation. + require.True(power.IsPositive()) delegation := s.QueryStakingDelegation(user.FormattedAddress(), valoper.String()) - require.True(power.LTE(delegation.Balance.Amount), - "snapshotted voting power (%s) should not exceed bonded delegation (%s)", power, delegation.Balance.Amount) - - // Chain-wide total voting power must be at least this single delegator's. + require.True(power.LTE(delegation.Balance.Amount)) totalStr := s.QueryTotalVotingPowerAt(snapHeight) total, ok := math.NewIntFromString(totalStr) require.True(ok, "total voting power %q should parse as an integer", totalStr) - require.True(total.GTE(power), "total voting power (%s) should be >= delegator power (%s)", total, power) + require.True(total.GTE(power)) + + // Send a real ICS-20 packet over the channel created before the upgrade, + // wait for its acknowledgement, and verify the counterparty voucher balance. + transferAmount := math.NewInt(77_777) + ibcDenom := transfertypes.ParseDenomTrace(transfertypes.GetPrefixedDenom( + channel.Counterparty.PortID, + channel.Counterparty.ChannelID, + juno.Config().Denom, + )).IBCDenom() + ibcBefore, err := counterparty.GetBalance(s.Ctx, ibcRecipient.FormattedAddress(), ibcDenom) + require.NoError(err) + transferHeight, err := juno.Height(s.Ctx) + require.NoError(err) + transferTx, err := s.SendIBCTransfer(juno, channel.ChannelID, user.KeyName(), ibc.WalletAmount{ + Address: ibcRecipient.FormattedAddress(), + Denom: juno.Config().Denom, + Amount: transferAmount, + }, ibc.TransferOptions{}) + require.NoError(err) + _, err = testutil.PollForAck(s.Ctx, juno, transferHeight, transferHeight+50, transferTx.Packet) + require.NoError(err, "post-upgrade IBC transfer was not acknowledged") + ibcAfter, err := counterparty.GetBalance(s.Ctx, ibcRecipient.FormattedAddress(), ibcDenom) + require.NoError(err) + require.Equal(ibcBefore.Add(transferAmount), ibcAfter, "counterparty did not receive the post-upgrade IBC voucher") } -func (s *UpgradeTestSuite) legacyCwHooksCmd(command string, user ibc.Wallet, contractAddr string, fees sdk.Coins) { - t := s.T() - require := s.Require() - - stdout, err := s.ExecTx( - s.Chain, - user.KeyName(), - false, - false, - "cw-hooks", - command, - contractAddr, - user.FormattedAddress(), - "--fees", - fees.String(), - "--gas", - "auto", - ) - require.NoError(err, "failed to execute legacy cw-hooks command") - - s.DebugOutput(string(stdout)) - - if err := testutil.WaitForBlocks(s.Ctx, 2, s.Chain); err != nil { - t.Fatal(err) - } +func (s *UpgradeTestSuite) queryWasmCount(contract string) int64 { + s.T().Helper() + var res e2esuite.GetCountResponse + err := s.SmartQueryString(s.Chain, contract, `{"get_count":{}}`, &res) + s.Require().NoError(err) + s.Require().NotNil(res.Data) + return res.Data.Count } -func (s *UpgradeTestSuite) legacyGetCwHooksContracts(subCmd string) []string { - t := s.T() - require := s.Require() - cmd := []string{ - "junod", "query", "cw-hooks", subCmd, - "--output", "json", - "--node", s.Chain.GetRPCAddress(), - } - - stdout, _, err := s.Chain.Exec(s.Ctx, cmd, nil) - require.NoError(err) - - s.DebugOutput(string(stdout)) - - type contracts struct { - Contracts []string `json:"contracts"` - } - - var c contracts - if err := json.Unmarshal(stdout, &c); err != nil { - t.Fatal(err) - } - - return c.Contracts +func (s *UpgradeTestSuite) requireDelegationHook(contract, delegator string, validator sdk.ValAddress, shares int64) { + s.T().Helper() + state := s.GetCwStakingHookLastDelegationChange(s.Chain, contract, delegator) + s.Require().NotNil(state.Data, "cw-hooks contract did not record the delegation event") + s.Require().Equal(delegator, state.Data.DelegatorAddress) + s.Require().Equal(validator, sdk.MustValAddressFromBech32(state.Data.ValidatorAddress)) + s.Require().Equal(fmt.Sprintf("%d.000000000000000000", shares), state.Data.Shares) } diff --git a/proto/Dockerfile b/proto/Dockerfile index 9ccb0eff6..7e84d4411 100644 --- a/proto/Dockerfile +++ b/proto/Dockerfile @@ -1,27 +1,27 @@ -# syntax=docker/dockerfile:1.6 +# syntax=docker/dockerfile:1.6@sha256:ac85f380a63b13dfcefa89046420e1781752bab202122f8f50032edf31be0021 # -------------------------------------------------------- # Build arguments # -------------------------------------------------------- -ARG GO_VERSION="1.25.2" +ARG GO_VERSION="1.25.10" ARG ALPINE_VERSION="3.22" # -------------------------------------------------------- # Base image with Go toolchain # -------------------------------------------------------- -FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base +FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION}@sha256:26b4d7113039cd51356bd7930ecafd1031d2975dc3b6940ec8ed09457e17cf95 AS base -ENV GOTOOLCHAIN=go1.25.2 \ +ENV GOTOOLCHAIN=go1.25.10 \ PATH=/go/bin:/usr/local/go/bin:/usr/local/bin:$PATH RUN apk add --no-cache \ - ca-certificates \ - curl \ - git \ - make \ - yq + ca-certificates=20260611-r0 \ + curl=8.14.1-r3 \ + git=2.49.1-r0 \ + make=4.4.1-r3 \ + yq-go=4.47.2-r3 # -------------------------------------------------------- # Tools stage warms Go module/tool caches diff --git a/proto/buf.gen.gogo.yaml b/proto/buf.gen.gogo.yaml index 86192d7f7..104b89578 100644 --- a/proto/buf.gen.gogo.yaml +++ b/proto/buf.gen.gogo.yaml @@ -23,14 +23,14 @@ inputs: plugins: - local: ["go", "tool", "protoc-gen-gocosmos"] - out: . + out: ./gen/gogo strategy: "directory" opt: - plugins=grpc - Mgoogle/protobuf/any.proto=github.com/cosmos/gogoproto/types/any - local: ["go", "tool", "protoc-gen-grpc-gateway"] strategy: "directory" - out: . + out: ./gen/gogo opt: - logtostderr=true - allow_colon_final_segments=true diff --git a/proto/buf.gen.openapi.yaml b/proto/buf.gen.openapi.yaml index cc5573577..35aca64cf 100644 --- a/proto/buf.gen.openapi.yaml +++ b/proto/buf.gen.openapi.yaml @@ -14,12 +14,12 @@ plugins: - fq_schema_naming=false - title=Juno REST API - version=v30.0.0 - - Mjuno/clock/module/v1/module.proto=github.com/CosmosContracts/juno/v30/api/juno/clock/module/v1 - - Mjuno/cwhooks/module/v2/module.proto=github.com/CosmosContracts/juno/v30/api/juno/cwhooks/module/v2 - - Mjuno/drip/module/v1/module.proto=github.com/CosmosContracts/juno/v30/api/juno/drip/module/v1 - - Mjuno/feepay/module/v1/module.proto=github.com/CosmosContracts/juno/v30/api/juno/feepay/module/v1 - - Mjuno/feeshare/module/v1/module.proto=github.com/CosmosContracts/juno/v30/api/juno/feeshare/module/v1 - - Mjuno/mint/module/v1/module.proto=github.com/CosmosContracts/juno/v30/api/juno/mint/module/v1 - - Mjuno/stream/module/v1/module.proto=github.com/CosmosContracts/juno/v30/api/juno/stream/module/v1 - - Mjuno/feemarket/module/v1/module.proto=github.com/CosmosContracts/juno/v30/api/juno/feemarket/module/v1 - - Mosmosis/tokenfactory/module/v1/module.proto=github.com/CosmosContracts/juno/v30/api/osmosis/tokenfactory/module/v1 + - Mjuno/clock/module/v1/module.proto=github.com/CosmosContracts/juno/v31/api/juno/clock/module/v1 + - Mjuno/cwhooks/module/v2/module.proto=github.com/CosmosContracts/juno/v31/api/juno/cwhooks/module/v2 + - Mjuno/drip/module/v1/module.proto=github.com/CosmosContracts/juno/v31/api/juno/drip/module/v1 + - Mjuno/feepay/module/v1/module.proto=github.com/CosmosContracts/juno/v31/api/juno/feepay/module/v1 + - Mjuno/feeshare/module/v1/module.proto=github.com/CosmosContracts/juno/v31/api/juno/feeshare/module/v1 + - Mjuno/mint/module/v1/module.proto=github.com/CosmosContracts/juno/v31/api/juno/mint/module/v1 + - Mjuno/stream/module/v1/module.proto=github.com/CosmosContracts/juno/v31/api/juno/stream/module/v1 + - Mjuno/feemarket/module/v1/module.proto=github.com/CosmosContracts/juno/v31/api/juno/feemarket/module/v1 + - Mosmosis/tokenfactory/module/v1/module.proto=github.com/CosmosContracts/juno/v31/api/osmosis/tokenfactory/module/v1 diff --git a/proto/juno/clock/module/v1/module.proto b/proto/juno/clock/module/v1/module.proto index 967907757..418ddf1f3 100644 --- a/proto/juno/clock/module/v1/module.proto +++ b/proto/juno/clock/module/v1/module.proto @@ -4,9 +4,11 @@ package juno.clock.module.v1; import "cosmos/app/v1alpha1/module.proto"; +option go_package = "github.com/CosmosContracts/juno/v31/api/juno/clock/module/v1"; + // Module is the config object of the mint module. message Module { - option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v30/x/clock"}; + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v31/x/clock"}; // authority defines the custom module authority. If not set, defaults to the // governance module. diff --git a/proto/juno/clock/v1/tx.proto b/proto/juno/clock/v1/tx.proto index 47f453d9c..41330457d 100644 --- a/proto/juno/clock/v1/tx.proto +++ b/proto/juno/clock/v1/tx.proto @@ -5,7 +5,6 @@ import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; import "juno/clock/v1/genesis.proto"; option go_package = "github.com/CosmosContracts/juno/x/clock/types"; diff --git a/proto/juno/cwhooks/module/v2/module.proto b/proto/juno/cwhooks/module/v2/module.proto index 07a986dd3..38bfda876 100644 --- a/proto/juno/cwhooks/module/v2/module.proto +++ b/proto/juno/cwhooks/module/v2/module.proto @@ -4,9 +4,11 @@ package juno.cwhooks.module.v2; import "cosmos/app/v1alpha1/module.proto"; +option go_package = "github.com/CosmosContracts/juno/v31/api/juno/cwhooks/module/v2"; + // Module is the config object of the mint module. message Module { - option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v30/x/cw-hooks"}; + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v31/x/cw-hooks"}; // authority defines the custom module authority. If not set, defaults to the // governance module. diff --git a/proto/juno/drip/module/v1/module.proto b/proto/juno/drip/module/v1/module.proto index 5bf391f44..5db301651 100644 --- a/proto/juno/drip/module/v1/module.proto +++ b/proto/juno/drip/module/v1/module.proto @@ -4,9 +4,11 @@ package juno.drip.module.v1; import "cosmos/app/v1alpha1/module.proto"; +option go_package = "github.com/CosmosContracts/juno/v31/api/juno/drip/module/v1"; + // Module is the config object of the mint module. message Module { - option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v30/x/drip"}; + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v31/x/drip"}; // authority defines the custom module authority. If not set, defaults to the // governance module. diff --git a/proto/juno/drip/v1/tx.proto b/proto/juno/drip/v1/tx.proto index c2297776c..f257ad7bf 100644 --- a/proto/juno/drip/v1/tx.proto +++ b/proto/juno/drip/v1/tx.proto @@ -6,7 +6,6 @@ import "cosmos/base/v1beta1/coin.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; import "juno/drip/v1/genesis.proto"; option go_package = "github.com/CosmosContracts/juno/x/drip/types"; diff --git a/proto/juno/feemarket/module/v1/module.proto b/proto/juno/feemarket/module/v1/module.proto index 3365a7a50..0f9acb2f4 100644 --- a/proto/juno/feemarket/module/v1/module.proto +++ b/proto/juno/feemarket/module/v1/module.proto @@ -4,9 +4,11 @@ package juno.feemarket.module.v1; import "cosmos/app/v1alpha1/module.proto"; +option go_package = "github.com/CosmosContracts/juno/v31/api/juno/feemarket/module/v1"; + // Module is the config object of the builder module. message Module { - option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v30/x/feemarket"}; + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v31/x/feemarket"}; // Authority defines the custom module authority. If not set, defaults to the // governance module. diff --git a/proto/juno/feepay/module/v1/module.proto b/proto/juno/feepay/module/v1/module.proto index ef02f7784..83454c68c 100644 --- a/proto/juno/feepay/module/v1/module.proto +++ b/proto/juno/feepay/module/v1/module.proto @@ -4,9 +4,11 @@ package juno.feepay.module.v1; import "cosmos/app/v1alpha1/module.proto"; +option go_package = "github.com/CosmosContracts/juno/v31/api/juno/feepay/module/v1"; + // Module is the config object of the mint module. message Module { - option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v30/x/feepay"}; + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v31/x/feepay"}; // authority defines the custom module authority. If not set, defaults to the // governance module. diff --git a/proto/juno/feepay/v1/genesis.proto b/proto/juno/feepay/v1/genesis.proto index 80e738b98..5977c0116 100644 --- a/proto/juno/feepay/v1/genesis.proto +++ b/proto/juno/feepay/v1/genesis.proto @@ -20,6 +20,12 @@ message GenesisState { (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; + + // wallet_usages are the per-contract wallet counters that enforce wallet limits. + repeated FeePayWalletUsage wallet_usages = 3 [ + (gogoproto.nullable) = false, + (amino.dont_omitempty) = true + ]; } // Params defines the feepay module params diff --git a/proto/juno/feepay/v1/tx.proto b/proto/juno/feepay/v1/tx.proto index 6df88fb3a..da8a5af9e 100644 --- a/proto/juno/feepay/v1/tx.proto +++ b/proto/juno/feepay/v1/tx.proto @@ -6,7 +6,6 @@ import "cosmos/base/v1beta1/coin.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; import "juno/feepay/v1/feepay.proto"; import "juno/feepay/v1/genesis.proto"; diff --git a/proto/juno/feeshare/module/v1/module.proto b/proto/juno/feeshare/module/v1/module.proto index cc07c5993..d56024268 100644 --- a/proto/juno/feeshare/module/v1/module.proto +++ b/proto/juno/feeshare/module/v1/module.proto @@ -4,9 +4,11 @@ package juno.feeshare.module.v1; import "cosmos/app/v1alpha1/module.proto"; +option go_package = "github.com/CosmosContracts/juno/v31/api/juno/feeshare/module/v1"; + // Module is the config object of the mint module. message Module { - option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v30/x/feeshare"}; + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v31/x/feeshare"}; // authority defines the custom module authority. If not set, defaults to the // governance module. diff --git a/proto/juno/feeshare/v1/tx.proto b/proto/juno/feeshare/v1/tx.proto index 21a30addf..a12f8fe12 100644 --- a/proto/juno/feeshare/v1/tx.proto +++ b/proto/juno/feeshare/v1/tx.proto @@ -5,7 +5,6 @@ import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; import "juno/feeshare/v1/genesis.proto"; option go_package = "github.com/CosmosContracts/juno/x/feeshare/types"; diff --git a/proto/juno/mint/module/v1/module.proto b/proto/juno/mint/module/v1/module.proto index 7ca514b76..b4249efd3 100644 --- a/proto/juno/mint/module/v1/module.proto +++ b/proto/juno/mint/module/v1/module.proto @@ -4,9 +4,11 @@ package juno.mint.module.v1; import "cosmos/app/v1alpha1/module.proto"; +option go_package = "github.com/CosmosContracts/juno/v31/api/juno/mint/module/v1"; + // Module is the config object of the mint module. message Module { - option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v30/x/mint"}; + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v31/x/mint"}; string fee_collector_name = 1; diff --git a/proto/juno/stream/module/v1/module.proto b/proto/juno/stream/module/v1/module.proto index 05b64aaf4..c74c29cc1 100644 --- a/proto/juno/stream/module/v1/module.proto +++ b/proto/juno/stream/module/v1/module.proto @@ -4,9 +4,11 @@ package juno.stream.module.v1; import "cosmos/app/v1alpha1/module.proto"; +option go_package = "github.com/CosmosContracts/juno/v31/api/juno/stream/module/v1"; + // Module is the config object of the stream module. message Module { - option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v30/x/stream"}; + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v31/x/stream"}; // authority defines the custom module authority. If not set, defaults to the // governance module. diff --git a/proto/juno/votingsnapshot/v1/query.proto b/proto/juno/votingsnapshot/v1/query.proto index 4a67b0286..eb6d4873c 100644 --- a/proto/juno/votingsnapshot/v1/query.proto +++ b/proto/juno/votingsnapshot/v1/query.proto @@ -35,11 +35,15 @@ service Query { } } +// QueryParamsRequest requests the current module parameters. message QueryParamsRequest {} + +// QueryParamsResponse contains the current module parameters. message QueryParamsResponse { Params params = 1 [(gogoproto.nullable) = false]; } +// QueryVotingPowerAtRequest requests an address's voting power at a height. message QueryVotingPowerAtRequest { string address = 1; // at_height is the chain height to look up power for. Named @@ -48,29 +52,35 @@ message QueryVotingPowerAtRequest { int64 at_height = 2; } +// QueryVotingPowerAtResponse contains an address's voting power. message QueryVotingPowerAtResponse { // power is the bonded stake amount as a base-10 string (uint). string power = 1; } +// QueryTotalVotingPowerAtRequest requests total voting power at a height. message QueryTotalVotingPowerAtRequest { int64 at_height = 1; } +// QueryTotalVotingPowerAtResponse contains total voting power. message QueryTotalVotingPowerAtResponse { string power = 1; } +// QueryVotingPowerOverRangeRequest requests an address's snapshots over a height range. message QueryVotingPowerOverRangeRequest { string address = 1; int64 from_height = 2; int64 to_height = 3; } +// QueryVotingPowerOverRangeResponse contains voting-power snapshots over a height range. message QueryVotingPowerOverRangeResponse { repeated HeightPower rows = 1 [(gogoproto.nullable) = false]; } +// HeightPower pairs a block height with its recorded voting power. message HeightPower { int64 height = 1; string power = 2; diff --git a/proto/juno/votingsnapshot/v1/tx.proto b/proto/juno/votingsnapshot/v1/tx.proto index dc38c7ff3..260303472 100644 --- a/proto/juno/votingsnapshot/v1/tx.proto +++ b/proto/juno/votingsnapshot/v1/tx.proto @@ -32,4 +32,5 @@ message MsgUpdateParams { Params params = 2 [(gogoproto.nullable) = false]; } +// MsgUpdateParamsResponse is returned after module parameters are updated. message MsgUpdateParamsResponse {} diff --git a/proto/osmosis/tokenfactory/module/v1/module.proto b/proto/osmosis/tokenfactory/module/v1/module.proto index ff1d77487..350abf3a2 100644 --- a/proto/osmosis/tokenfactory/module/v1/module.proto +++ b/proto/osmosis/tokenfactory/module/v1/module.proto @@ -4,9 +4,11 @@ package osmosis.tokenfactory.module.v1; import "cosmos/app/v1alpha1/module.proto"; +option go_package = "github.com/CosmosContracts/juno/v31/api/osmosis/tokenfactory/module/v1"; + // Module is the config object of the mint module. message Module { - option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v30/x/tokenfactory"}; + option (cosmos.app.v1alpha1.module) = {go_import: "github.com/CosmosContracts/juno/v31/x/tokenfactory"}; // authority defines the custom module authority. If not set, defaults to the // governance module. diff --git a/release.Dockerfile b/release.Dockerfile new file mode 100644 index 000000000..fd2222e40 --- /dev/null +++ b/release.Dockerfile @@ -0,0 +1,43 @@ +# syntax=docker/dockerfile:1.10 +# The multi-architecture builder and Go toolchain are pinned by index digest. +FROM golang:1.25.10-alpine3.22@sha256:26b4d7113039cd51356bd7930ecafd1031d2975dc3b6940ec8ed09457e17cf95 AS builder +ARG APK_CA_CERTIFICATES=20260611-r0 +ARG APK_BUILD_BASE=0.5-r3 +ARG APK_LINUX_HEADERS=6.14.2-r0 +ARG APK_GIT=2.49.1-r0 +RUN apk add --no-cache \ + "ca-certificates=$APK_CA_CERTIFICATES" \ + "build-base=$APK_BUILD_BASE" \ + "linux-headers=$APK_LINUX_HEADERS" \ + "git=$APK_GIT" && \ + apk info -v | LC_ALL=C sort >/build-dependencies.txt +WORKDIR /src +COPY go.mod go.sum ./ +RUN --mount=type=cache,target=/go/pkg/mod go mod download +COPY . . +ARG VERSION +ARG COMMIT +ARG SOURCE_DATE_EPOCH +ENV GOTOOLCHAIN=go1.25.10 SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH +RUN --mount=type=cache,target=/root/.cache/go-build \ + --mount=type=cache,target=/go/pkg/mod \ + LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true \ + VERSION="$VERSION" COMMIT="$COMMIT" LDFLAGS="-buildid=" make build && \ + file bin/junod | grep -q 'statically linked' && \ + go version -m bin/junod > /junod.modules + +FROM scratch AS artifact +COPY --from=builder /src/bin/junod /junod +COPY --from=builder /junod.modules /junod.modules +COPY --from=builder /build-dependencies.txt /build-dependencies.txt + +FROM golang:1.25.10-alpine3.22@sha256:26b4d7113039cd51356bd7930ecafd1031d2975dc3b6940ec8ed09457e17cf95 AS image +ARG VERSION +ARG COMMIT +ARG SOURCE_REPOSITORY=https://github.com/CosmosContracts/juno +LABEL org.opencontainers.image.title="Juno" \ + org.opencontainers.image.version="$VERSION" \ + org.opencontainers.image.revision="$COMMIT" \ + org.opencontainers.image.source="$SOURCE_REPOSITORY" +COPY --from=builder /src/bin/junod /bin/junod +ENTRYPOINT ["/bin/junod"] \ No newline at end of file diff --git a/scripts/buf/buf-gogo.sh b/scripts/buf/buf-gogo.sh index 5f3bca9fd..ba9674c5f 100644 --- a/scripts/buf/buf-gogo.sh +++ b/scripts/buf/buf-gogo.sh @@ -1,8 +1,18 @@ #!/usr/bin/env sh set -eo pipefail -go tool buf dep update +rm -rf gen/gogo go tool buf generate --template ./proto/buf.gen.gogo.yaml -cp -r ./github.com/CosmosContracts/juno/x/* x/ -rm -rf ./github.com +generated_root=./gen/gogo/github.com/CosmosContracts/juno +if [ -d "$generated_root/v31/x" ]; then + generated_types="$generated_root/v31/x" +elif [ -d "$generated_root/x" ]; then + generated_types="$generated_root/x" +else + echo "generated Gogo types were not found under $generated_root" >&2 + exit 1 +fi + +cp -r "$generated_types"/. ./x/ || exit 1 +rm -rf gen/gogo diff --git a/scripts/buf/buf-openapi.sh b/scripts/buf/buf-openapi.sh index 1447bdb3d..e9625b43c 100755 --- a/scripts/buf/buf-openapi.sh +++ b/scripts/buf/buf-openapi.sh @@ -1,7 +1,6 @@ #!/usr/bin/env sh set -eo pipefail -go tool buf dep update go tool buf generate --template ./proto/buf.gen.openapi.yaml go tool buf generate --template ./proto/buf.gen.openapi-cosmos.yaml go tool buf generate --template ./proto/buf.gen.openapi-ibc.yaml @@ -20,6 +19,7 @@ cd gen yq eval -i 'del(.tags)' openapi.yaml yq eval -i 'del(.paths[][].tags)' openapi.yaml +yq eval -i '(.paths[][] | select(has("parameters")) | .parameters) |= unique_by(.name + "\u0000" + .in)' openapi.yaml yq eval '.paths | keys | .[]' openapi.yaml | while IFS= read -r path; do normalizedPath="$path" diff --git a/scripts/buf/buf-pulsar.sh b/scripts/buf/buf-pulsar.sh index 8ff427dc3..50aa29168 100755 --- a/scripts/buf/buf-pulsar.sh +++ b/scripts/buf/buf-pulsar.sh @@ -1,5 +1,4 @@ #!/usr/bin/env sh set -eo pipefail -go tool buf dep update go tool buf generate --template ./proto/buf.gen.pulsar.yaml --output ./api diff --git a/scripts/rehearsal/test_validate_evidence.py b/scripts/rehearsal/test_validate_evidence.py new file mode 100644 index 000000000..859625554 --- /dev/null +++ b/scripts/rehearsal/test_validate_evidence.py @@ -0,0 +1,242 @@ +#!/usr/bin/env python3 + +import importlib.util +import unittest +from pathlib import Path + +MODULE = Path(__file__).with_name("validate_evidence.py") +SPEC = importlib.util.spec_from_file_location("validate_evidence", MODULE) +assert SPEC is not None +validator = importlib.util.module_from_spec(SPEC) +assert SPEC.loader is not None +SPEC.loader.exec_module(validator) + +APP_HASH_A = "a" * 64 +APP_HASH_B = "b" * 64 +CANONICAL_HASH_A = "c" * 64 + + +def valid_record(): + return { + "source": { + "version": "v30.0.0", + "git_commit": "1" * 40, + "image_digest": "sha256:" + "2" * 64, + "chain_id": "juno-1", + "state_provenance": "sanitized clone of mainnet snapshot provider-1 at height 100", + }, + "target": { + "version": "v31", + "git_commit": "3" * 40, + "image_digest": "sha256:" + "4" * 64, + }, + "runner": { + "identity": "release-engineer@example.invalid", + "environment": "ci-runner-17/linux-amd64", + }, + "commands": { + "export_import": ["junod export --height 100", "junod init && junod start"], + "state_sync": ["make ictest-node"], + "upgrade": ["make ictest-upgrade"], + }, + "export_import": { + "export_height": 100, + "pre_export_app_hash_height": 100, + "pre_export_app_hash": APP_HASH_A, + "post_import_app_hash_height": 101, + "post_import_app_hash": APP_HASH_B, + "module_version_map": { + "pre_export": {"count": 3, "sha256": CANONICAL_HASH_A}, + "post_import": {"count": 3, "sha256": CANONICAL_HASH_A}, + }, + }, + "state_sync": { + "snapshot_height": 120, + "trust_height": 110, + "verified_height": 130, + "provider_app_hash_height": 130, + "provider_app_hash": APP_HASH_A, + "synced_app_hash_height": 130, + "synced_app_hash": APP_HASH_A, + }, + "upgrade": { + "upgrade_height": 140, + "verified_height": 141, + }, + "modules": { + "feepay": { + "pre_restart": { + "height": 100, + "ledger_total": "1000000000000000000000000000000ujuno,7ibc/ABC", + "module_backing": "1000000000000000000000000000001ujuno,9ibc/ABC,5uatom", + "wallet_usages": {"count": 2, "sha256": CANONICAL_HASH_A}, + }, + "post_restart": { + "height": 101, + "ledger_total": "1000000000000000000000000000000ujuno,7ibc/ABC", + "module_backing": "1000000000000000000000000000001ujuno,9ibc/ABC,5uatom", + "wallet_usages": {"count": 2, "sha256": CANONICAL_HASH_A}, + }, + }, + "voting_snapshot": { + "pre_restart": {"height": 100, "total": "42"}, + "post_restart": {"height": 101, "total": "42"}, + "queryable": True, + }, + }, + "result": { + "export_import_passed": True, + "state_sync_passed": True, + "upgrade_passed": True, + }, + } + + +class EvidenceValidationTest(unittest.TestCase): + def test_accepts_complete_consistent_record_with_surplus_backing(self): + validator.validate(valid_record()) + + def test_accepts_arbitrary_precision_coins(self): + record = valid_record() + huge = "9" * 200 + for phase in ("pre_restart", "post_restart"): + record["modules"]["feepay"][phase]["ledger_total"] = f"{huge}ujuno" + record["modules"]["feepay"][phase]["module_backing"] = f"1{huge}ujuno" + validator.validate(record) + + def test_rejects_missing_source_provenance(self): + record = valid_record() + del record["source"]["state_provenance"] + with self.assertRaisesRegex(ValueError, "state_provenance"): + validator.validate(record) + + def test_rejects_missing_runner_identity(self): + record = valid_record() + record["runner"]["identity"] = "" + with self.assertRaisesRegex(ValueError, "runner.identity"): + validator.validate(record) + + def test_rejects_missing_reproduction_command(self): + record = valid_record() + record["commands"]["upgrade"] = [] + with self.assertRaisesRegex(ValueError, "commands.upgrade"): + validator.validate(record) + + def test_rejects_boolean_or_nonpositive_height(self): + for value in (True, 0, "100"): + with self.subTest(value=value): + record = valid_record() + record["export_import"]["export_height"] = value + with self.assertRaisesRegex(ValueError, "export_import.export_height"): + validator.validate(record) + + def test_rejects_hash_without_exact_matching_height(self): + record = valid_record() + record["state_sync"]["synced_app_hash_height"] = 129 + with self.assertRaisesRegex(ValueError, "same verified_height"): + validator.validate(record) + + def test_rejects_post_import_height_at_or_before_export_height(self): + for post_height in (100, 99): + with self.subTest(post_height=post_height): + record = valid_record() + record["export_import"]["post_import_app_hash_height"] = post_height + record["modules"]["feepay"]["post_restart"]["height"] = post_height + record["modules"]["voting_snapshot"]["post_restart"]["height"] = post_height + with self.assertRaisesRegex(ValueError, "must be after export_height"): + validator.validate(record) + + def test_rejects_unsupported_preservation_booleans(self): + record = valid_record() + del record["export_import"]["module_version_map"] + record["export_import"]["module_version_map_preserved"] = True + with self.assertRaisesRegex(ValueError, "module_version_map"): + validator.validate(record) + + record = valid_record() + for phase in ("pre_restart", "post_restart"): + del record["modules"]["feepay"][phase]["wallet_usages"] + record["modules"]["feepay"]["wallet_usages_preserved"] = True + with self.assertRaisesRegex(ValueError, "wallet_usages"): + validator.validate(record) + + def test_rejects_changed_module_version_map_evidence(self): + for field, value in (("count", 4), ("sha256", "d" * 64)): + with self.subTest(field=field): + record = valid_record() + record["export_import"]["module_version_map"]["post_import"][field] = value + with self.assertRaisesRegex(ValueError, "module version map changed"): + validator.validate(record) + + def test_rejects_changed_or_malformed_wallet_usage_evidence(self): + record = valid_record() + record["modules"]["feepay"]["post_restart"]["wallet_usages"]["sha256"] = "d" * 64 + with self.assertRaisesRegex(ValueError, "wallet usages changed"): + validator.validate(record) + + for field, value in (("count", True), ("count", -1), ("sha256", "ABC")): + with self.subTest(field=field, value=value): + record = valid_record() + record["modules"]["feepay"]["pre_restart"]["wallet_usages"][field] = value + with self.assertRaisesRegex(ValueError, "wallet_usages"): + validator.validate(record) + + def test_rejects_invalid_app_hashes(self): + for bad_hash in ("AA", "A" * 64, "a" * 63, "g" * 64, 123): + with self.subTest(app_hash=bad_hash): + record = valid_record() + record["export_import"]["pre_export_app_hash"] = bad_hash + with self.assertRaisesRegex(ValueError, "64-character lowercase hex"): + validator.validate(record) + + def test_rejects_fee_pay_under_backing_per_denom(self): + record = valid_record() + record["modules"]["feepay"]["post_restart"]["module_backing"] = ( + "999999999999999999999999999999ujuno,9ibc/ABC" + ) + with self.assertRaisesRegex(ValueError, "not fully backed"): + validator.validate(record) + + def test_rejects_malformed_or_missing_denom_coin_evidence(self): + for amount in ("1000000", "1.5ujuno", "-1ujuno", "1ujuno,2ujuno", {"amount": 1}): + with self.subTest(amount=amount): + record = valid_record() + record["modules"]["feepay"]["pre_restart"]["ledger_total"] = amount + with self.assertRaisesRegex(ValueError, "coin"): + validator.validate(record) + + def test_rejects_changed_fee_pay_ledger(self): + record = valid_record() + record["modules"]["feepay"]["post_restart"]["ledger_total"] = "8ibc/ABC,1000000000000000000000000000000ujuno" + with self.assertRaisesRegex(ValueError, "ledger changed"): + validator.validate(record) + + def test_rejects_nonnumeric_or_nonpositive_voting_total(self): + for total in ("forty-two", "0", "-1", 42, True): + with self.subTest(total=total): + record = valid_record() + record["modules"]["voting_snapshot"]["post_restart"]["total"] = total + with self.assertRaisesRegex(ValueError, "positive integer string"): + validator.validate(record) + + def test_rejects_changed_voting_total(self): + record = valid_record() + record["modules"]["voting_snapshot"]["post_restart"]["total"] = "43" + with self.assertRaisesRegex(ValueError, "current total changed"): + validator.validate(record) + + def test_rejects_state_sync_hash_mismatch(self): + record = valid_record() + record["state_sync"]["synced_app_hash"] = "c" * 64 + with self.assertRaisesRegex(ValueError, "state-sync app hashes differ"): + validator.validate(record) + + def test_rejects_incomplete_gate(self): + record = valid_record() + record["result"]["upgrade_passed"] = False + with self.assertRaisesRegex(ValueError, "mandatory rehearsal gates"): + validator.validate(record) + + +if __name__ == "__main__": + unittest.main() diff --git a/scripts/rehearsal/validate_evidence.py b/scripts/rehearsal/validate_evidence.py new file mode 100644 index 000000000..5bd694f6c --- /dev/null +++ b/scripts/rehearsal/validate_evidence.py @@ -0,0 +1,255 @@ +#!/usr/bin/env python3 +"""Validate evidence from a v30.0.0 -> v31 state rehearsal.""" + +from __future__ import annotations + +import argparse +import json +import re +import sys +from pathlib import Path +from typing import Any, NoReturn + +APP_HASH = re.compile(r"^[0-9a-f]{64}$") +GIT_SHA = re.compile(r"^[0-9a-f]{40}$") +COIN = re.compile(r"([0-9]+)([A-Za-z][A-Za-z0-9/:._-]{2,127})") +POSITIVE_INTEGER = re.compile(r"^[1-9][0-9]*$") + + +def fail(message: str) -> NoReturn: + raise ValueError(message) + + +def object_field(mapping: dict[str, Any], key: str, path: str) -> dict[str, Any]: + if key not in mapping: + fail(f"missing required field: {path}.{key}") + value = mapping[key] + if not isinstance(value, dict): + fail(f"{path}.{key} must be an object") + return value + + +def required(mapping: dict[str, Any], path: str, *keys: str) -> None: + for key in keys: + if key not in mapping: + fail(f"missing required field: {path}.{key}") + + +def nonempty_string(value: Any, name: str) -> str: + if not isinstance(value, str) or not value.strip(): + fail(f"{name} must be a non-empty string") + return value + + +def height(value: Any, name: str) -> int: + # bool is an int subclass, but cannot be accepted as numeric evidence. + if isinstance(value, bool) or not isinstance(value, int) or value <= 0: + fail(f"{name} must be a positive integer") + return value + + +def app_hash(value: Any, name: str) -> str: + if not isinstance(value, str) or not APP_HASH.fullmatch(value): + fail(f"{name} must be a 64-character lowercase hex app hash") + return value + + +def canonical_evidence(value: Any, name: str) -> tuple[int, str]: + """Validate a count and SHA-256 of a documented canonical JSON array.""" + if not isinstance(value, dict): + fail(f"{name} must be an object") + required(value, name, "count", "sha256") + count = value["count"] + if isinstance(count, bool) or not isinstance(count, int) or count < 0: + fail(f"{name}.count must be a non-negative integer") + digest = value["sha256"] + if not isinstance(digest, str) or not APP_HASH.fullmatch(digest): + fail(f"{name}.sha256 must be 64-character lowercase hex") + return count, digest + + +def parse_coins(value: Any, name: str) -> dict[str, int]: + """Parse canonical comma-separated Cosmos coins using arbitrary-size ints.""" + if not isinstance(value, str) or not value: + fail(f"{name} must be a non-empty coin string with denoms") + + coins: dict[str, int] = {} + for item in value.split(","): + match = COIN.fullmatch(item) + if match is None: + fail(f"{name} contains an invalid coin: {item!r}") + amount_text, denom = match.groups() + amount = int(amount_text) + if amount <= 0: + fail(f"{name} coin amounts must be positive") + if denom in coins: + fail(f"{name} contains duplicate coin denom: {denom}") + coins[denom] = amount + return coins + + +def positive_integer_string(value: Any, name: str) -> int: + # JSON strings preserve exact values emitted by Cosmos SDK integer queries. + if not isinstance(value, str) or not POSITIVE_INTEGER.fullmatch(value): + fail(f"{name} must be a positive integer string") + return int(value) + + +def validate(record: dict[str, Any]) -> None: + for key in ("source", "target", "runner", "commands", "export_import", "state_sync", "upgrade", "modules", "result"): + object_field(record, key, "record") + + source = record["source"] + target = record["target"] + runner = record["runner"] + commands = record["commands"] + export_import = record["export_import"] + state_sync = record["state_sync"] + upgrade = record["upgrade"] + modules = record["modules"] + result = record["result"] + + required(source, "source", "version", "git_commit", "image_digest", "chain_id", "state_provenance") + required(target, "target", "version", "git_commit", "image_digest") + if source["version"] != "v30.0.0": + fail("source.version must be v30.0.0") + if target["version"] != "v31": + fail("target.version must be v31") + nonempty_string(source["chain_id"], "source.chain_id") + nonempty_string(source["state_provenance"], "source.state_provenance") + for name, value in (("source.git_commit", source["git_commit"]), ("target.git_commit", target["git_commit"])): + if not isinstance(value, str) or not GIT_SHA.fullmatch(value): + fail(f"{name} must be a full lowercase git SHA") + for name, value in (("source.image_digest", source["image_digest"]), ("target.image_digest", target["image_digest"])): + if not isinstance(value, str) or not value.startswith("sha256:") or not APP_HASH.fullmatch(value[7:]): + fail(f"{name} must be sha256:<64 lowercase hex>") + + required(runner, "runner", "identity", "environment") + nonempty_string(runner["identity"], "runner.identity") + nonempty_string(runner["environment"], "runner.environment") + required(commands, "commands", "export_import", "state_sync", "upgrade") + for gate in ("export_import", "state_sync", "upgrade"): + gate_commands = commands[gate] + if not isinstance(gate_commands, list) or not gate_commands: + fail(f"commands.{gate} must be a non-empty command list") + for index, command in enumerate(gate_commands): + nonempty_string(command, f"commands.{gate}[{index}]") + + required( + export_import, + "export_import", + "export_height", + "pre_export_app_hash_height", + "pre_export_app_hash", + "post_import_app_hash_height", + "post_import_app_hash", + "module_version_map", + ) + export_height = height(export_import["export_height"], "export_import.export_height") + pre_export_height = height(export_import["pre_export_app_hash_height"], "export_import.pre_export_app_hash_height") + post_import_height = height(export_import["post_import_app_hash_height"], "export_import.post_import_app_hash_height") + if pre_export_height != export_height: + fail("export_import.pre_export_app_hash_height must equal export_height") + if post_import_height <= export_height: + fail("export_import.post_import_app_hash_height must be after export_height") + app_hash(export_import["pre_export_app_hash"], "export_import.pre_export_app_hash") + app_hash(export_import["post_import_app_hash"], "export_import.post_import_app_hash") + if "module_version_map_preserved" in export_import: + fail("export_import.module_version_map_preserved is unsupported; use module_version_map evidence") + version_map = object_field(export_import, "module_version_map", "export_import") + required(version_map, "export_import.module_version_map", "pre_export", "post_import") + version_map_pre = canonical_evidence(version_map["pre_export"], "export_import.module_version_map.pre_export") + version_map_post = canonical_evidence(version_map["post_import"], "export_import.module_version_map.post_import") + if version_map_pre != version_map_post: + fail("module version map changed across restart") + + required( + state_sync, + "state_sync", + "snapshot_height", + "trust_height", + "verified_height", + "provider_app_hash_height", + "provider_app_hash", + "synced_app_hash_height", + "synced_app_hash", + ) + snapshot_height = height(state_sync["snapshot_height"], "state_sync.snapshot_height") + trust_height = height(state_sync["trust_height"], "state_sync.trust_height") + verified_height = height(state_sync["verified_height"], "state_sync.verified_height") + provider_hash_height = height(state_sync["provider_app_hash_height"], "state_sync.provider_app_hash_height") + synced_hash_height = height(state_sync["synced_app_hash_height"], "state_sync.synced_app_hash_height") + if not trust_height < snapshot_height <= verified_height: + fail("invalid state-sync height ordering") + if provider_hash_height != verified_height or synced_hash_height != verified_height: + fail("state-sync app hashes must be recorded at the same verified_height") + provider_hash = app_hash(state_sync["provider_app_hash"], "state_sync.provider_app_hash") + synced_hash = app_hash(state_sync["synced_app_hash"], "state_sync.synced_app_hash") + if provider_hash != synced_hash: + fail("state-sync app hashes differ") + + required(upgrade, "upgrade", "upgrade_height", "verified_height") + upgrade_height = height(upgrade["upgrade_height"], "upgrade.upgrade_height") + upgrade_verified_height = height(upgrade["verified_height"], "upgrade.verified_height") + if upgrade_verified_height <= upgrade_height: + fail("upgrade.verified_height must be after upgrade.upgrade_height") + + feepay = object_field(modules, "feepay", "modules") + voting = object_field(modules, "voting_snapshot", "modules") + required(feepay, "modules.feepay", "pre_restart", "post_restart") + if "wallet_usages_preserved" in feepay: + fail("modules.feepay.wallet_usages_preserved is unsupported; use pre/post wallet_usages evidence") + fee_ledgers: list[dict[str, int]] = [] + wallet_usages: list[tuple[int, str]] = [] + for phase, expected_height in (("pre_restart", export_height), ("post_restart", post_import_height)): + evidence = object_field(feepay, phase, "modules.feepay") + required(evidence, f"modules.feepay.{phase}", "height", "ledger_total", "module_backing", "wallet_usages") + if height(evidence["height"], f"modules.feepay.{phase}.height") != expected_height: + fail(f"modules.feepay.{phase}.height does not match its exact restart height") + ledger = parse_coins(evidence["ledger_total"], f"modules.feepay.{phase}.ledger_total") + backing = parse_coins(evidence["module_backing"], f"modules.feepay.{phase}.module_backing") + if any(backing.get(denom, 0) < amount for denom, amount in ledger.items()): + fail(f"FeePay ledger is not fully backed at {phase}") + fee_ledgers.append(ledger) + wallet_usages.append(canonical_evidence(evidence["wallet_usages"], f"modules.feepay.{phase}.wallet_usages")) + if fee_ledgers[0] != fee_ledgers[1]: + fail("FeePay ledger changed across restart") + if wallet_usages[0] != wallet_usages[1]: + fail("FeePay wallet usages changed across restart") + + required(voting, "modules.voting_snapshot", "pre_restart", "post_restart", "queryable") + voting_totals: list[int] = [] + for phase, expected_height in (("pre_restart", export_height), ("post_restart", post_import_height)): + evidence = object_field(voting, phase, "modules.voting_snapshot") + required(evidence, f"modules.voting_snapshot.{phase}", "height", "total") + if height(evidence["height"], f"modules.voting_snapshot.{phase}.height") != expected_height: + fail(f"modules.voting_snapshot.{phase}.height does not match its exact restart height") + voting_totals.append(positive_integer_string(evidence["total"], f"modules.voting_snapshot.{phase}.total")) + if voting_totals[0] != voting_totals[1]: + fail("voting-snapshot current total changed across restart") + if voting["queryable"] is not True: + fail("voting-snapshot is not queryable") + + required(result, "result", "export_import_passed", "state_sync_passed", "upgrade_passed") + if not all(result[key] is True for key in ("export_import_passed", "state_sync_passed", "upgrade_passed")): + fail("one or more mandatory rehearsal gates did not pass") + + +def main() -> int: + parser = argparse.ArgumentParser() + parser.add_argument("record", type=Path) + args = parser.parse_args() + try: + record = json.loads(args.record.read_text()) + if not isinstance(record, dict): + fail("record root must be an object") + validate(record) + except (OSError, json.JSONDecodeError, ValueError) as exc: + print(f"INVALID: {exc}", file=sys.stderr) + return 1 + print("VALID: v30.0.0 -> v31 rehearsal evidence") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/scripts/release/build.sh b/scripts/release/build.sh new file mode 100755 index 000000000..4d523960c --- /dev/null +++ b/scripts/release/build.sh @@ -0,0 +1,58 @@ +#!/bin/sh +set -eu + +ROOT=$(CDPATH='' cd -- "$(dirname -- "$0")/../.." && pwd) +# shellcheck source=scripts/release/lib.sh +. "$ROOT/scripts/release/lib.sh" + +: "${VERSION:?VERSION must be the release tag (v31.x.y)}" +: "${COMMIT:?COMMIT must be the full tagged commit}" +: "${ARCH:?ARCH must be amd64 or arm64}" +: "${OUT_DIR:?OUT_DIR is required}" +validate_version "$VERSION" +validate_commit "$COMMIT" +[ "$(git -C "$ROOT" rev-parse HEAD)" = "$COMMIT" ] || { + echo "checkout does not match requested commit" >&2 + exit 1 +} +[ "$(git -C "$ROOT" rev-list -n1 "$VERSION^{commit}")" = "$COMMIT" ] || { + echo "tag does not resolve to requested commit" >&2 + exit 1 +} +: "${SOURCE_DATE_EPOCH:=$(git -C "$ROOT" show -s --format=%ct "$COMMIT")}" +export SOURCE_DATE_EPOCH + +tmp=$(mktemp -d) +trap 'rm -rf "$tmp"' EXIT INT TERM +build_once() { + destination=$1 + sequence=$2 + builder="juno-release-${ARCH}-$$-$sequence" + ( + trap 'docker buildx rm --force "$builder" >/dev/null 2>&1 || true' EXIT INT TERM + docker buildx create --name "$builder" --driver docker-container >/dev/null + docker buildx build --builder "$builder" --no-cache --pull \ + --platform "linux/$ARCH" --file "$ROOT/release.Dockerfile" \ + --build-arg "VERSION=$VERSION" --build-arg "COMMIT=$COMMIT" \ + --build-arg "SOURCE_DATE_EPOCH=$SOURCE_DATE_EPOCH" \ + --output "type=local,dest=$destination" "$ROOT" + ) +} +build_once "$tmp/first" first +# Separate cacheless BuildKit builders make this a clean rebuild gate rather +# than two exports of one cached compilation. +build_once "$tmp/second" second +for artifact in junod junod.modules build-dependencies.txt; do + cmp "$tmp/first/$artifact" "$tmp/second/$artifact" || { + echo "clean rebuild differed: $artifact" >&2 + exit 1 + } +done +binary="$tmp/first/junod" +[ -x "$binary" ] +long=$($binary version --long) +printf '%s\n' "$long" | grep -Fq "version: $VERSION" +printf '%s\n' "$long" | grep -Fq "commit: $COMMIT" +package_binary "$binary" "$ARCH" "$VERSION" "$COMMIT" "$OUT_DIR" +cp "$tmp/first/junod.modules" "$OUT_DIR/junod-linux-$ARCH.modules" +cp "$tmp/first/build-dependencies.txt" "$OUT_DIR/build-dependencies-linux-$ARCH.txt" diff --git a/scripts/release/lib.sh b/scripts/release/lib.sh new file mode 100755 index 000000000..23e3deb8c --- /dev/null +++ b/scripts/release/lib.sh @@ -0,0 +1,107 @@ +#!/bin/sh +# Shared, network-free release helpers. Inputs are deliberately strict because +# this file is also used by the privileged publication job. + +validate_version() { + case ${1-} in + v31.[0-9]*.[0-9]*) printf '%s' "$1" | grep -Eq '^v31\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-[0-9A-Za-z.-]+)?$' ;; + *) return 1 ;; + esac +} + +validate_commit() { + printf '%s' "${1-}" | grep -Eq '^[0-9a-f]{40}$' +} + +validate_sha256() { + printf '%s' "${1-}" | grep -Eq '^[0-9a-f]{64}$' +} + +resolve_local_tag_commit() { + repository=$1 + tag=$2 + validate_version "$tag" + git -C "$repository" show-ref --verify --quiet "refs/tags/$tag" || { + echo "requested release is not an exact Git tag: $tag" >&2 + return 1 + } + commit=$(git -C "$repository" rev-parse --verify "refs/tags/$tag^{commit}") || return 1 + validate_commit "$commit" || return 1 + printf '%s\n' "$commit" +} + +# Fetch a tag through a private validation ref and print its ref object and +# peeled commit. Optional expected values bind later checks to an earlier +# decision. Both ls-remote and fetch are checked so a move between them fails. +resolve_remote_tag_identity() { + repository=$1 remote=$2 tag=$3 expected_oid=${4-} expected_commit=${5-} + validate_version "$tag" || return 1 + line=$(git -C "$repository" ls-remote --exit-code "$remote" "refs/tags/$tag") || return 1 + [ "$(printf '%s\n' "$line" | wc -l | tr -d ' ')" = 1 ] || return 1 + remote_oid=${line%%[[:space:]]*} + validate_commit "$remote_oid" || return 1 + [ -z "$expected_oid" ] || [ "$remote_oid" = "$expected_oid" ] || { + echo "release tag object moved: expected $expected_oid, found $remote_oid" >&2 + return 1 + } + validation_ref="refs/release-validation/$tag" + git -C "$repository" update-ref -d "$validation_ref" >/dev/null 2>&1 || true + git -C "$repository" fetch --no-tags "$remote" "+refs/tags/$tag:$validation_ref" || return 1 + fetched_oid=$(git -C "$repository" rev-parse --verify "$validation_ref") || return 1 + [ "$fetched_oid" = "$remote_oid" ] || { + echo "release tag moved while validating" >&2 + return 1 + } + commit=$(git -C "$repository" rev-parse --verify "$validation_ref^{commit}") || return 1 + validate_commit "$commit" || return 1 + [ -z "$expected_commit" ] || [ "$commit" = "$expected_commit" ] || { + echo "release tag peeled commit moved: expected $expected_commit, found $commit" >&2 + return 1 + } + printf '%s %s\n' "$remote_oid" "$commit" +} + +require_absent_http_status() { + status=$1 + identity=$2 + case "$status" in + 404) return 0 ;; + 200) echo "refusing replay: $identity already exists" >&2 ;; + *) echo "existence guard failed closed for $identity (HTTP $status)" >&2 ;; + esac + return 1 +} + +package_binary() { + binary=$1 arch=$2 version=$3 commit=$4 out=$5 + validate_version "$version" + validate_commit "$commit" + case "$arch" in amd64 | arm64) ;; *) + echo "unsupported architecture: $arch" >&2 + return 1 + ;; + esac + : "${SOURCE_DATE_EPOCH:?SOURCE_DATE_EPOCH is required}" + + stage=$(mktemp -d) + trap 'rm -rf "$stage"' EXIT INT TERM + binary_name="junod-linux-$arch" + archive_name="juno-$version-linux-$arch.tar.gz" + mkdir -p "$out" + install -m 0755 "$binary" "$stage/$binary_name" + printf '{"version":"%s","commit":"%s","goos":"linux","goarch":"%s","source_date_epoch":%s}\n' \ + "$version" "$commit" "$arch" "$SOURCE_DATE_EPOCH" >"$stage/BUILD-METADATA.json" + cp "$stage/$binary_name" "$out/$binary_name" + TZ=UTC tar --sort=name --format=ustar --owner=0 --group=0 --numeric-owner \ + --mtime="@$SOURCE_DATE_EPOCH" -C "$stage" -cf - BUILD-METADATA.json "$binary_name" | + gzip -n -9 >"$out/$archive_name" + rm -rf "$stage" + trap - EXIT INT TERM +} + +generate_checksums() { + out=$1 + (cd "$out" && find . -maxdepth 1 -type f \ + ! -name SHA256SUMS -printf '%f\n' | + LC_ALL=C sort | xargs -r sha256sum) >"$out/SHA256SUMS" +} diff --git a/scripts/release/metadata.py b/scripts/release/metadata.py new file mode 100755 index 000000000..00e19448f --- /dev/null +++ b/scripts/release/metadata.py @@ -0,0 +1,227 @@ +#!/usr/bin/env python3 +"""Create deterministic dependency-bearing SPDX and SLSA release metadata.""" + +import argparse +import base64 +import hashlib +import json +import os +import re +from pathlib import Path +from typing import Any + +parser = argparse.ArgumentParser() +parser.add_argument("--directory", required=True) +parser.add_argument("--version", required=True) +parser.add_argument("--commit", required=True) +parser.add_argument("--repository", required=True) +parser.add_argument("--workflow-sha", required=True) +args = parser.parse_args() +root = Path(args.directory) + + +def sha(path: Path) -> str: + return hashlib.sha256(path.read_bytes()).hexdigest() + + +def go_sum_dirhash1(checksum: str) -> str: + """Convert Go's h1: directory Hash1 to in-toto dirHash1 lowercase hex.""" + if not checksum.startswith("h1:"): + raise ValueError(f"unsupported Go module checksum: {checksum}") + try: + digest = base64.b64decode(checksum[3:], validate=True) + except ValueError as exc: + raise ValueError(f"invalid Go module checksum: {checksum}") from exc + if len(digest) != hashlib.sha256().digest_size: + raise ValueError(f"invalid Go module checksum length: {checksum}") + return digest.hex() + + +def spdx_id(value: str) -> str: + readable = re.sub(r"[^A-Za-z0-9.-]", "-", value).strip("-.") or "item" + suffix = hashlib.sha256(value.encode()).hexdigest()[:16] + return f"SPDXRef-{readable[:80]}-{suffix}" + + +def module_package(identity: tuple[str, str, str], package_id: str, comment: str = "") -> dict[str, Any]: + name, version, checksum = identity + package: dict[str, Any] = { + "SPDXID": package_id, + "name": name, + "downloadLocation": "NOASSERTION", + "filesAnalyzed": False, + "licenseConcluded": "NOASSERTION", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + } + if version: + package["versionInfo"] = version + package["downloadLocation"] = f"https://proxy.golang.org/{name}/@v/{version}.zip" + package["externalRefs"] = [{ + "referenceCategory": "PACKAGE-MANAGER", + "referenceType": "purl", + "referenceLocator": f"pkg:golang/{name}@{version}", + }] + notes = [comment] if comment else [] + if checksum: + notes.append(f"Go module checksum {checksum}") + if notes: + package["comment"] = "; ".join(notes) + return package + + +binary_files = sorted( + path for path in root.iterdir() if path.is_file() and re.fullmatch(r"junod-linux-(amd64|arm64)", path.name) +) +files = sorted(binary_files + [path for path in root.iterdir() if path.is_file() and path.name.endswith(".tar.gz")]) +subjects = [{"name": path.name, "digest": {"sha256": sha(path)}} for path in files] + +# Each record is original name/version/checksum followed by the selected +# replacement name/version/checksum (empty when there is no replacement). +modules: set[tuple[str, str, str, str, str, str]] = set() +for module_file in sorted(root.glob("junod-linux-*.modules")): + pending: tuple[str, str, str] | None = None + for line in module_file.read_text().splitlines(): + fields = line.lstrip().split("\t") + if len(fields) >= 3 and fields[0] == "dep": + if pending: + modules.add((*pending, "", "", "")) + pending = (fields[1], fields[2], fields[3] if len(fields) > 3 and fields[3].startswith("h1:") else "") + elif len(fields) >= 2 and fields[0] == "=>": + if pending is None: + raise ValueError(f"replacement without dependency in {module_file}: {line}") + replacement_version = fields[2] if len(fields) > 2 else "" + replacement_checksum = fields[3] if len(fields) > 3 and fields[3].startswith("h1:") else "" + if replacement_version == "(devel)" or fields[1].startswith((".", "/")): + raise ValueError(f"local Go module replacement is not release-verifiable in {module_file}: {line}") + modules.add((*pending, fields[1], replacement_version, replacement_checksum)) + pending = None + elif pending: + modules.add((*pending, "", "", "")) + pending = None + if pending: + modules.add((*pending, "", "", "")) + +apk_packages: set[str] = set() +for package_file in sorted(root.glob("build-dependencies-linux-*.txt")): + apk_packages.update(line.strip() for line in package_file.read_text().splitlines() if line.strip()) + +package_map: dict[str, dict[str, Any]] = {} +relationship_map: dict[tuple[str, str, str], dict[str, str]] = {} + + +def add_package(package: dict[str, Any]) -> None: + package_id = package["SPDXID"] + previous = package_map.setdefault(package_id, package) + if previous != package: + raise ValueError(f"SPDX identifier collision: {package_id}") + + +def add_relationship(source: str, kind: str, target: str) -> None: + key = (source, kind, target) + relationship_map[key] = { + "spdxElementId": source, + "relationshipType": kind, + "relatedSpdxElement": target, + } + + +for binary in binary_files: + binary_id = spdx_id(binary.name) + add_package({ + "SPDXID": binary_id, + "name": binary.name, + "versionInfo": args.version, + "downloadLocation": "NOASSERTION", + "filesAnalyzed": False, + "licenseConcluded": "NOASSERTION", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "checksums": [{"algorithm": "SHA256", "checksumValue": sha(binary)}], + "comment": f"junod {args.version}, commit {args.commit}", + }) + add_relationship("SPDXRef-DOCUMENT", "DESCRIBES", binary_id) + +for name, version, checksum, replacement_name, replacement_version, replacement_checksum in sorted(modules): + original = (name, version, checksum) + original_id = spdx_id(f"go-original-{name}@{version}#{checksum}") + add_package(module_package(original, original_id, "Original dependency identity" if replacement_name else "")) + selected_id = original_id + if replacement_name: + replacement = (replacement_name, replacement_version, replacement_checksum) + selected_id = spdx_id(f"go-replacement-{replacement_name}@{replacement_version}#{replacement_checksum}") + add_package(module_package(replacement, selected_id, "Selected Go module replacement")) + add_relationship(selected_id, "VARIANT_OF", original_id) + for binary in binary_files: + add_relationship(spdx_id(binary.name), "DEPENDS_ON", selected_id) + +for package_version in sorted(apk_packages): + package_id = spdx_id(f"apk-{package_version}") + add_package({ + "SPDXID": package_id, + "name": package_version, + "versionInfo": package_version, + "downloadLocation": "https://dl-cdn.alpinelinux.org/alpine/v3.22/main", + "filesAnalyzed": False, + "licenseConcluded": "NOASSERTION", + "licenseDeclared": "NOASSERTION", + "copyrightText": "NOASSERTION", + "comment": "Package present in the release builder image", + }) + +sbom = { + "spdxVersion": "SPDX-2.3", + "dataLicense": "CC0-1.0", + "SPDXID": "SPDXRef-DOCUMENT", + "name": f"juno-{args.version}", + "documentNamespace": f"{args.repository}/releases/{args.version}/{args.commit}/sbom", + "creationInfo": {"created": "1970-01-01T00:00:00Z", "creators": ["Tool: scripts/release/metadata.py"]}, + "packages": [package_map[key] for key in sorted(package_map)], + "relationships": [relationship_map[key] for key in sorted(relationship_map)], +} + +resolved_dependencies: list[dict[str, Any]] = [ + {"uri": f"git+{args.repository}@refs/tags/{args.version}", "digest": {"gitCommit": args.commit}}, + { + "uri": "docker.io/library/golang:1.25.10-alpine3.22", + "digest": {"sha256": "26b4d7113039cd51356bd7930ecafd1031d2975dc3b6940ec8ed09457e17cf95"}, + }, +] +for name, version, checksum, replacement_name, replacement_version, replacement_checksum in sorted(modules): + original_dependency: dict[str, Any] = {"name": "original Go dependency", "uri": f"pkg:golang/{name}@{version}"} + if checksum: + original_dependency["digest"] = {"dirHash1": go_sum_dirhash1(checksum)} + if replacement_name: + original_dependency["annotations"] = {"selectedReplacement": f"{replacement_name}@{replacement_version}"} + resolved_dependencies.append(original_dependency) + if replacement_name: + replacement_dependency: dict[str, Any] = { + "name": f"selected replacement for {name}@{version}", + "uri": f"pkg:golang/{replacement_name}" + (f"@{replacement_version}" if replacement_version else ""), + "annotations": {"goOriginal": f"{name}@{version}", "goReplacement": f"{replacement_name}@{replacement_version}"}, + } + if replacement_checksum: + replacement_dependency["digest"] = {"dirHash1": go_sum_dirhash1(replacement_checksum)} + resolved_dependencies.append(replacement_dependency) +for package_version in sorted(apk_packages): + resolved_dependencies.append({"uri": f"pkg:apk/alpine/{package_version}?distro=alpine-3.22"}) + +provenance = { + "_type": "https://in-toto.io/Statement/v1", + "subject": subjects, + "predicateType": "https://slsa.dev/provenance/v1", + "predicate": { + "buildDefinition": { + "buildType": f"{args.repository}/.github/workflows/release.yml", + "externalParameters": {"version": args.version, "commit": args.commit}, + "resolvedDependencies": resolved_dependencies, + }, + "runDetails": { + "builder": {"id": f"{args.repository}/.github/workflows/release.yml@{args.workflow_sha}"}, + "metadata": {"invocationId": os.getenv("GITHUB_RUN_ID", "local")}, + }, + }, +} + +for output_name, value in (("SBOM.spdx.json", sbom), ("provenance.intoto.jsonl", provenance)): + (root / output_name).write_text(json.dumps(value, sort_keys=True, separators=(",", ":")) + "\n") diff --git a/scripts/release/test-release.sh b/scripts/release/test-release.sh new file mode 100755 index 000000000..da0a6b7a2 --- /dev/null +++ b/scripts/release/test-release.sh @@ -0,0 +1,184 @@ +#!/bin/sh +set -eu + +ROOT=$(CDPATH='' cd -- "$(dirname -- "$0")/../.." && pwd) +TMP=${TMPDIR:-/tmp}/juno-release-test.$$ +trap 'rm -rf "$TMP"' EXIT INT TERM +mkdir -p "$TMP/bin" "$TMP/out" "$TMP/existing" + +fail() { + printf 'not ok - %s\n' "$1" >&2 + exit 1 +} +pass() { printf 'ok - %s\n' "$1"; } + +# shellcheck source=scripts/release/lib.sh +. "$ROOT/scripts/release/lib.sh" + +validate_version v31.2.3 || fail "valid semantic version rejected" +if validate_version 31.2.3 2>/dev/null || validate_version v31.2 2>/dev/null || validate_version 'v31.2.3;id' 2>/dev/null; then + fail "invalid semantic version accepted" +fi +pass "strict v31 semantic version validation" + +commit=68d1cbd3c6a490bdbf9848ce4d55b8a10c82cda5 +workflow_sha=4444444444444444444444444444444444444444 +validate_commit "$commit" || fail "valid commit rejected" +if validate_commit deadbeef 2>/dev/null; then fail "short commit accepted"; fi +pass "full commit validation" + +git init -q "$TMP/tag-repo" +git -C "$TMP/tag-repo" config user.name release-test +git -C "$TMP/tag-repo" config user.email release-test@example.invalid +printf 'release source\n' >"$TMP/tag-repo/source" +git -C "$TMP/tag-repo" add source +git -C "$TMP/tag-repo" commit -qm initial +tag_commit=$(git -C "$TMP/tag-repo" rev-parse HEAD) +git -C "$TMP/tag-repo" branch v31.2.3 +if resolve_local_tag_commit "$TMP/tag-repo" v31.2.3 2>/dev/null; then fail "branch accepted as a release tag"; fi +git -C "$TMP/tag-repo" tag -a v31.2.3 -m release +[ "$(resolve_local_tag_commit "$TMP/tag-repo" v31.2.3)" = "$tag_commit" ] || fail "annotated tag did not peel to commit" +git -C "$TMP/tag-repo" tag v31.2.4 +[ "$(resolve_local_tag_commit "$TMP/tag-repo" v31.2.4)" = "$tag_commit" ] || fail "lightweight tag did not resolve to commit" +pass "release identity requires and peels an exact Git tag" + +git clone -q --bare "$TMP/tag-repo" "$TMP/tag-remote.git" +git -C "$TMP/tag-repo" remote add origin "$TMP/tag-remote.git" +identity=$(resolve_remote_tag_identity "$TMP/tag-repo" origin v31.2.3) +tag_oid=${identity%% *} +resolved_commit=${identity#* } +[ "$resolved_commit" = "$tag_commit" ] || fail "remote tag did not peel to expected commit" +identity=$(resolve_remote_tag_identity "$TMP/tag-repo" origin v31.2.4) +lightweight_oid=${identity%% *} +resolved_commit=${identity#* } +if [ "$lightweight_oid" != "$tag_commit" ] || [ "$resolved_commit" != "$tag_commit" ]; then + fail "remote lightweight tag identity was not preserved" +fi +printf 'moved source\n' >>"$TMP/tag-repo/source" +git -C "$TMP/tag-repo" commit -qam moved +git -C "$TMP/tag-repo" tag -fa v31.2.3 -m moved +git -C "$TMP/tag-repo" push -qf origin refs/tags/v31.2.3 +if resolve_remote_tag_identity "$TMP/tag-repo" origin v31.2.3 "$tag_oid" "$tag_commit" 2>/dev/null; then + fail "moved remote tag passed bound identity validation" +fi +pass "remote tag object and peeled commit are consistently bound" + +printf '#!/bin/sh\ncase "$1" in version) printf "v31.2.3\\n";; esac\n' >"$TMP/bin/junod" +chmod +x "$TMP/bin/junod" +SOURCE_DATE_EPOCH=1700000000 package_binary "$TMP/bin/junod" amd64 v31.2.3 "$commit" "$TMP/out" +archive="$TMP/out/juno-v31.2.3-linux-amd64.tar.gz" +[ -f "$archive" ] || fail "archive missing" +tar -xOf "$archive" BUILD-METADATA.json | grep -Fq "\"commit\":\"$commit\"" || fail "commit absent from archive metadata" +tar -xOf "$archive" BUILD-METADATA.json | grep -Fq '"version":"v31.2.3"' || fail "version absent from archive metadata" +first=$(sha256sum "$archive" | cut -d ' ' -f 1) +rm -rf "$TMP/out" && mkdir "$TMP/out" +SOURCE_DATE_EPOCH=1700000000 package_binary "$TMP/bin/junod" amd64 v31.2.3 "$commit" "$TMP/out" +second=$(sha256sum "$TMP/out/juno-v31.2.3-linux-amd64.tar.gz" | cut -d ' ' -f 1) +[ "$first" = "$second" ] || fail "clean package rebuild differs" +pass "byte-identical deterministic archive with embedded metadata" + +printf '\tdep\texample.com/original\tv1.0.0\th1:AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE=\n\t=>\texample.com/replacement\tv1.4.0\th1:AgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI=\n\tdep\texample.com/a+b\tv1.0.0\th1:AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM=\n\t=>\texample.com/shared\tv1.0.0\th1:BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ=\n\tdep\texample.com/a_b\tv1.0.0\th1:BQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU=\n\t=>\texample.com/shared\tv1.0.0\th1:BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ=\n' >"$TMP/out/junod-linux-amd64.modules" +printf 'build-base-0.5-r3\ngit-2.49.1-r0\n' >"$TMP/out/build-dependencies-linux-amd64.txt" + +generate_checksums "$TMP/out" +(cd "$TMP/out" && sha256sum --check SHA256SUMS) +listed=$(wc -l <"$TMP/out/SHA256SUMS" | tr -d ' ') +[ "$listed" = 4 ] || fail "checksum manifest does not cover every binary/archive/dependency record" +pass "SHA-256 manifest covers binaries, archives, and dependency records" + +python3 "$ROOT/scripts/release/metadata.py" --directory "$TMP/out" --version v31.2.3 \ + --commit "$commit" --repository https://github.com/juno-ai-dev/juno --workflow-sha "$workflow_sha" +python3 -m json.tool "$TMP/out/SBOM.spdx.json" >/dev/null +python3 -m json.tool "$TMP/out/provenance.intoto.jsonl" >/dev/null +python3 - "$TMP/out/provenance.intoto.jsonl" <<'PY' || fail "SLSA dependency digests are not lowercase hexadecimal" +import json, re, sys +statement = json.load(open(sys.argv[1])) +for dependency in statement["predicate"]["buildDefinition"]["resolvedDependencies"]: + for value in dependency.get("digest", {}).values(): + assert re.fullmatch(r"[0-9a-f]+", value), value + if dependency.get("name") in {"original Go dependency", "selected replacement for example.com/original@v1.0.0", "selected replacement for example.com/a+b@v1.0.0", "selected replacement for example.com/a_b@v1.0.0"}: + assert set(dependency.get("digest", {})) == {"dirHash1"}, dependency +PY +grep -Fq "$first" "$TMP/out/provenance.intoto.jsonl" || fail "archive absent from provenance subjects" +grep -Fq 'example.com/original' "$TMP/out/SBOM.spdx.json" || fail "original Go dependency absent from SBOM" +grep -Fq 'example.com/replacement' "$TMP/out/SBOM.spdx.json" || fail "selected Go replacement absent from SBOM" +grep -Fq 'build-base-0.5-r3' "$TMP/out/provenance.intoto.jsonl" || fail "builder package absent from provenance" +grep -Fq "release.yml@$workflow_sha" "$TMP/out/provenance.intoto.jsonl" || fail "trusted workflow SHA absent from builder identity" +sbom_first=$(sha256sum "$TMP/out/SBOM.spdx.json" | cut -d ' ' -f 1) +provenance_first=$(sha256sum "$TMP/out/provenance.intoto.jsonl" | cut -d ' ' -f 1) +printf ' dep example.com/original v1.0.0 h1:AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE=\n => example.com/replacement v1.4.1 h1:BgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgYGBgY=\n dep example.com/a+b v1.0.0 h1:AwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwM=\n => example.com/shared v1.0.0 h1:BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ=\n dep example.com/a_b v1.0.0 h1:BQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU=\n => example.com/shared v1.0.0 h1:BAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQ=\n' >"$TMP/out/junod-linux-amd64.modules" +python3 "$ROOT/scripts/release/metadata.py" --directory "$TMP/out" --version v31.2.3 \ + --commit "$commit" --repository https://github.com/juno-ai-dev/juno --workflow-sha "$workflow_sha" +[ "$sbom_first" != "$(sha256sum "$TMP/out/SBOM.spdx.json" | cut -d ' ' -f 1)" ] || fail "SBOM ignored selected replacement mutation" +[ "$provenance_first" != "$(sha256sum "$TMP/out/provenance.intoto.jsonl" | cut -d ' ' -f 1)" ] || fail "provenance ignored selected replacement mutation" +python3 - "$TMP/out/SBOM.spdx.json" <<'PY' || fail "SPDX identifiers collide" +import json, sys +document = json.load(open(sys.argv[1])) +packages = document["packages"] +ids = [package["SPDXID"] for package in packages] +assert len(ids) == len(set(ids)) +assert all(len(identifier.rsplit("-", 1)[-1]) == 16 for identifier in ids) +shared = [package for package in packages if package["name"] == "example.com/shared"] +assert len(shared) == 1 +shared_id = shared[0]["SPDXID"] +variants = [item for item in document["relationships"] if item["spdxElementId"] == shared_id and item["relationshipType"] == "VARIANT_OF"] +assert len(variants) == 2 +PY +mkdir -p "$TMP/local-replacement" +printf 'fixture\n' >"$TMP/local-replacement/junod-linux-amd64" +printf '\tdep\texample.com/original\tv1.0.0\th1:AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQE=\n\t=>\t../local-module\t(devel)\n' >"$TMP/local-replacement/junod-linux-amd64.modules" +if python3 "$ROOT/scripts/release/metadata.py" --directory "$TMP/local-replacement" --version v31.2.3 \ + --commit "$commit" --repository https://github.com/juno-ai-dev/juno --workflow-sha "$workflow_sha" 2>/dev/null; then + fail "local Go replacement produced misleading release metadata" +fi +pass "SPDX and SLSA include mutation-sensitive original/replacement identities and collision-resistant IDs" + +require_absent_http_status 404 fixture || fail "404 absence rejected" +if require_absent_http_status 200 fixture 2>/dev/null; then fail "existing identity accepted"; fi +if require_absent_http_status 500 fixture 2>/dev/null; then fail "registry/server failure accepted as absence"; fi +pass "existence guards distinguish absence and fail closed" + +workflow="$ROOT/.github/workflows/release.yml" +grep -Fq 'types: [edited]' "$workflow" && fail "release edits trigger publication" +grep -E '^[[:space:]]*- uses:' "$workflow" | grep -Ev '@[0-9a-f]{40}([[:space:]]|$)' >/dev/null && fail "release action is not pinned to a full SHA" +grep -Fq 'linux/amd64,linux/arm64' "$workflow" || fail "supported platforms absent" +grep -Fq 'provenance: mode=max' "$workflow" || fail "container provenance absent" +grep -Fq 'sbom: true' "$workflow" || fail "container SBOM absent" +grep -Fq 'existence guard failed closed' "$ROOT/scripts/release/lib.sh" || fail "fail-closed replay guard absent" +grep -Fq 'release-publication-${{ github.repository }}' "$workflow" || fail "global release serialization absent" +grep -Fq 'ref: ${{ needs.guard.outputs.commit }}' "$workflow" || fail "validated commit checkout absent" +grep -Fq 'path: source' "$workflow" || fail "container source checkout is not isolated" +grep -Fq 'path: policy' "$workflow" || fail "trusted container policy checkout is absent" +grep -Fq '. policy/scripts/release/lib.sh' "$workflow" || fail "container write job executes tag-controlled policy" +grep -Fq 'context: source' "$workflow" || fail "container build context is not bound to validated source" +grep -Fq 'file: source/release.Dockerfile' "$workflow" || fail "container Dockerfile is not bound to validated source" +grep -Fq 'EVENT_AFTER: ${{ github.event.after }}' "$workflow" || fail "tag push is not bound to event.after" +grep -Fq 'if [ "$EVENT_AFTER" != "$tag_oid" ]; then' "$workflow" || fail "tag push does not bind the exact event ref object" +grep -Fq "printf 'Authorization: Bearer %s' \"\$GH_TOKEN\"" "$workflow" || fail "authorization token is not interpolated" +python3 - "$workflow" <<'PY' || fail "authorization format discards the token argument" +import pathlib, sys +lines = [line for line in pathlib.Path(sys.argv[1]).read_text().splitlines() if "github_auth=$(printf" in line] +assert len(lines) == 1 +assert [ord(char) for char in "%s"] == [37, 115] +assert [37, 115] == [ord(char) for char in lines[0][lines[0].index("Bearer ") + 7:][:2]] +PY +grep -Fq 'push-by-digest=true,name-canonical=true,push=true' "$workflow" || fail "digest-only container publication absent" +if grep -Fq '${{ env.IMAGE }}:' "$workflow"; then fail "mutable container tag publication present"; fi +grep -Fq 'resolve_remote_tag_identity' "$workflow" || fail "side-effect source revalidation absent" +grep -Fq -- '--no-cache --pull' "$ROOT/scripts/release/build.sh" || fail "clean BuildKit rebuild guard absent" +grep -Fq 'APK_BUILD_BASE=0.5-r3' "$ROOT/release.Dockerfile" || fail "builder packages are not version pinned" +pass "workflow identity, replay, pinning, architecture, SBOM and provenance guards" + +# Exercise the operator checksum/extract/version/install commands from the guide +# against the deterministic fixture (network-only gh download is intentionally skipped). +( + cd "$TMP/out" && VERSION=v31.2.3 ARCH=amd64 HOME="$TMP/home" sh -eu <<'COMMANDS' +mkdir -p "$HOME/.local/bin" +grep -E " (junod-linux-$ARCH|juno-$VERSION-linux-$ARCH.tar.gz)$" SHA256SUMS | sha256sum --check +tar --extract --gzip --file "juno-$VERSION-linux-$ARCH.tar.gz" +./"junod-linux-$ARCH" version --long +install -m 0755 "junod-linux-$ARCH" "$HOME/.local/bin/junod" +"$HOME/.local/bin/junod" version --long +COMMANDS +) +pass "validator checksum and installation commands run verbatim" diff --git a/testutil/common/generate.go b/testutil/common/generate.go index 23e1df216..ab3733d62 100644 --- a/testutil/common/generate.go +++ b/testutil/common/generate.go @@ -19,7 +19,7 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - junoapp "github.com/CosmosContracts/juno/v30/app" + junoapp "github.com/CosmosContracts/juno/v31/app" ) // GenerateValidatorSet creates a ValidatorSet with n validators. diff --git a/testutil/fund.go b/testutil/fund.go index 886167f63..b1056934d 100644 --- a/testutil/fund.go +++ b/testutil/fund.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/bank/testutil" - minttypes "github.com/CosmosContracts/juno/v30/x/mint/types" + minttypes "github.com/CosmosContracts/juno/v31/x/mint/types" ) // FundAcc funds target address with specified amount. diff --git a/testutil/setup/leveldb.go b/testutil/setup/leveldb.go index 23d8783f3..e39eb4871 100644 --- a/testutil/setup/leveldb.go +++ b/testutil/setup/leveldb.go @@ -17,8 +17,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - junoapp "github.com/CosmosContracts/juno/v30/app" - "github.com/CosmosContracts/juno/v30/testutil/common" + junoapp "github.com/CosmosContracts/juno/v31/app" + "github.com/CosmosContracts/juno/v31/testutil/common" ) // SetupTestingAppWithLevelDB initializes a new App intended for testing, diff --git a/testutil/setup/setup.go b/testutil/setup/setup.go index 888296a82..035fc489a 100644 --- a/testutil/setup/setup.go +++ b/testutil/setup/setup.go @@ -18,8 +18,8 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - junoapp "github.com/CosmosContracts/juno/v30/app" - "github.com/CosmosContracts/juno/v30/testutil/common" + junoapp "github.com/CosmosContracts/juno/v31/app" + "github.com/CosmosContracts/juno/v31/testutil/common" ) var defaultGenesisStateBytes = []byte{} diff --git a/testutil/testutil.go b/testutil/testutil.go index 83fcbf262..0e15688d8 100644 --- a/testutil/testutil.go +++ b/testutil/testutil.go @@ -15,10 +15,10 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" - "github.com/CosmosContracts/juno/v30/app" - "github.com/CosmosContracts/juno/v30/cmd/junod/cmd" - "github.com/CosmosContracts/juno/v30/testutil/common" - "github.com/CosmosContracts/juno/v30/testutil/setup" + "github.com/CosmosContracts/juno/v31/app" + "github.com/CosmosContracts/juno/v31/cmd/junod/cmd" + "github.com/CosmosContracts/juno/v31/testutil/common" + "github.com/CosmosContracts/juno/v31/testutil/setup" ) type KeeperTestHelper struct { diff --git a/wasmbindings/message_plugin.go b/wasmbindings/message_plugin.go index a8c389786..8c4d0e5e4 100644 --- a/wasmbindings/message_plugin.go +++ b/wasmbindings/message_plugin.go @@ -15,9 +15,9 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/CosmosContracts/juno/v30/wasmbindings/types" - tokenfactorykeeper "github.com/CosmosContracts/juno/v30/x/tokenfactory/keeper" - tokenfactorytypes "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/wasmbindings/types" + tokenfactorykeeper "github.com/CosmosContracts/juno/v31/x/tokenfactory/keeper" + tokenfactorytypes "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) // CustomMessageDecorator returns decorator for custom CosmWasm bindings messages diff --git a/wasmbindings/queries.go b/wasmbindings/queries.go index bed87596d..d76c82923 100644 --- a/wasmbindings/queries.go +++ b/wasmbindings/queries.go @@ -7,9 +7,9 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - types "github.com/CosmosContracts/juno/v30/wasmbindings/types" - tokenfactorykeeper "github.com/CosmosContracts/juno/v30/x/tokenfactory/keeper" - votingsnapshotkeeper "github.com/CosmosContracts/juno/v30/x/voting-snapshot/keeper" + types "github.com/CosmosContracts/juno/v31/wasmbindings/types" + tokenfactorykeeper "github.com/CosmosContracts/juno/v31/x/tokenfactory/keeper" + votingsnapshotkeeper "github.com/CosmosContracts/juno/v31/x/voting-snapshot/keeper" ) type QueryPlugin struct { diff --git a/wasmbindings/query_plugin.go b/wasmbindings/query_plugin.go index 780c544b5..ff98c72c8 100644 --- a/wasmbindings/query_plugin.go +++ b/wasmbindings/query_plugin.go @@ -10,7 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - types "github.com/CosmosContracts/juno/v30/wasmbindings/types" + types "github.com/CosmosContracts/juno/v31/wasmbindings/types" ) // CustomQuerier dispatches custom CosmWasm bindings queries. diff --git a/wasmbindings/test/custom_msg_test.go b/wasmbindings/test/custom_msg_test.go index 811c7bd54..587bd11f9 100644 --- a/wasmbindings/test/custom_msg_test.go +++ b/wasmbindings/test/custom_msg_test.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - types "github.com/CosmosContracts/juno/v30/wasmbindings/types" - tftypes "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + types "github.com/CosmosContracts/juno/v31/wasmbindings/types" + tftypes "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) func (s *BindingsTestSuite) TestCreateDenomMsg() { diff --git a/wasmbindings/test/custom_query_test.go b/wasmbindings/test/custom_query_test.go index 8d11e6116..8cac333ac 100644 --- a/wasmbindings/test/custom_query_test.go +++ b/wasmbindings/test/custom_query_test.go @@ -3,7 +3,7 @@ package test import ( "fmt" - types "github.com/CosmosContracts/juno/v30/wasmbindings/types" + types "github.com/CosmosContracts/juno/v31/wasmbindings/types" ) func (s *BindingsTestSuite) TestQueryFullDenom() { diff --git a/wasmbindings/test/helpers_test.go b/wasmbindings/test/helpers_test.go index 1d519b50f..5877a0342 100644 --- a/wasmbindings/test/helpers_test.go +++ b/wasmbindings/test/helpers_test.go @@ -15,8 +15,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/testutil" - types "github.com/CosmosContracts/juno/v30/wasmbindings/types" + "github.com/CosmosContracts/juno/v31/testutil" + types "github.com/CosmosContracts/juno/v31/wasmbindings/types" ) type ReflectExec struct { diff --git a/wasmbindings/test/messages_test.go b/wasmbindings/test/messages_test.go index 2030659c3..cee67a672 100644 --- a/wasmbindings/test/messages_test.go +++ b/wasmbindings/test/messages_test.go @@ -7,9 +7,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/wasmbindings" - types "github.com/CosmosContracts/juno/v30/wasmbindings/types" - tftypes "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/wasmbindings" + types "github.com/CosmosContracts/juno/v31/wasmbindings/types" + tftypes "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) func (s *BindingsTestSuite) TestCreateDenom() { diff --git a/wasmbindings/test/queries_test.go b/wasmbindings/test/queries_test.go index 646b6792f..3c98deedb 100644 --- a/wasmbindings/test/queries_test.go +++ b/wasmbindings/test/queries_test.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/wasmbindings" + "github.com/CosmosContracts/juno/v31/wasmbindings" ) func (s *BindingsTestSuite) TestFullDenom() { diff --git a/wasmbindings/wasm.go b/wasmbindings/wasm.go index 48197c591..926bda059 100644 --- a/wasmbindings/wasm.go +++ b/wasmbindings/wasm.go @@ -5,8 +5,8 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - tokenfactorykeeper "github.com/CosmosContracts/juno/v30/x/tokenfactory/keeper" - votingsnapshotkeeper "github.com/CosmosContracts/juno/v30/x/voting-snapshot/keeper" + tokenfactorykeeper "github.com/CosmosContracts/juno/v31/x/tokenfactory/keeper" + votingsnapshotkeeper "github.com/CosmosContracts/juno/v31/x/voting-snapshot/keeper" ) func RegisterCustomPlugins( diff --git a/x/burn/burner.go b/x/burn/burner.go index a3e0d422a..bba41f311 100644 --- a/x/burn/burner.go +++ b/x/burn/burner.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - mintkeeper "github.com/CosmosContracts/juno/v30/x/mint/keeper" + mintkeeper "github.com/CosmosContracts/juno/v31/x/mint/keeper" ) // used to override Wasmd's NewBurnCoinMessageHandler diff --git a/x/clock/keeper/abci.go b/x/clock/keeper/abci.go index fd9c14e17..d412e1b95 100644 --- a/x/clock/keeper/abci.go +++ b/x/clock/keeper/abci.go @@ -8,8 +8,8 @@ import ( "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/app/utils" - "github.com/CosmosContracts/juno/v30/x/clock/types" + "github.com/CosmosContracts/juno/v31/app/utils" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) var endBlockSudoMessage = []byte(types.EndBlockSudoMessage) diff --git a/x/clock/keeper/abci_test.go b/x/clock/keeper/abci_test.go index e3605a9a2..80a464abc 100644 --- a/x/clock/keeper/abci_test.go +++ b/x/clock/keeper/abci_test.go @@ -13,7 +13,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/clock/types" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) // Register a contract. You must store the contract code before registering. diff --git a/x/clock/keeper/clock.go b/x/clock/keeper/clock.go index a9a78bd9c..1658b86f2 100644 --- a/x/clock/keeper/clock.go +++ b/x/clock/keeper/clock.go @@ -10,8 +10,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - globalerrors "github.com/CosmosContracts/juno/v30/app/utils" - "github.com/CosmosContracts/juno/v30/x/clock/types" + globalerrors "github.com/CosmosContracts/juno/v31/app/utils" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) // Store Keys for clock contracts (both jailed and unjailed) diff --git a/x/clock/keeper/genesis.go b/x/clock/keeper/genesis.go index 961bdc452..f7c6586be 100644 --- a/x/clock/keeper/genesis.go +++ b/x/clock/keeper/genesis.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/clock/types" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) // InitGenesis import module genesis diff --git a/x/clock/keeper/genesis_test.go b/x/clock/keeper/genesis_test.go index 7e4855843..175f614b0 100644 --- a/x/clock/keeper/genesis_test.go +++ b/x/clock/keeper/genesis_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "fmt" - "github.com/CosmosContracts/juno/v30/x/clock/types" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) func (s *KeeperTestSuite) TestClockInitGenesis() { diff --git a/x/clock/keeper/grpc_query.go b/x/clock/keeper/grpc_query.go index ef83d34dd..fb89bcb57 100644 --- a/x/clock/keeper/grpc_query.go +++ b/x/clock/keeper/grpc_query.go @@ -5,8 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - globalerrors "github.com/CosmosContracts/juno/v30/app/utils" - "github.com/CosmosContracts/juno/v30/x/clock/types" + globalerrors "github.com/CosmosContracts/juno/v31/app/utils" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) var _ types.QueryServer = queryServer{} diff --git a/x/clock/keeper/grpc_query_test.go b/x/clock/keeper/grpc_query_test.go index 561ebb90a..0b5e2c248 100644 --- a/x/clock/keeper/grpc_query_test.go +++ b/x/clock/keeper/grpc_query_test.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/clock/types" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) // Query Clock Params diff --git a/x/clock/keeper/keeper.go b/x/clock/keeper/keeper.go index 5089d02f3..06eadf7bd 100644 --- a/x/clock/keeper/keeper.go +++ b/x/clock/keeper/keeper.go @@ -12,7 +12,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/clock/types" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) // Keeper of the clock store diff --git a/x/clock/keeper/keeper_test.go b/x/clock/keeper/keeper_test.go index 0b689f05b..1a1f62819 100644 --- a/x/clock/keeper/keeper_test.go +++ b/x/clock/keeper/keeper_test.go @@ -7,9 +7,9 @@ import ( _ "embed" - "github.com/CosmosContracts/juno/v30/testutil" - "github.com/CosmosContracts/juno/v30/x/clock/keeper" - "github.com/CosmosContracts/juno/v30/x/clock/types" + "github.com/CosmosContracts/juno/v31/testutil" + "github.com/CosmosContracts/juno/v31/x/clock/keeper" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) type KeeperTestSuite struct { diff --git a/x/clock/keeper/msg_server.go b/x/clock/keeper/msg_server.go index 3287b727d..cb9d017fb 100644 --- a/x/clock/keeper/msg_server.go +++ b/x/clock/keeper/msg_server.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/x/clock/types" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) var _ types.MsgServer = &msgServer{} diff --git a/x/clock/keeper/msg_server_test.go b/x/clock/keeper/msg_server_test.go index 7de59af09..67af2bd23 100644 --- a/x/clock/keeper/msg_server_test.go +++ b/x/clock/keeper/msg_server_test.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/clock/types" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) // Test register clock contract. diff --git a/x/clock/module/autocli.go b/x/clock/module/autocli.go index f1ba7fec3..d802f9fe4 100644 --- a/x/clock/module/autocli.go +++ b/x/clock/module/autocli.go @@ -3,7 +3,7 @@ package module import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - clockv1 "github.com/CosmosContracts/juno/v30/api/juno/clock/v1" + clockv1 "github.com/CosmosContracts/juno/v31/api/juno/clock/v1" ) // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. diff --git a/x/clock/module/module.go b/x/clock/module/module.go index 299c9499b..5f2d2366e 100644 --- a/x/clock/module/module.go +++ b/x/clock/module/module.go @@ -15,8 +15,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/CosmosContracts/juno/v30/x/clock/keeper" - "github.com/CosmosContracts/juno/v30/x/clock/types" + "github.com/CosmosContracts/juno/v31/x/clock/keeper" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) const ( diff --git a/x/clock/types/genesis.pb.go b/x/clock/types/genesis.pb.go index aae266bbb..a1670e343 100644 --- a/x/clock/types/genesis.pb.go +++ b/x/clock/types/genesis.pb.go @@ -5,21 +5,18 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf -) +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -39,11 +36,9 @@ func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { return fileDescriptor_c31a7855fe794abe, []int{0} } - func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) @@ -56,15 +51,12 @@ 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 *GenesisState) XXX_Size() int { return m.Size() } - func (m *GenesisState) XXX_DiscardUnknown() { xxx_messageInfo_GenesisState.DiscardUnknown(m) } @@ -82,9 +74,9 @@ func (m *GenesisState) GetParams() Params { type Params struct { // contract_gas_limit defines the maximum amount of gas that can be used by a contract. ContractGasLimit uint64 `protobuf:"varint,1,opt,name=contract_gas_limit,json=contractGasLimit,proto3" json:"contract_gas_limit,omitempty"` - // max_contracts caps the number of clock contracts that may be registered. - // It bounds the per-block EndBlocker work and prevents an attacker from - // growing the registered-contract set into a block-time DoS. + // max_contracts caps the number of registered clock contracts, bounding + // per-block EndBlock sudo work so registration cannot be used to inflate + // block time. MaxContracts uint64 `protobuf:"varint,2,opt,name=max_contracts,json=maxContracts,proto3" json:"max_contracts,omitempty"` } @@ -94,11 +86,9 @@ func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { return fileDescriptor_c31a7855fe794abe, []int{1} } - func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Params.Marshal(b, m, deterministic) @@ -111,15 +101,12 @@ 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 *Params) XXX_Size() int { return m.Size() } - func (m *Params) XXX_DiscardUnknown() { xxx_messageInfo_Params.DiscardUnknown(m) } @@ -148,7 +135,7 @@ func init() { func init() { proto.RegisterFile("juno/clock/v1/genesis.proto", fileDescriptor_c31a7855fe794abe) } var fileDescriptor_c31a7855fe794abe = []byte{ - // 253 bytes of a gzipped FileDescriptorProto + // 273 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xce, 0x2a, 0xcd, 0xcb, 0xd7, 0x4f, 0xce, 0xc9, 0x4f, 0xce, 0xd6, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x05, 0x49, 0xea, 0x81, 0x25, 0xf5, 0xca, @@ -156,15 +143,17 @@ var fileDescriptor_c31a7855fe794abe = []byte{ 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x44, 0x95, 0x3c, 0xb8, 0x78, 0xdc, 0x21, 0x06, 0x05, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0x59, 0x70, 0xb1, 0x15, 0x24, 0x16, 0x25, 0xe6, 0x16, 0x4b, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x1b, 0x89, 0xea, 0xa1, 0x18, 0xac, 0x17, 0x00, 0x96, 0x74, 0xe2, - 0x3c, 0x71, 0x4f, 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, 0x41, 0x50, 0xf5, 0x4a, 0x36, 0x5c, + 0x3c, 0x71, 0x4f, 0x9e, 0x61, 0xc5, 0xf3, 0x0d, 0x5a, 0x8c, 0x41, 0x50, 0xf5, 0x4a, 0x89, 0x5c, 0x6c, 0x10, 0x49, 0x21, 0x1d, 0x2e, 0xa1, 0xe4, 0xfc, 0xbc, 0x92, 0xa2, 0xc4, 0xe4, 0x92, 0xf8, 0xf4, 0xc4, 0xe2, 0xf8, 0x9c, 0xcc, 0xdc, 0xcc, 0x12, 0xb0, 0x79, 0x2c, 0x41, 0x02, 0x30, 0x19, - 0xf7, 0xc4, 0x62, 0x1f, 0x90, 0xb8, 0x15, 0xcb, 0x8b, 0x05, 0xf2, 0x8c, 0x4e, 0xee, 0x27, 0x1e, - 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, - 0x1e, 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0x10, 0xa5, 0x9b, 0x9e, 0x59, 0x92, 0x51, 0x9a, 0xa4, - 0x97, 0x9c, 0x9f, 0xab, 0xef, 0x9c, 0x5f, 0x9c, 0x9b, 0x5f, 0xec, 0x0c, 0x35, 0xa2, 0x58, 0x1f, - 0x1c, 0x22, 0x15, 0xd0, 0x30, 0x29, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, 0x03, 0xfb, 0xcb, 0x18, - 0x10, 0x00, 0x00, 0xff, 0xff, 0xd6, 0xf0, 0x4e, 0x58, 0x2e, 0x01, 0x00, 0x00, + 0xf7, 0xc4, 0x62, 0x1f, 0x90, 0xb8, 0x90, 0x32, 0x17, 0x6f, 0x6e, 0x62, 0x45, 0x3c, 0x4c, 0xbc, + 0x58, 0x82, 0x09, 0xac, 0x90, 0x27, 0x37, 0xb1, 0xc2, 0x19, 0x26, 0x66, 0xc5, 0xf2, 0x62, 0x81, + 0x3c, 0xa3, 0x93, 0xfb, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, + 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0xe9, 0xa6, + 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, 0x3b, 0xe7, 0x17, 0xe7, 0xe6, 0x17, + 0xc3, 0xf5, 0xea, 0x83, 0x83, 0xad, 0x02, 0x1a, 0x70, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, + 0x60, 0xcf, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xd2, 0x59, 0xb1, 0xa1, 0x53, 0x01, 0x00, + 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -194,7 +183,6 @@ func (this *Params) Equal(that interface{}) bool { } return true } - func (m *GenesisState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -272,7 +260,6 @@ func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *GenesisState) Size() (n int) { if m == nil { return 0 @@ -302,11 +289,9 @@ func (m *Params) Size() (n int) { func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - func sozGenesis(x uint64) (n int) { return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (m *GenesisState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -390,7 +375,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } return nil } - func (m *Params) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -479,7 +463,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } - func skipGenesis(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/clock/types/msgs.go b/x/clock/types/msgs.go index 1ee24c384..70653f5f9 100644 --- a/x/clock/types/msgs.go +++ b/x/clock/types/msgs.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/app/utils" + "github.com/CosmosContracts/juno/v31/app/utils" ) const ( diff --git a/x/clock/types/params_test.go b/x/clock/types/params_test.go index 5827a802d..3d30a0d65 100644 --- a/x/clock/types/params_test.go +++ b/x/clock/types/params_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/CosmosContracts/juno/v30/x/clock/types" + "github.com/CosmosContracts/juno/v31/x/clock/types" ) func TestParamsValidate(t *testing.T) { diff --git a/x/clock/types/tx.pb.go b/x/clock/types/tx.pb.go index e9c28734e..88772dc32 100644 --- a/x/clock/types/tx.pb.go +++ b/x/clock/types/tx.pb.go @@ -12,7 +12,6 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -364,43 +363,42 @@ func init() { func init() { proto.RegisterFile("juno/clock/v1/tx.proto", fileDescriptor_76642a1e9a85f94b) } var fileDescriptor_76642a1e9a85f94b = []byte{ - // 574 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0xbf, 0x6f, 0xd3, 0x40, - 0x18, 0xf5, 0x51, 0x51, 0x29, 0x07, 0xa5, 0x60, 0xda, 0x26, 0x35, 0x95, 0x13, 0x19, 0x4a, 0x21, - 0x52, 0x7c, 0x4a, 0x91, 0x00, 0x75, 0x41, 0x24, 0x42, 0x9d, 0x22, 0xa1, 0x20, 0x18, 0x58, 0xaa, - 0xab, 0x73, 0xba, 0xba, 0x8d, 0xef, 0x8c, 0xef, 0x52, 0xda, 0x0d, 0x31, 0x21, 0x26, 0xfe, 0x84, - 0x8e, 0x8c, 0x19, 0x18, 0x61, 0xef, 0x58, 0x31, 0x31, 0x21, 0x94, 0x0c, 0x41, 0xe2, 0x9f, 0x40, - 0xb6, 0xcf, 0x69, 0x7e, 0xb9, 0xc9, 0xd8, 0x25, 0x8a, 0xbf, 0xf7, 0xbe, 0x77, 0xdf, 0x7b, 0xfa, - 0x7c, 0x86, 0x2b, 0xfb, 0x2d, 0xc6, 0x91, 0xd3, 0xe4, 0xce, 0x01, 0x3a, 0x2c, 0x23, 0x79, 0x64, - 0xfb, 0x01, 0x97, 0x5c, 0x5f, 0x08, 0xeb, 0x76, 0x54, 0xb7, 0x0f, 0xcb, 0xc6, 0x2d, 0xec, 0xb9, - 0x8c, 0xa3, 0xe8, 0x37, 0x66, 0x18, 0x59, 0x87, 0x0b, 0x8f, 0x0b, 0xe4, 0x09, 0x1a, 0x76, 0x7a, - 0x82, 0x2a, 0x60, 0x35, 0x06, 0x76, 0xa2, 0x27, 0x14, 0x3f, 0x28, 0x68, 0x89, 0x72, 0xca, 0xe3, - 0x7a, 0xf8, 0x4f, 0x55, 0xd7, 0x28, 0xe7, 0xb4, 0x49, 0x10, 0xf6, 0x5d, 0x84, 0x19, 0xe3, 0x12, - 0x4b, 0x97, 0xb3, 0xa4, 0xe7, 0xce, 0xf0, 0x84, 0x94, 0x30, 0x22, 0x5c, 0x05, 0x5a, 0x3d, 0x00, - 0x73, 0x35, 0x41, 0xeb, 0x84, 0xba, 0x42, 0x92, 0xa0, 0x1a, 0xb2, 0xaa, 0x9c, 0xc9, 0x00, 0x3b, - 0x52, 0x7f, 0x06, 0x6f, 0x08, 0xc2, 0x1a, 0x24, 0xd8, 0xc1, 0x8d, 0x46, 0x40, 0x84, 0xc8, 0x81, - 0x02, 0x78, 0x90, 0xa9, 0xe4, 0x7e, 0x7e, 0x2b, 0x2d, 0xa9, 0xb9, 0x9e, 0xc7, 0xc8, 0x2b, 0x19, - 0xb8, 0x8c, 0xd6, 0x17, 0x62, 0xbe, 0x2a, 0xea, 0x55, 0x78, 0xd3, 0x51, 0x62, 0x7d, 0x89, 0x2b, - 0x53, 0x24, 0x16, 0x93, 0x0e, 0x55, 0xde, 0x7a, 0xf1, 0xe9, 0x24, 0xaf, 0xfd, 0x3d, 0xc9, 0x6b, - 0x1f, 0x7b, 0xed, 0xe2, 0xc8, 0x40, 0x9f, 0x7b, 0xed, 0xe2, 0x7a, 0xe4, 0xef, 0x48, 0x39, 0x4c, - 0x33, 0x63, 0x59, 0xb0, 0x90, 0x86, 0xd5, 0x89, 0xf0, 0x39, 0x13, 0xc4, 0xfa, 0x07, 0xa0, 0x51, - 0x13, 0xf4, 0x35, 0x0b, 0x2e, 0x71, 0x1e, 0xdb, 0x53, 0xf2, 0xd8, 0x18, 0xcd, 0x23, 0xc5, 0x8e, - 0x75, 0x0f, 0x5a, 0xe9, 0x68, 0x3f, 0x93, 0x2e, 0x80, 0x2b, 0x11, 0x6d, 0x1f, 0xbb, 0xcd, 0xcb, - 0x98, 0x47, 0x75, 0x4a, 0x1e, 0x77, 0xc7, 0xf3, 0x18, 0xb3, 0x62, 0x15, 0xa0, 0x39, 0x19, 0xe9, - 0xe7, 0xf0, 0x1d, 0xc0, 0xc5, 0x90, 0xe2, 0x37, 0xb0, 0x24, 0x2f, 0x71, 0x80, 0x3d, 0xa1, 0x3f, - 0x86, 0x19, 0xdc, 0x92, 0x7b, 0x3c, 0x70, 0xe5, 0xf1, 0x54, 0xef, 0xe7, 0x54, 0xfd, 0x29, 0x9c, - 0xf7, 0x23, 0x85, 0xc8, 0xed, 0xb5, 0xcd, 0x65, 0x7b, 0xe8, 0xb6, 0xb0, 0x63, 0xf9, 0x4a, 0xe6, - 0xf4, 0x77, 0x5e, 0xfb, 0xda, 0x6b, 0x17, 0x41, 0x5d, 0xf1, 0xb7, 0x9e, 0x0c, 0x9a, 0x3d, 0x57, - 0x0c, 0x7d, 0xae, 0x8d, 0xf9, 0x1c, 0x18, 0xd5, 0x5a, 0x85, 0xd9, 0x91, 0x52, 0xe2, 0x6c, 0xf3, - 0xc7, 0x1c, 0x9c, 0xab, 0x09, 0xaa, 0xbf, 0x83, 0xcb, 0x93, 0xef, 0x81, 0x8d, 0x91, 0xf1, 0xd2, - 0xde, 0x23, 0x03, 0xcd, 0x48, 0x4c, 0x8e, 0xd6, 0xdf, 0xc3, 0x6c, 0xda, 0xcb, 0xf6, 0x70, 0x5c, - 0x2b, 0x85, 0x6a, 0x94, 0x67, 0xa6, 0xf6, 0x0f, 0x3e, 0x80, 0xb7, 0x27, 0x6d, 0xf4, 0xfa, 0x24, - 0xa5, 0x31, 0x9a, 0x51, 0x9a, 0x89, 0xd6, 0x3f, 0xec, 0x0d, 0xbc, 0x3e, 0xb4, 0x36, 0xe6, 0x84, - 0xf6, 0x01, 0xdc, 0xb8, 0x7f, 0x31, 0x9e, 0xe8, 0x1a, 0x57, 0x3f, 0x84, 0xbb, 0x51, 0xd9, 0x3e, - 0xed, 0x98, 0xe0, 0xac, 0x63, 0x82, 0x3f, 0x1d, 0x13, 0x7c, 0xe9, 0x9a, 0xda, 0x59, 0xd7, 0xd4, - 0x7e, 0x75, 0x4d, 0xed, 0x6d, 0x89, 0xba, 0x72, 0xaf, 0xb5, 0x6b, 0x3b, 0xdc, 0x43, 0xd5, 0x68, - 0x27, 0x93, 0xd9, 0x04, 0x1a, 0xda, 0x16, 0x79, 0xec, 0x13, 0xb1, 0x3b, 0x1f, 0x7d, 0x13, 0x1e, - 0xfd, 0x0f, 0x00, 0x00, 0xff, 0xff, 0x1c, 0xc2, 0x55, 0x2d, 0xd4, 0x06, 0x00, 0x00, + // 557 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x55, 0x31, 0x6f, 0xd3, 0x40, + 0x14, 0xf6, 0x51, 0x51, 0x29, 0x0f, 0x4a, 0xc1, 0xb4, 0x4d, 0x6a, 0x90, 0x13, 0x19, 0x4a, 0x21, + 0x52, 0x6c, 0xa5, 0x48, 0x80, 0xba, 0x20, 0x12, 0xa1, 0x4e, 0x91, 0x50, 0x10, 0x0c, 0x2c, 0x95, + 0xeb, 0x9c, 0xae, 0x6e, 0x6b, 0x9f, 0xf1, 0x5d, 0x4a, 0xbb, 0x21, 0x26, 0xc4, 0xc4, 0x4f, 0xe8, + 0xc8, 0x98, 0x81, 0x11, 0xf6, 0x8e, 0x15, 0x13, 0x13, 0x42, 0xc9, 0x10, 0x24, 0xfe, 0x04, 0xb2, + 0x7d, 0x76, 0x93, 0xd8, 0x26, 0x19, 0xbb, 0x44, 0xf1, 0xfb, 0xbe, 0xfb, 0xde, 0xfb, 0x3e, 0x3d, + 0x9f, 0x61, 0x65, 0xaf, 0xeb, 0x52, 0xc3, 0x3a, 0xa0, 0xd6, 0xbe, 0x71, 0x58, 0x37, 0xf8, 0x91, + 0xee, 0xf9, 0x94, 0x53, 0x79, 0x21, 0xa8, 0xeb, 0x61, 0x5d, 0x3f, 0xac, 0x2b, 0x37, 0x4c, 0xc7, + 0x76, 0xa9, 0x11, 0xfe, 0x46, 0x0c, 0xa5, 0x68, 0x51, 0xe6, 0x50, 0x66, 0x38, 0x8c, 0x04, 0x27, + 0x1d, 0x46, 0x04, 0xb0, 0x1a, 0x01, 0xdb, 0xe1, 0x93, 0x11, 0x3d, 0x08, 0x68, 0x89, 0x50, 0x42, + 0xa3, 0x7a, 0xf0, 0x4f, 0x54, 0x6f, 0x8d, 0xcf, 0x40, 0xb0, 0x8b, 0x99, 0x2d, 0x8e, 0x68, 0x43, + 0x04, 0xa5, 0x16, 0x23, 0x6d, 0x4c, 0x6c, 0xc6, 0xb1, 0xdf, 0x0c, 0x58, 0x4d, 0xea, 0x72, 0xdf, + 0xb4, 0xb8, 0xfc, 0x14, 0xae, 0x31, 0xec, 0x76, 0xb0, 0xbf, 0x6d, 0x76, 0x3a, 0x3e, 0x66, 0xac, + 0x84, 0x2a, 0xe8, 0x7e, 0xa1, 0x51, 0xfa, 0xf1, 0xb5, 0xb6, 0x24, 0x3a, 0x3f, 0x8b, 0x90, 0x97, + 0xdc, 0xb7, 0x5d, 0xd2, 0x5e, 0x88, 0xf8, 0xa2, 0x28, 0x37, 0xe1, 0xba, 0x25, 0xc4, 0x12, 0x89, + 0x4b, 0x53, 0x24, 0x16, 0xe3, 0x13, 0xa2, 0xbc, 0xf9, 0xfc, 0xe3, 0x49, 0x59, 0xfa, 0x73, 0x52, + 0x96, 0x3e, 0x0c, 0x7b, 0xd5, 0x89, 0x81, 0x3e, 0x0d, 0x7b, 0xd5, 0xb5, 0xd0, 0xdf, 0x91, 0x70, + 0x98, 0x67, 0x46, 0xd3, 0xa0, 0x92, 0x87, 0xb5, 0x31, 0xf3, 0xa8, 0xcb, 0xb0, 0xf6, 0x17, 0x81, + 0xd2, 0x62, 0xe4, 0x95, 0xeb, 0x5f, 0xe0, 0x3c, 0xb6, 0xa6, 0xe4, 0xb1, 0x3e, 0x99, 0x47, 0x8e, + 0x1d, 0xed, 0x2e, 0x68, 0xf9, 0x68, 0x92, 0xc9, 0x00, 0xc1, 0x4a, 0x48, 0xdb, 0x33, 0xed, 0x83, + 0x8b, 0x98, 0x47, 0x73, 0x4a, 0x1e, 0x77, 0xd2, 0x79, 0xa4, 0xac, 0x68, 0x15, 0x50, 0xb3, 0x91, + 0x24, 0x87, 0x6f, 0x08, 0x16, 0x03, 0x8a, 0xd7, 0x31, 0x39, 0x7e, 0x61, 0xfa, 0xa6, 0xc3, 0xe4, + 0x47, 0x50, 0x30, 0xbb, 0x7c, 0x97, 0xfa, 0x36, 0x3f, 0x9e, 0xea, 0xfd, 0x9c, 0x2a, 0x3f, 0x81, + 0x79, 0x2f, 0x54, 0x08, 0xdd, 0x5e, 0xd9, 0x58, 0xd6, 0xc7, 0xee, 0x03, 0x3d, 0x92, 0x6f, 0x14, + 0x4e, 0x7f, 0x95, 0xa5, 0x2f, 0xc3, 0x5e, 0x15, 0xb5, 0x05, 0x7f, 0xf3, 0xf1, 0xa8, 0xd9, 0x73, + 0xc5, 0xc0, 0xe7, 0xed, 0x94, 0xcf, 0x91, 0x51, 0xb5, 0x55, 0x28, 0x4e, 0x94, 0x62, 0x67, 0x1b, + 0xdf, 0xe7, 0x60, 0xae, 0xc5, 0x88, 0xfc, 0x16, 0x96, 0xb3, 0xef, 0x81, 0xf5, 0x89, 0xf1, 0xf2, + 0xde, 0x23, 0xc5, 0x98, 0x91, 0x18, 0xb7, 0x96, 0xdf, 0x41, 0x31, 0xef, 0x65, 0x7b, 0x90, 0xd6, + 0xca, 0xa1, 0x2a, 0xf5, 0x99, 0xa9, 0x49, 0xe3, 0x7d, 0xb8, 0x99, 0xb5, 0xd1, 0x6b, 0x59, 0x4a, + 0x29, 0x9a, 0x52, 0x9b, 0x89, 0x96, 0x34, 0x7b, 0x0d, 0x57, 0xc7, 0xd6, 0x46, 0xcd, 0x38, 0x3e, + 0x82, 0x2b, 0xf7, 0xfe, 0x8f, 0xc7, 0xba, 0xca, 0xe5, 0xf7, 0xc1, 0x6e, 0x34, 0xb6, 0x4e, 0xfb, + 0x2a, 0x3a, 0xeb, 0xab, 0xe8, 0x77, 0x5f, 0x45, 0x9f, 0x07, 0xaa, 0x74, 0x36, 0x50, 0xa5, 0x9f, + 0x03, 0x55, 0x7a, 0x53, 0x23, 0x36, 0xdf, 0xed, 0xee, 0xe8, 0x16, 0x75, 0x8c, 0x66, 0xb8, 0x93, + 0xf1, 0x6c, 0xcc, 0x18, 0xdb, 0x16, 0x7e, 0xec, 0x61, 0xb6, 0x33, 0x1f, 0x7e, 0x13, 0x1e, 0xfe, + 0x0b, 0x00, 0x00, 0xff, 0xff, 0x27, 0xe2, 0x6c, 0xab, 0xb6, 0x06, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/cw-hooks/keeper/contracts.go b/x/cw-hooks/keeper/contracts.go index 4dc658005..8254d679d 100644 --- a/x/cw-hooks/keeper/contracts.go +++ b/x/cw-hooks/keeper/contracts.go @@ -8,8 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/app/utils" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/app/utils" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) func (k Keeper) SetContract(ctx context.Context, key collections.Prefix, info types.ContractInfo) error { diff --git a/x/cw-hooks/keeper/genesis.go b/x/cw-hooks/keeper/genesis.go index 913b8b952..1fdc09027 100644 --- a/x/cw-hooks/keeper/genesis.go +++ b/x/cw-hooks/keeper/genesis.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) // InitGenesis import module genesis diff --git a/x/cw-hooks/keeper/gov_hooks.go b/x/cw-hooks/keeper/gov_hooks.go index 5f8c4e8d4..401524b30 100644 --- a/x/cw-hooks/keeper/gov_hooks.go +++ b/x/cw-hooks/keeper/gov_hooks.go @@ -11,7 +11,7 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) type GovHooks struct { diff --git a/x/cw-hooks/keeper/grpc_query.go b/x/cw-hooks/keeper/grpc_query.go index 1106004d4..a0fc02d5f 100644 --- a/x/cw-hooks/keeper/grpc_query.go +++ b/x/cw-hooks/keeper/grpc_query.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) var _ types.QueryServer = queryServer{} diff --git a/x/cw-hooks/keeper/grpc_query_test.go b/x/cw-hooks/keeper/grpc_query_test.go index 849167438..c1f1aeb47 100644 --- a/x/cw-hooks/keeper/grpc_query_test.go +++ b/x/cw-hooks/keeper/grpc_query_test.go @@ -6,7 +6,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) func (s *KeeperTestSuite) TestContracts() { diff --git a/x/cw-hooks/keeper/hooks_test.go b/x/cw-hooks/keeper/hooks_test.go index 047828700..836fc3873 100644 --- a/x/cw-hooks/keeper/hooks_test.go +++ b/x/cw-hooks/keeper/hooks_test.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) func (s *KeeperTestSuite) firstValidatorAddr() sdk.ValAddress { diff --git a/x/cw-hooks/keeper/keeper.go b/x/cw-hooks/keeper/keeper.go index 865989e71..c37ac002d 100644 --- a/x/cw-hooks/keeper/keeper.go +++ b/x/cw-hooks/keeper/keeper.go @@ -16,7 +16,7 @@ import ( govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) type contractIndexes struct { diff --git a/x/cw-hooks/keeper/keeper_test.go b/x/cw-hooks/keeper/keeper_test.go index eea2fd905..6ac3c750a 100644 --- a/x/cw-hooks/keeper/keeper_test.go +++ b/x/cw-hooks/keeper/keeper_test.go @@ -16,9 +16,9 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/CosmosContracts/juno/v30/testutil" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/keeper" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/testutil" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/keeper" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) var _ = embed.FS{} diff --git a/x/cw-hooks/keeper/msg_server.go b/x/cw-hooks/keeper/msg_server.go index f3571dab3..06fb73a84 100644 --- a/x/cw-hooks/keeper/msg_server.go +++ b/x/cw-hooks/keeper/msg_server.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) var _ types.MsgServer = &msgServer{} diff --git a/x/cw-hooks/keeper/msg_server_test.go b/x/cw-hooks/keeper/msg_server_test.go index 436d7c475..79c0e1cdf 100644 --- a/x/cw-hooks/keeper/msg_server_test.go +++ b/x/cw-hooks/keeper/msg_server_test.go @@ -4,7 +4,7 @@ package keeper_test import ( _ "embed" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) const invalidAddr = "Invalid" diff --git a/x/cw-hooks/keeper/params.go b/x/cw-hooks/keeper/params.go index da8f2c51a..ceded1df0 100644 --- a/x/cw-hooks/keeper/params.go +++ b/x/cw-hooks/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) // SetParams sets the x/cw-hooks module parameters. diff --git a/x/cw-hooks/keeper/staking_hooks.go b/x/cw-hooks/keeper/staking_hooks.go index ec3c2f3a0..5d1c615ce 100644 --- a/x/cw-hooks/keeper/staking_hooks.go +++ b/x/cw-hooks/keeper/staking_hooks.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) // skipUntilHeight allows us to skip gentxs. diff --git a/x/cw-hooks/migrations/migrations.go b/x/cw-hooks/migrations/migrations.go index e672778ae..e78e6850e 100644 --- a/x/cw-hooks/migrations/migrations.go +++ b/x/cw-hooks/migrations/migrations.go @@ -3,8 +3,8 @@ package migrations import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/keeper" - v2 "github.com/CosmosContracts/juno/v30/x/cw-hooks/migrations/v2" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/keeper" + v2 "github.com/CosmosContracts/juno/v31/x/cw-hooks/migrations/v2" ) // Migrator is a struct for handling in-place store migrations. diff --git a/x/cw-hooks/migrations/v2/store.go b/x/cw-hooks/migrations/v2/store.go index 2af0a9c00..0155721d2 100644 --- a/x/cw-hooks/migrations/v2/store.go +++ b/x/cw-hooks/migrations/v2/store.go @@ -10,8 +10,8 @@ import ( "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/keeper" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/keeper" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) var ( diff --git a/x/cw-hooks/migrations/v2/store_test.go b/x/cw-hooks/migrations/v2/store_test.go index 6a7a7cd63..2815ba640 100644 --- a/x/cw-hooks/migrations/v2/store_test.go +++ b/x/cw-hooks/migrations/v2/store_test.go @@ -13,9 +13,9 @@ import ( "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/testutil/setup" - v2 "github.com/CosmosContracts/juno/v30/x/cw-hooks/migrations/v2" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/testutil/setup" + v2 "github.com/CosmosContracts/juno/v31/x/cw-hooks/migrations/v2" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) func TestMigrateStoreToCollections(t *testing.T) { diff --git a/x/cw-hooks/module/autocli.go b/x/cw-hooks/module/autocli.go index 23bd0cfad..696445f1c 100644 --- a/x/cw-hooks/module/autocli.go +++ b/x/cw-hooks/module/autocli.go @@ -3,7 +3,7 @@ package module import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - "github.com/CosmosContracts/juno/v30/api/juno/cwhooks/v2" + "github.com/CosmosContracts/juno/v31/api/juno/cwhooks/v2" ) // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. diff --git a/x/cw-hooks/module/module.go b/x/cw-hooks/module/module.go index dc5d32869..df033af7e 100644 --- a/x/cw-hooks/module/module.go +++ b/x/cw-hooks/module/module.go @@ -15,9 +15,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/keeper" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/migrations" - "github.com/CosmosContracts/juno/v30/x/cw-hooks/types" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/keeper" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/migrations" + "github.com/CosmosContracts/juno/v31/x/cw-hooks/types" ) const ( diff --git a/x/cw-hooks/types/genesis.pb.go b/x/cw-hooks/types/genesis.pb.go index fec067293..cd29640f1 100644 --- a/x/cw-hooks/types/genesis.pb.go +++ b/x/cw-hooks/types/genesis.pb.go @@ -5,21 +5,18 @@ package types import ( fmt "fmt" - io "io" - math "math" - math_bits "math/bits" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" _ "github.com/cosmos/gogoproto/gogoproto" proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" ) // Reference imports to suppress errors if they are not otherwise used. -var ( - _ = proto.Marshal - _ = fmt.Errorf - _ = math.Inf -) +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -43,11 +40,9 @@ func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { return fileDescriptor_fc173233c90f2f38, []int{0} } - func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) @@ -60,15 +55,12 @@ 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 *GenesisState) XXX_Size() int { return m.Size() } - func (m *GenesisState) XXX_DiscardUnknown() { xxx_messageInfo_GenesisState.DiscardUnknown(m) } @@ -102,10 +94,9 @@ type Params struct { ContractGasLimit uint64 `protobuf:"varint,1,opt,name=contract_gas_limit,json=contractGasLimit,proto3" json:"contract_gas_limit,omitempty"` // contract_failure_removal_threshold is the threshold for removing a contract after consecutive failures ContractFailureRemovalThreshold uint64 `protobuf:"varint,2,opt,name=contract_failure_removal_threshold,json=contractFailureRemovalThreshold,proto3" json:"contract_failure_removal_threshold,omitempty"` - // max_contracts caps the number of contracts that may be registered per hook - // module (staking/gov). Each registered contract is sudo-executed on every - // matching hook under a child gas meter not charged to the block meter, so - // an unbounded set is a block-time DoS vector. + // max_contracts caps the number of registered contracts per hook module, + // bounding per-hook sudo work so registration cannot be used to inflate + // block time. MaxContracts uint64 `protobuf:"varint,3,opt,name=max_contracts,json=maxContracts,proto3" json:"max_contracts,omitempty"` } @@ -115,11 +106,9 @@ func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { return fileDescriptor_fc173233c90f2f38, []int{1} } - func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } - func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { return xxx_messageInfo_Params.Marshal(b, m, deterministic) @@ -132,15 +121,12 @@ 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 *Params) XXX_Size() int { return m.Size() } - func (m *Params) XXX_DiscardUnknown() { xxx_messageInfo_Params.DiscardUnknown(m) } @@ -176,32 +162,32 @@ func init() { func init() { proto.RegisterFile("juno/cwhooks/v2/genesis.proto", fileDescriptor_fc173233c90f2f38) } var fileDescriptor_fc173233c90f2f38 = []byte{ - // 385 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcd, 0x2a, 0xcd, 0xcb, - 0xd7, 0x4f, 0x2e, 0xcf, 0xc8, 0xcf, 0xcf, 0x2e, 0xd6, 0x2f, 0x33, 0xd2, 0x4f, 0x4f, 0xcd, 0x4b, - 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x07, 0x49, 0xeb, 0x41, 0xa5, - 0xf5, 0xca, 0x8c, 0xa4, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x8d, 0x94, - 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0xe5, 0xd0, 0x0d, 0x4e, 0xce, - 0xcf, 0x2b, 0x29, 0x4a, 0x4c, 0x2e, 0x81, 0xc8, 0x2b, 0x4d, 0x62, 0xe2, 0xe2, 0x71, 0x87, 0xd8, - 0x15, 0x5c, 0x92, 0x58, 0x92, 0x2a, 0x64, 0xc5, 0xc5, 0x56, 0x90, 0x58, 0x94, 0x98, 0x5b, 0x2c, - 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0x6d, 0x24, 0xae, 0x87, 0x66, 0xb7, 0x5e, 0x00, 0x58, 0xda, 0x89, - 0xf3, 0xc4, 0x3d, 0x79, 0x86, 0x15, 0xcf, 0x37, 0x68, 0x31, 0x06, 0x41, 0x75, 0x08, 0xa5, 0x71, - 0x49, 0x15, 0x97, 0x24, 0x66, 0x67, 0xe6, 0xa5, 0xc7, 0xc3, 0xac, 0x89, 0x4f, 0x4c, 0x49, 0x29, - 0x4a, 0x2d, 0x2e, 0x4e, 0x2d, 0x96, 0x60, 0x52, 0x60, 0xd6, 0xe0, 0x36, 0x92, 0xc5, 0x30, 0xcf, - 0x19, 0xaa, 0xd4, 0x33, 0x2f, 0x2d, 0x1f, 0xd9, 0x54, 0x09, 0xa8, 0x59, 0x30, 0x79, 0x47, 0x98, - 0x49, 0x42, 0x71, 0x5c, 0x62, 0xe9, 0xf9, 0x65, 0xd8, 0xec, 0x60, 0x26, 0xd1, 0x0e, 0x91, 0xf4, - 0xfc, 0x32, 0x0c, 0xf3, 0x95, 0x3a, 0x19, 0xb9, 0xd8, 0x20, 0xbe, 0x14, 0xd2, 0xe1, 0x12, 0x82, - 0x5b, 0x93, 0x9e, 0x58, 0x1c, 0x9f, 0x93, 0x99, 0x9b, 0x59, 0x02, 0x0e, 0x1a, 0x96, 0x20, 0x01, - 0x98, 0x8c, 0x7b, 0x62, 0xb1, 0x0f, 0x48, 0x5c, 0xc8, 0x9b, 0x4b, 0x09, 0xae, 0x3a, 0x2d, 0x31, - 0x33, 0xa7, 0xb4, 0x28, 0x35, 0xbe, 0x28, 0x35, 0x37, 0xbf, 0x2c, 0x31, 0x27, 0xbe, 0x24, 0xa3, - 0x28, 0xb5, 0x38, 0x23, 0x3f, 0x27, 0x45, 0x82, 0x09, 0xac, 0x5b, 0x1e, 0xa6, 0xd2, 0x0d, 0xa2, - 0x30, 0x08, 0xa2, 0x2e, 0x04, 0xa6, 0xcc, 0x8a, 0xe5, 0xc5, 0x02, 0x79, 0x46, 0x27, 0xaf, 0x13, - 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, - 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32, 0x48, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, - 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x77, 0xce, 0x2f, 0xce, 0xcd, 0x2f, 0x86, 0xf9, 0xa4, 0x58, 0x1f, - 0x1c, 0xeb, 0x15, 0xfa, 0xc9, 0xe5, 0xba, 0x90, 0x88, 0x2f, 0xa9, 0x2c, 0x48, 0x2d, 0x4e, 0x62, - 0x03, 0xc7, 0xb9, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x86, 0xd0, 0x99, 0xc1, 0x6e, 0x02, 0x00, - 0x00, + // 400 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcd, 0xee, 0xd2, 0x40, + 0x14, 0xc5, 0x3b, 0xfc, 0x09, 0x89, 0x03, 0x46, 0x9d, 0x10, 0x6d, 0x48, 0x28, 0x04, 0x37, 0xc4, + 0x68, 0xc7, 0xd4, 0x1d, 0x3b, 0x21, 0x91, 0xf8, 0xb1, 0x30, 0xe8, 0xca, 0x85, 0xcd, 0x50, 0x86, + 0x69, 0xa5, 0xd3, 0x4b, 0x3a, 0x43, 0xc1, 0xb7, 0x30, 0x3e, 0x81, 0x4b, 0x57, 0xc6, 0xc7, 0x60, + 0xc9, 0xd2, 0x95, 0x31, 0xb0, 0xd0, 0xc7, 0x30, 0xfd, 0x8c, 0x01, 0x37, 0xff, 0x4d, 0x33, 0x99, + 0xf3, 0x3b, 0xe7, 0xf4, 0x4e, 0x2e, 0xee, 0x7e, 0xd8, 0x44, 0x40, 0xbd, 0xad, 0x0f, 0xb0, 0x52, + 0x34, 0x71, 0xa8, 0xe0, 0x11, 0x57, 0x81, 0xb2, 0xd7, 0x31, 0x68, 0x20, 0xb7, 0x52, 0xd9, 0x2e, + 0x64, 0x3b, 0x71, 0x3a, 0x77, 0x98, 0x0c, 0x22, 0xa0, 0xd9, 0x37, 0x67, 0x3a, 0x6d, 0x01, 0x02, + 0xb2, 0x23, 0x4d, 0x4f, 0xc5, 0xad, 0x75, 0x1e, 0xec, 0x41, 0xa4, 0x63, 0xe6, 0xe9, 0x5c, 0x1f, + 0x7c, 0xae, 0xe1, 0xd6, 0x34, 0xef, 0x7a, 0xa3, 0x99, 0xe6, 0x64, 0x84, 0x1b, 0x6b, 0x16, 0x33, + 0xa9, 0x4c, 0xd4, 0x47, 0xc3, 0xa6, 0x73, 0xcf, 0x3e, 0xeb, 0xb6, 0x5f, 0x67, 0xf2, 0xf8, 0xc6, + 0xfe, 0x67, 0xcf, 0xf8, 0xfa, 0xfb, 0xfb, 0x03, 0x34, 0x2b, 0x1c, 0x64, 0x89, 0x3b, 0x4a, 0xb3, + 0x55, 0x10, 0x09, 0xb7, 0xac, 0x71, 0xd9, 0x62, 0x11, 0x73, 0xa5, 0xb8, 0x32, 0x6b, 0xfd, 0xab, + 0x61, 0xd3, 0xe9, 0x5e, 0xe4, 0x4d, 0x0a, 0xf4, 0x79, 0xb4, 0x84, 0x7f, 0x53, 0xcd, 0x22, 0xab, + 0xd4, 0x9f, 0x96, 0x49, 0xe4, 0x3d, 0xbe, 0x2b, 0x20, 0xf9, 0x5f, 0xc7, 0xd5, 0x35, 0x3b, 0xda, + 0x02, 0x92, 0x8b, 0xfc, 0xc1, 0x37, 0x84, 0x1b, 0xf9, 0x94, 0xe4, 0x21, 0x26, 0x55, 0x8d, 0x60, + 0xca, 0x0d, 0x03, 0x19, 0xe8, 0xec, 0x69, 0xea, 0xb3, 0xdb, 0xa5, 0x32, 0x65, 0xea, 0x55, 0x7a, + 0x4f, 0x5e, 0xe2, 0x41, 0x45, 0x2f, 0x59, 0x10, 0x6e, 0x62, 0xee, 0xc6, 0x5c, 0x42, 0xc2, 0x42, + 0x57, 0xfb, 0x31, 0x57, 0x3e, 0x84, 0x0b, 0xb3, 0x96, 0xb9, 0x7b, 0x25, 0xf9, 0x2c, 0x07, 0x67, + 0x39, 0xf7, 0xb6, 0xc4, 0xc8, 0x7d, 0x7c, 0x53, 0xb2, 0x5d, 0x35, 0x65, 0x3a, 0x5c, 0xea, 0x6b, + 0x49, 0xb6, 0x2b, 0x7f, 0x59, 0x8d, 0xea, 0x7f, 0xbe, 0xf4, 0xd0, 0xf8, 0xc5, 0xfe, 0x68, 0xa1, + 0xc3, 0xd1, 0x42, 0xbf, 0x8e, 0x16, 0xfa, 0x74, 0xb2, 0x8c, 0xc3, 0xc9, 0x32, 0x7e, 0x9c, 0x2c, + 0xe3, 0xdd, 0x63, 0x11, 0x68, 0x7f, 0x33, 0xb7, 0x3d, 0x90, 0x74, 0x02, 0x4a, 0x82, 0xaa, 0xbc, + 0x34, 0x5b, 0x8d, 0x1d, 0xf5, 0xb6, 0x8f, 0xf2, 0xed, 0xd0, 0x1f, 0xd7, 0x5c, 0xcd, 0x1b, 0xd9, + 0x62, 0x3c, 0xf9, 0x1b, 0x00, 0x00, 0xff, 0xff, 0xf0, 0x85, 0x70, 0xa0, 0x93, 0x02, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -234,7 +220,6 @@ func (this *Params) Equal(that interface{}) bool { } return true } - func (m *GenesisState) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -345,7 +330,6 @@ func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } - func (m *GenesisState) Size() (n int) { if m == nil { return 0 @@ -390,11 +374,9 @@ func (m *Params) Size() (n int) { func sovGenesis(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } - func sozGenesis(x uint64) (n int) { return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } - func (m *GenesisState) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -546,7 +528,6 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } return nil } - func (m *Params) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -654,7 +635,6 @@ func (m *Params) Unmarshal(dAtA []byte) error { } return nil } - func skipGenesis(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/drip/keeper/genesis.go b/x/drip/keeper/genesis.go index 4620c127c..34073e576 100644 --- a/x/drip/keeper/genesis.go +++ b/x/drip/keeper/genesis.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/drip/types" + "github.com/CosmosContracts/juno/v31/x/drip/types" ) // InitGenesis import module genesis diff --git a/x/drip/keeper/genesis_test.go b/x/drip/keeper/genesis_test.go index a1d4e8aed..7040d6774 100644 --- a/x/drip/keeper/genesis_test.go +++ b/x/drip/keeper/genesis_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "fmt" - "github.com/CosmosContracts/juno/v30/x/drip/types" + "github.com/CosmosContracts/juno/v31/x/drip/types" ) func (s *KeeperTestSuite) TestDripInitGenesis() { diff --git a/x/drip/keeper/grpc_query.go b/x/drip/keeper/grpc_query.go index 6bf5195d1..6e4789162 100644 --- a/x/drip/keeper/grpc_query.go +++ b/x/drip/keeper/grpc_query.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/CosmosContracts/juno/v30/x/drip/types" + "github.com/CosmosContracts/juno/v31/x/drip/types" ) var _ types.QueryServer = queryServer{} diff --git a/x/drip/keeper/grpc_query_test.go b/x/drip/keeper/grpc_query_test.go index 9155c12ef..cc2826327 100644 --- a/x/drip/keeper/grpc_query_test.go +++ b/x/drip/keeper/grpc_query_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" - "github.com/CosmosContracts/juno/v30/x/drip/types" + "github.com/CosmosContracts/juno/v31/x/drip/types" ) func (s *KeeperTestSuite) TestDripQueryParams() { diff --git a/x/drip/keeper/keeper_test.go b/x/drip/keeper/keeper_test.go index 102ca7827..f37bb54e8 100644 --- a/x/drip/keeper/keeper_test.go +++ b/x/drip/keeper/keeper_test.go @@ -7,9 +7,9 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - "github.com/CosmosContracts/juno/v30/testutil" - "github.com/CosmosContracts/juno/v30/x/drip/keeper" - "github.com/CosmosContracts/juno/v30/x/drip/types" + "github.com/CosmosContracts/juno/v31/testutil" + "github.com/CosmosContracts/juno/v31/x/drip/keeper" + "github.com/CosmosContracts/juno/v31/x/drip/types" ) type KeeperTestSuite struct { diff --git a/x/drip/keeper/msg_server.go b/x/drip/keeper/msg_server.go index 9d52fb0c8..f9622139c 100644 --- a/x/drip/keeper/msg_server.go +++ b/x/drip/keeper/msg_server.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/x/drip/types" + "github.com/CosmosContracts/juno/v31/x/drip/types" ) var _ types.MsgServer = msgServer{} diff --git a/x/drip/keeper/msg_server_test.go b/x/drip/keeper/msg_server_test.go index 32f37f1a7..4cd6748e5 100644 --- a/x/drip/keeper/msg_server_test.go +++ b/x/drip/keeper/msg_server_test.go @@ -8,7 +8,7 @@ import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/drip/types" + "github.com/CosmosContracts/juno/v31/x/drip/types" ) func (s *KeeperTestSuite) TestDripDistributeTokensMsgs() { diff --git a/x/drip/keeper/params.go b/x/drip/keeper/params.go index 8cbb73c69..fcf73b505 100644 --- a/x/drip/keeper/params.go +++ b/x/drip/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/CosmosContracts/juno/v30/x/drip/types" + "github.com/CosmosContracts/juno/v31/x/drip/types" ) // SetParams sets the x/drip module parameters. diff --git a/x/drip/module/autocli.go b/x/drip/module/autocli.go index 1516c4439..b3810738d 100644 --- a/x/drip/module/autocli.go +++ b/x/drip/module/autocli.go @@ -3,7 +3,7 @@ package module import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - dripv1 "github.com/CosmosContracts/juno/v30/api/juno/drip/v1" + dripv1 "github.com/CosmosContracts/juno/v31/api/juno/drip/v1" ) // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. diff --git a/x/drip/module/module.go b/x/drip/module/module.go index e68b292f5..6e30d0147 100644 --- a/x/drip/module/module.go +++ b/x/drip/module/module.go @@ -17,8 +17,8 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - "github.com/CosmosContracts/juno/v30/x/drip/keeper" - "github.com/CosmosContracts/juno/v30/x/drip/types" + "github.com/CosmosContracts/juno/v31/x/drip/keeper" + "github.com/CosmosContracts/juno/v31/x/drip/types" ) // type check to ensure the interface is properly implemented diff --git a/x/drip/types/tx.pb.go b/x/drip/types/tx.pb.go index 597d94fe1..b4cead234 100644 --- a/x/drip/types/tx.pb.go +++ b/x/drip/types/tx.pb.go @@ -14,7 +14,6 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -217,42 +216,41 @@ func init() { func init() { proto.RegisterFile("juno/drip/v1/tx.proto", fileDescriptor_73c0f1d75f17f4bc) } var fileDescriptor_73c0f1d75f17f4bc = []byte{ - // 555 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xbf, 0x6f, 0xd3, 0x4c, - 0x18, 0xb6, 0x53, 0x7d, 0x91, 0x72, 0xcd, 0xc7, 0x0f, 0x13, 0xd4, 0xc4, 0xa5, 0x4e, 0x88, 0x84, - 0x14, 0x22, 0xea, 0x53, 0x82, 0x54, 0xa4, 0x32, 0x20, 0x12, 0xd4, 0x2d, 0x12, 0x0a, 0x65, 0x61, - 0x09, 0x97, 0xf8, 0x74, 0x3d, 0x5a, 0xdf, 0x59, 0x7e, 0x2f, 0x51, 0xb3, 0x21, 0x26, 0xc4, 0x80, - 0x98, 0x99, 0x3a, 0x22, 0xa6, 0x0c, 0x4c, 0xcc, 0x0c, 0x1d, 0x2b, 0x26, 0x26, 0x40, 0xc9, 0x10, - 0xfe, 0x0c, 0x64, 0xfb, 0xa2, 0x26, 0x69, 0x44, 0x97, 0xc4, 0xf7, 0x3c, 0xef, 0xfb, 0xdc, 0xfb, - 0x3c, 0x7e, 0x8d, 0x6e, 0xbe, 0xea, 0x0b, 0x89, 0xbd, 0x90, 0x07, 0x78, 0x50, 0xc3, 0xea, 0xd8, - 0x0d, 0x42, 0xa9, 0xa4, 0x95, 0x8d, 0x60, 0x37, 0x82, 0xdd, 0x41, 0xcd, 0xbe, 0x4e, 0x7c, 0x2e, - 0x24, 0x8e, 0x7f, 0x93, 0x02, 0xdb, 0xe9, 0x49, 0xf0, 0x25, 0xe0, 0x2e, 0x01, 0x8a, 0x07, 0xb5, - 0x2e, 0x55, 0xa4, 0x86, 0x7b, 0x92, 0x0b, 0xcd, 0x6f, 0x68, 0xde, 0x07, 0x16, 0x09, 0xfb, 0xc0, - 0x34, 0x51, 0x48, 0x88, 0x4e, 0x7c, 0xc2, 0xc9, 0x41, 0x53, 0x39, 0x26, 0x99, 0x4c, 0xf0, 0xe8, - 0x49, 0xa3, 0xb7, 0x98, 0x94, 0xec, 0x88, 0x62, 0x12, 0x70, 0x4c, 0x84, 0x90, 0x8a, 0x28, 0x2e, - 0xc5, 0xac, 0xc7, 0x5e, 0x98, 0x9f, 0x51, 0x41, 0x81, 0x6b, 0xae, 0xfc, 0x3e, 0x85, 0x6e, 0xb4, - 0x80, 0x3d, 0xe1, 0xa0, 0x42, 0xde, 0xed, 0x2b, 0xba, 0x2f, 0x0f, 0xa9, 0x00, 0xeb, 0x11, 0xba, - 0x02, 0x54, 0x78, 0x34, 0xec, 0x10, 0xcf, 0x0b, 0x29, 0x40, 0xde, 0x2c, 0x99, 0x95, 0x4c, 0x23, - 0xff, 0xfd, 0xcb, 0x76, 0x4e, 0x4f, 0xf4, 0x38, 0x61, 0x9e, 0xa9, 0x90, 0x0b, 0xd6, 0xfe, 0x3f, - 0xa9, 0xd7, 0xa0, 0x35, 0x44, 0x69, 0xe2, 0xcb, 0xbe, 0x50, 0xf9, 0x54, 0x69, 0xad, 0xb2, 0x5e, - 0x2f, 0xb8, 0xba, 0x2b, 0x4a, 0xc3, 0xd5, 0x69, 0xb8, 0x4d, 0xc9, 0x45, 0x63, 0xef, 0xf4, 0x67, - 0xd1, 0xf8, 0xfc, 0xab, 0x58, 0x61, 0x5c, 0x1d, 0xf4, 0xbb, 0x6e, 0x4f, 0xfa, 0xda, 0xb4, 0xfe, - 0xdb, 0x06, 0xef, 0x10, 0xab, 0x61, 0x40, 0x21, 0x6e, 0x80, 0x8f, 0xd3, 0x51, 0x35, 0x7b, 0x44, - 0x19, 0xe9, 0x0d, 0x3b, 0x51, 0x9e, 0xf0, 0x69, 0x3a, 0xaa, 0x9a, 0x6d, 0x7d, 0xe1, 0xee, 0xc3, - 0x3f, 0x27, 0x45, 0xe3, 0xcd, 0x74, 0x54, 0x5d, 0xb2, 0xf0, 0x6e, 0x3a, 0xaa, 0x16, 0xe3, 0x2c, - 0x8e, 0x93, 0x34, 0x56, 0x18, 0x2f, 0x6f, 0xa1, 0xcd, 0x15, 0x70, 0x9b, 0x42, 0x20, 0x05, 0xd0, - 0xf2, 0x57, 0x13, 0x5d, 0x6d, 0x01, 0x7b, 0x1e, 0x78, 0x44, 0xd1, 0xa7, 0x24, 0x24, 0x3e, 0x58, - 0x3b, 0x28, 0x43, 0xfa, 0xea, 0x40, 0x86, 0x5c, 0x0d, 0x2f, 0x8d, 0xe9, 0xbc, 0xd4, 0x7a, 0x80, - 0xd2, 0x41, 0xac, 0x90, 0x4f, 0x95, 0xcc, 0xca, 0x7a, 0x3d, 0xe7, 0xce, 0x6f, 0x94, 0x9b, 0xa8, - 0x37, 0x32, 0x51, 0x3a, 0xda, 0x60, 0x52, 0xbe, 0xbb, 0xf3, 0xf6, 0xa4, 0x68, 0xcc, 0x4c, 0x9e, - 0x0b, 0x46, 0xfe, 0x36, 0x97, 0xfc, 0xcd, 0x0f, 0x5a, 0x2e, 0xa0, 0x8d, 0x25, 0x68, 0xe6, 0xab, - 0xfe, 0xcd, 0x44, 0x6b, 0x2d, 0x60, 0xd6, 0x4b, 0x74, 0xed, 0xc2, 0x2e, 0xdc, 0x5e, 0x9c, 0x6b, - 0x45, 0x3c, 0xf6, 0xdd, 0x4b, 0x4b, 0x66, 0x37, 0x59, 0xfb, 0x28, 0xbb, 0x90, 0xde, 0xd6, 0x85, - 0xd6, 0x79, 0xda, 0xbe, 0xf3, 0x4f, 0x7a, 0xa6, 0x6a, 0xff, 0xf7, 0x3a, 0x4a, 0xa8, 0xb1, 0x77, - 0x3a, 0x76, 0xcc, 0xb3, 0xb1, 0x63, 0xfe, 0x1e, 0x3b, 0xe6, 0x87, 0x89, 0x63, 0x9c, 0x4d, 0x1c, - 0xe3, 0xc7, 0xc4, 0x31, 0x5e, 0xdc, 0x9b, 0x5b, 0xae, 0x66, 0xfc, 0x62, 0x9a, 0x52, 0xa8, 0x90, - 0xf4, 0x14, 0xe0, 0xf9, 0xcc, 0xe2, 0x35, 0xeb, 0xa6, 0xe3, 0xaf, 0xe3, 0xfe, 0xdf, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x2b, 0x94, 0x26, 0xf5, 0xfb, 0x03, 0x00, 0x00, + // 535 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xbf, 0x6f, 0xd3, 0x40, + 0x18, 0xb5, 0x53, 0x11, 0x29, 0xd7, 0xf0, 0xcb, 0x04, 0x35, 0x71, 0x55, 0x27, 0x44, 0x42, 0x0a, + 0x11, 0xf5, 0x29, 0x41, 0x2a, 0x52, 0x19, 0x10, 0x09, 0xea, 0x16, 0x09, 0x85, 0xb2, 0xb0, 0x84, + 0x4b, 0x7c, 0xba, 0x1e, 0xc5, 0x77, 0x96, 0xbf, 0x4b, 0xd4, 0x6c, 0x88, 0x09, 0x31, 0x20, 0x66, + 0xa6, 0x8e, 0x88, 0x29, 0x03, 0x13, 0x33, 0x43, 0xc7, 0x8a, 0x89, 0x09, 0x50, 0x32, 0x84, 0x3f, + 0x03, 0xd9, 0xbe, 0xa8, 0x49, 0x1a, 0xb5, 0x8b, 0xed, 0x7b, 0xef, 0xfb, 0xf5, 0x9e, 0xbf, 0x43, + 0xb7, 0x5f, 0xf7, 0x85, 0xc4, 0x5e, 0xc8, 0x03, 0x3c, 0xa8, 0x61, 0x75, 0xe4, 0x06, 0xa1, 0x54, + 0xd2, 0xca, 0x46, 0xb0, 0x1b, 0xc1, 0xee, 0xa0, 0x66, 0xdf, 0x24, 0x3e, 0x17, 0x12, 0xc7, 0xcf, + 0x24, 0xc0, 0x76, 0x7a, 0x12, 0x7c, 0x09, 0xb8, 0x4b, 0x80, 0xe2, 0x41, 0xad, 0x4b, 0x15, 0xa9, + 0xe1, 0x9e, 0xe4, 0x42, 0xf3, 0x1b, 0x9a, 0xf7, 0x81, 0x45, 0x85, 0x7d, 0x60, 0x9a, 0x28, 0x24, + 0x44, 0x27, 0x3e, 0xe1, 0xe4, 0xa0, 0xa9, 0x1c, 0x93, 0x4c, 0x26, 0x78, 0xf4, 0xa5, 0x51, 0x7b, + 0x61, 0x42, 0x46, 0x05, 0x05, 0xae, 0x33, 0xca, 0x1f, 0x53, 0xe8, 0x56, 0x0b, 0xd8, 0x53, 0x0e, + 0x2a, 0xe4, 0xdd, 0xbe, 0xa2, 0xfb, 0xf2, 0x90, 0x0a, 0xb0, 0x1e, 0xa3, 0x6b, 0x40, 0x85, 0x47, + 0xc3, 0x0e, 0xf1, 0xbc, 0x90, 0x02, 0xe4, 0xcd, 0x92, 0x59, 0xc9, 0x34, 0xf2, 0x3f, 0xbf, 0x6d, + 0xe7, 0x74, 0xcf, 0x27, 0x09, 0xf3, 0x5c, 0x85, 0x5c, 0xb0, 0xf6, 0xd5, 0x24, 0x5e, 0x83, 0xd6, + 0x10, 0xa5, 0x89, 0x2f, 0xfb, 0x42, 0xe5, 0x53, 0xa5, 0xb5, 0xca, 0x7a, 0xbd, 0xe0, 0xea, 0xac, + 0x48, 0xaf, 0xab, 0xf5, 0xba, 0x4d, 0xc9, 0x45, 0x63, 0xef, 0xe4, 0x77, 0xd1, 0xf8, 0xfa, 0xa7, + 0x58, 0x61, 0x5c, 0x1d, 0xf4, 0xbb, 0x6e, 0x4f, 0xfa, 0x5a, 0x96, 0x7e, 0x6d, 0x83, 0x77, 0x88, + 0xd5, 0x30, 0xa0, 0x10, 0x27, 0xc0, 0xe7, 0xe9, 0xa8, 0x9a, 0x7d, 0x43, 0x19, 0xe9, 0x0d, 0x3b, + 0x91, 0x63, 0xf0, 0x65, 0x3a, 0xaa, 0x9a, 0x6d, 0xdd, 0x70, 0xf7, 0xd1, 0xbf, 0xe3, 0xa2, 0xf1, + 0x6e, 0x3a, 0xaa, 0x2e, 0x49, 0xf8, 0x30, 0x1d, 0x55, 0x8b, 0xb1, 0x17, 0x47, 0x89, 0x1b, 0x2b, + 0x84, 0x97, 0xb7, 0xd0, 0xe6, 0x0a, 0xb8, 0x4d, 0x21, 0x90, 0x02, 0x68, 0xf9, 0xbb, 0x89, 0xae, + 0xb7, 0x80, 0xbd, 0x08, 0x3c, 0xa2, 0xe8, 0x33, 0x12, 0x12, 0x1f, 0xac, 0x1d, 0x94, 0x21, 0x7d, + 0x75, 0x20, 0x43, 0xae, 0x86, 0x97, 0xda, 0x74, 0x16, 0x6a, 0x3d, 0x44, 0xe9, 0x20, 0xae, 0x90, + 0x4f, 0x95, 0xcc, 0xca, 0x7a, 0x3d, 0xe7, 0xce, 0xef, 0x8c, 0x9b, 0x54, 0x6f, 0x64, 0x22, 0x77, + 0xb4, 0xc0, 0x24, 0x7c, 0x77, 0xe7, 0xfd, 0x71, 0xd1, 0x98, 0x89, 0x3c, 0x2b, 0x18, 0xe9, 0xdb, + 0x5c, 0xd2, 0x37, 0x3f, 0x68, 0xb9, 0x80, 0x36, 0x96, 0xa0, 0x99, 0xae, 0xfa, 0x0f, 0x13, 0xad, + 0xb5, 0x80, 0x59, 0xaf, 0xd0, 0x8d, 0x73, 0xbb, 0x70, 0x67, 0x71, 0xae, 0x15, 0xf6, 0xd8, 0xf7, + 0x2e, 0x0d, 0x99, 0x75, 0xb2, 0xf6, 0x51, 0x76, 0xc1, 0xbd, 0xad, 0x73, 0xa9, 0xf3, 0xb4, 0x7d, + 0xf7, 0x42, 0x7a, 0x56, 0xd5, 0xbe, 0xf2, 0x36, 0x72, 0xa8, 0xb1, 0x77, 0x32, 0x76, 0xcc, 0xd3, + 0xb1, 0x63, 0xfe, 0x1d, 0x3b, 0xe6, 0xa7, 0x89, 0x63, 0x9c, 0x4e, 0x1c, 0xe3, 0xd7, 0xc4, 0x31, + 0x5e, 0xde, 0x9f, 0x5b, 0xae, 0x66, 0xfc, 0x63, 0x9a, 0x52, 0xa8, 0x90, 0xf4, 0x14, 0xe0, 0x79, + 0xcf, 0xe2, 0x35, 0xeb, 0xa6, 0xe3, 0xdb, 0xf1, 0xe0, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x27, + 0xbf, 0x5f, 0x60, 0xdd, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feemarket/ante/fee_test.go b/x/feemarket/ante/fee_test.go index bc9079d69..aa718ff6f 100644 --- a/x/feemarket/ante/fee_test.go +++ b/x/feemarket/ante/fee_test.go @@ -13,9 +13,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/app/ante/decorators" - "github.com/CosmosContracts/juno/v30/testutil" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/app/ante/decorators" + "github.com/CosmosContracts/juno/v31/testutil" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) // newBypassMsg returns an IBC relayer message that is in the default diff --git a/x/feemarket/ante/feegrant_test.go b/x/feemarket/ante/feegrant_test.go index 34312eb8f..44c9d24d6 100644 --- a/x/feemarket/ante/feegrant_test.go +++ b/x/feemarket/ante/feegrant_test.go @@ -3,11 +3,13 @@ package ante_test import ( "context" "math/rand" + "strings" "time" + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "cosmossdk.io/math" "cosmossdk.io/x/feegrant" - wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -23,9 +25,10 @@ import ( "github.com/cosmos/cosmos-sdk/x/auth/tx" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - junoante "github.com/CosmosContracts/juno/v30/app/ante" - "github.com/CosmosContracts/juno/v30/app/ante/decorators" - "github.com/CosmosContracts/juno/v30/testutil" + junoante "github.com/CosmosContracts/juno/v31/app/ante" + "github.com/CosmosContracts/juno/v31/app/ante/decorators" + "github.com/CosmosContracts/juno/v31/testutil" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" ) func (s *AnteTestSuite) TestNewAnteHandlerUsesEmbeddedFeegrantKeeper() { @@ -85,6 +88,107 @@ func (s *AnteTestSuite) TestNewAnteHandlerUsesEmbeddedFeegrantKeeper() { s.Require().True(after.Amount.Equal(before.Amount.Sub(fee.Amount))) } +func (s *AnteTestSuite) TestFeePayUsageCanonicalizesAuthenticatedSenderWhenFeeGranterPays() { + s.SetupTest() + + grantee := s.fullAccs[0] + granter := s.fullAccs[1] + contractAddr := sdk.AccAddress([]byte("12345678901234567890")).String() + contract := feepaytypes.FeePayContract{ + ContractAddress: contractAddr, + Balance: 1_000_000, + WalletLimit: 2, + } + s.App.AppKeepers.FeePayKeeper.SetFeePayContract(s.Ctx, contract) + s.FundModuleAcc(feepaytypes.ModuleName, sdk.NewCoins(sdk.NewInt64Coin("stake", 1_000_000))) + s.Require().NoError(s.App.AppKeepers.FeeGrantKeeper.GrantAllowance( + s.Ctx, + granter.Account.GetAddress(), + grantee.Account.GetAddress(), + &feegrant.BasicAllowance{SpendLimit: sdk.NewCoins(sdk.NewInt64Coin("stake", 1_000_000))}, + )) + + handler, err := junoante.NewAnteHandler(junoante.HandlerOptions{ + HandlerOptions: authante.HandlerOptions{ + FeegrantKeeper: s.App.AppKeepers.FeeGrantKeeper, + SignModeHandler: s.App.TxConfig().SignModeHandler(), + }, + AccountKeeper: s.App.AppKeepers.AccountKeeper, + BankKeeper: s.App.AppKeepers.BankKeeper, + StakingKeeper: *s.App.AppKeepers.StakingKeeper, + BondDenom: "stake", + IBCKeeper: s.App.AppKeepers.IBCKeeper, + TXCounterStoreService: runtime.NewKVStoreService(s.App.AppKeepers.GetKey(wasmtypes.StoreKey)), + NodeConfig: &wasmtypes.NodeConfig{}, + WasmKeeper: &s.App.AppKeepers.WasmKeeper, + FeemarketKeeper: *s.App.AppKeepers.FeeMarketKeeper, + FeepayKeeper: s.App.AppKeepers.FeePayKeeper, + FeeshareKeeper: s.App.AppKeepers.FeeShareKeeper, + }) + s.Require().NoError(err) + + // Run ante writes in a cache, just as BaseApp does, so the authentication + // negative control cannot leave fee-pay or account state behind. + runAnte := func(signedTx sdk.Tx) error { + cacheCtx, write := s.Ctx.CacheContext() + _, err := handler(cacheCtx, signedTx, false) + if err == nil { + write() + } + return err + } + + txConfig := s.App.TxConfig() + account := s.App.AppKeepers.AccountKeeper.GetAccount(s.Ctx, grantee.Account.GetAddress()) + canonicalSender := grantee.Account.GetAddress().String() + uppercaseSender := strings.ToUpper(canonicalSender) + makeTx := func(sender string, sequence uint64, priv cryptotypes.PrivKey) sdk.Tx { + signedTx, err := genTxWithFeeGranter( + txConfig, + []sdk.Msg{&wasmtypes.MsgExecuteContract{ + Sender: sender, Contract: contractAddr, Msg: []byte("{}"), + }}, + nil, + 200_000, + s.Ctx.ChainID(), + []uint64{account.GetAccountNumber()}, + []uint64{sequence}, + granter.Account.GetAddress(), + priv, + ) + s.Require().NoError(err) + return signedTx + } + + // This proves the regression transactions really pass through the + // production authentication decorators: the same message signed by a key + // that does not own Sender is rejected, and its cached ante writes vanish. + err = runAnte(makeTx(canonicalSender, account.GetSequence(), s.fullAccs[2].Priv)) + s.Require().ErrorIs(err, sdkerrors.ErrInvalidPubKey) + + err = runAnte(makeTx(canonicalSender, account.GetSequence(), grantee.Priv)) + s.Require().NoError(err) + account = s.App.AppKeepers.AccountKeeper.GetAccount(s.Ctx, grantee.Account.GetAddress()) + s.Require().Equal(uint64(1), account.GetSequence()) + + err = runAnte(makeTx(uppercaseSender, account.GetSequence(), grantee.Priv)) + s.Require().NoError(err) + account = s.App.AppKeepers.AccountKeeper.GetAccount(s.Ctx, grantee.Account.GetAddress()) + s.Require().Equal(uint64(2), account.GetSequence()) + + updated, err := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contractAddr) + s.Require().NoError(err) + signerUses, err := s.App.AppKeepers.FeePayKeeper.GetContractUses(s.Ctx, updated, canonicalSender) + s.Require().NoError(err) + uppercaseUses, err := s.App.AppKeepers.FeePayKeeper.GetContractUses(s.Ctx, updated, uppercaseSender) + s.Require().NoError(err) + granterUses, err := s.App.AppKeepers.FeePayKeeper.GetContractUses(s.Ctx, updated, granter.Account.GetAddress().String()) + s.Require().NoError(err) + s.Require().Equal(uint64(2), signerUses) + s.Require().Zero(uppercaseUses) + s.Require().Zero(granterUses) +} + func (s *AnteTestSuite) TestFeegranterWithoutKeeperReturnsError() { s.SetupTest() diff --git a/x/feemarket/ante/gas_limit_test.go b/x/feemarket/ante/gas_limit_test.go new file mode 100644 index 000000000..bb8af088e --- /dev/null +++ b/x/feemarket/ante/gas_limit_test.go @@ -0,0 +1,122 @@ +package ante_test + +import ( + "math" + + wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + protov2 "google.golang.org/protobuf/proto" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + authante "github.com/cosmos/cosmos-sdk/x/auth/ante" + + "github.com/CosmosContracts/juno/v31/app/ante/decorators" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" +) + +type gasLimitFeeTx struct { + gas uint64 + fee sdk.Coins + feePayer sdk.AccAddress + feeGranter sdk.AccAddress + msgs []sdk.Msg +} + +func (tx gasLimitFeeTx) GetMsgs() []sdk.Msg { return tx.msgs } +func (gasLimitFeeTx) GetMsgsV2() ([]protov2.Message, error) { return nil, nil } +func (tx gasLimitFeeTx) GetGas() uint64 { return tx.gas } +func (tx gasLimitFeeTx) GetFee() sdk.Coins { return tx.fee } +func (tx gasLimitFeeTx) FeePayer() []byte { return tx.feePayer } +func (tx gasLimitFeeTx) FeeGranter() []byte { return tx.feeGranter } + +func (s *AnteTestSuite) gasLimitDecorator() decorators.DeductFeeDecorator { + return decorators.NewDeductFeeDecorator( + s.App.AppKeepers.FeePayKeeper, + *s.App.AppKeepers.FeeMarketKeeper, + s.App.AppKeepers.AccountKeeper, + s.App.AppKeepers.BankKeeper, + s.App.AppKeepers.FeeGrantKeeper, + "stake", + nil, + authante.NewDeductFeeDecorator( + s.App.AppKeepers.AccountKeeper, + s.App.AppKeepers.BankKeeper, + s.App.AppKeepers.FeeGrantKeeper, + nil, + ), + ) +} + +func (s *AnteTestSuite) TestRejectGasLimitAboveMaxInt64() { + payer := s.fullAccs[0].Account.GetAddress() + granter := s.fullAccs[1].Account.GetAddress() + contract := sdk.AccAddress([]byte("gas_limit_feepay_contract")).String() + s.App.AppKeepers.FeePayKeeper.SetFeePayContract(s.Ctx, feepaytypes.FeePayContract{ + ContractAddress: contract, + Balance: math.MaxUint64, + WalletLimit: 10, + }) + + ordinaryMsg := NewTestMsg(payer) + ordinaryFee := sdk.NewCoins(sdk.NewInt64Coin("stake", 1)) + feePayMsg := &wasmtypes.MsgExecuteContract{ + Sender: payer.String(), + Contract: contract, + Msg: []byte("{}"), + } + + tests := []struct { + name string + fee sdk.Coins + feeGranter sdk.AccAddress + msgs []sdk.Msg + simulate bool + }{ + {name: "ordinary fee", fee: ordinaryFee, msgs: []sdk.Msg{ordinaryMsg}}, + {name: "ordinary fee simulation", fee: ordinaryFee, msgs: []sdk.Msg{ordinaryMsg}, simulate: true}, + {name: "feegrant", fee: ordinaryFee, feeGranter: granter, msgs: []sdk.Msg{ordinaryMsg}}, + {name: "feegrant simulation", fee: ordinaryFee, feeGranter: granter, msgs: []sdk.Msg{ordinaryMsg}, simulate: true}, + {name: "FeePay", msgs: []sdk.Msg{feePayMsg}}, + {name: "FeePay simulation", msgs: []sdk.Msg{feePayMsg}, simulate: true}, + } + + for _, tc := range tests { + s.Run(tc.name, func() { + nextCalled := false + tx := gasLimitFeeTx{ + gas: uint64(math.MaxInt64) + 1, + fee: tc.fee, + feePayer: payer, + feeGranter: tc.feeGranter, + msgs: tc.msgs, + } + + _, err := s.gasLimitDecorator().AnteHandle(s.Ctx, tx, tc.simulate, func(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.Context, error) { + nextCalled = true + return ctx, nil + }) + + s.Require().ErrorIs(err, sdkerrors.ErrInvalidGasLimit) + s.Require().ErrorContains(err, "exceeds maximum") + s.Require().False(nextCalled) + }) + } +} + +func (s *AnteTestSuite) TestMaxInt64GasLimitIsAllowedInSimulation() { + payer := s.fullAccs[0].Account.GetAddress() + nextCalled := false + tx := gasLimitFeeTx{ + gas: uint64(math.MaxInt64), + feePayer: payer, + msgs: []sdk.Msg{NewTestMsg(payer)}, + } + + _, err := s.gasLimitDecorator().AnteHandle(s.Ctx, tx, true, func(ctx sdk.Context, _ sdk.Tx, _ bool) (sdk.Context, error) { + nextCalled = true + return ctx, nil + }) + + s.Require().NoError(err) + s.Require().True(nextCalled) +} diff --git a/x/feemarket/ante/simulation_gas_test.go b/x/feemarket/ante/simulation_gas_test.go new file mode 100644 index 000000000..0e1b2208e --- /dev/null +++ b/x/feemarket/ante/simulation_gas_test.go @@ -0,0 +1,51 @@ +package ante_test + +import ( + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// TestSimulationIncludesUserFeeEscrowGas guards wallet gas estimation. A +// simulation must execute the same fee-escrow bank writes as delivery; otherwise +// wallets apply their gas adjustment to an estimate that is systematically low. +func (s *AnteTestSuite) TestSimulationIncludesUserFeeEscrowGas() { + payer := s.fullAccs[0] + payerAddr := payer.Account.GetAddress() + fee := sdk.NewCoins(sdk.NewInt64Coin("stake", 1_000_000)) + s.FundAcc(payerAddr, sdk.NewCoins(sdk.NewInt64Coin("stake", 2_000_000))) + + account := s.App.AppKeepers.AccountKeeper.GetAccount(s.Ctx, payerAddr) + s.Require().NoError(account.SetPubKey(payer.Priv.PubKey())) + s.App.AppKeepers.AccountKeeper.SetAccount(s.Ctx, account) + makeTx := func(gas uint64, fees sdk.Coins) sdk.Tx { + s.Require().NoError(s.TxBuilder.SetMsgs(NewTestMsg(payerAddr))) + s.TxBuilder.SetFeeAmount(fees) + s.TxBuilder.SetGasLimit(gas) + + tx, err := s.CreateTestTx( + []cryptotypes.PrivKey{payer.Priv}, + []uint64{account.GetAccountNumber()}, + []uint64{account.GetSequence()}, + s.Ctx.ChainID(), + ) + s.Require().NoError(err) + return tx + } + + simCtx, _ := s.Ctx.CacheContext() + // Keplr's simulateAndSend path submits an empty fee amount, then computes + // the real fee only after receiving the gas estimate. + simCtx, err := s.AnteHandler(simCtx, makeTx(0, nil), true) + s.Require().NoError(err) + simulatedGas := simCtx.GasMeter().GasConsumed() + + deliverCtx, _ := s.Ctx.CacheContext() + deliverCtx, err = s.AnteHandler(deliverCtx, makeTx(1_000_000, fee), false) + s.Require().NoError(err) + deliveredGas := deliverCtx.GasMeter().GasConsumed() + + s.T().Logf("simulated gas: %d; delivered gas: %d", simulatedGas, deliveredGas) + // The positive simulation probe may differ slightly from the final fee due + // to encoded coin amount size, but it must include the escrow store work. + s.Require().InDelta(deliveredGas, simulatedGas, 1_000) +} diff --git a/x/feemarket/ante/suite_test.go b/x/feemarket/ante/suite_test.go index e53c7d648..4e4738ca8 100644 --- a/x/feemarket/ante/suite_test.go +++ b/x/feemarket/ante/suite_test.go @@ -17,12 +17,12 @@ import ( authante "github.com/cosmos/cosmos-sdk/x/auth/ante" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" - junoapp "github.com/CosmosContracts/juno/v30/app" - "github.com/CosmosContracts/juno/v30/app/ante/decorators" - "github.com/CosmosContracts/juno/v30/testutil" - keeper "github.com/CosmosContracts/juno/v30/x/feemarket/keeper" - feemarketpost "github.com/CosmosContracts/juno/v30/x/feemarket/post" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + junoapp "github.com/CosmosContracts/juno/v31/app" + "github.com/CosmosContracts/juno/v31/app/ante/decorators" + "github.com/CosmosContracts/juno/v31/testutil" + keeper "github.com/CosmosContracts/juno/v31/x/feemarket/keeper" + feemarketpost "github.com/CosmosContracts/juno/v31/x/feemarket/post" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) type AnteTestSuite struct { diff --git a/x/feemarket/fuzz/aimd_eip1559_test.go b/x/feemarket/fuzz/aimd_eip1559_test.go index 300aecb9e..01be37e45 100644 --- a/x/feemarket/fuzz/aimd_eip1559_test.go +++ b/x/feemarket/fuzz/aimd_eip1559_test.go @@ -8,7 +8,7 @@ import ( "cosmossdk.io/math" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) // TestAIMDLearningRate ensures that the additive increase diff --git a/x/feemarket/fuzz/eip1559_test.go b/x/feemarket/fuzz/eip1559_test.go index 619c1b3b9..3fadeb55e 100644 --- a/x/feemarket/fuzz/eip1559_test.go +++ b/x/feemarket/fuzz/eip1559_test.go @@ -8,7 +8,7 @@ import ( "cosmossdk.io/math" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) // TestLearningRate ensures that the learning rate is always diff --git a/x/feemarket/fuzz/tx_priority_test.go b/x/feemarket/fuzz/tx_priority_test.go index 8a856744a..5d86901b7 100644 --- a/x/feemarket/fuzz/tx_priority_test.go +++ b/x/feemarket/fuzz/tx_priority_test.go @@ -11,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/app/ante/decorators" + "github.com/CosmosContracts/juno/v31/app/ante/decorators" ) type input struct { diff --git a/x/feemarket/keeper/feemarket_test.go b/x/feemarket/keeper/feemarket_test.go index 4f7d5574d..a3e8bbda0 100644 --- a/x/feemarket/keeper/feemarket_test.go +++ b/x/feemarket/keeper/feemarket_test.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) func (s *KeeperTestSuite) TestUpdateFeeMarket() { diff --git a/x/feemarket/keeper/genesis.go b/x/feemarket/keeper/genesis.go index 3c67f43b1..d16245dc0 100644 --- a/x/feemarket/keeper/genesis.go +++ b/x/feemarket/keeper/genesis.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) // InitGenesis initializes the feemarket module's state from a given genesis state. diff --git a/x/feemarket/keeper/genesis_test.go b/x/feemarket/keeper/genesis_test.go index 65269b053..4ba07c7ed 100644 --- a/x/feemarket/keeper/genesis_test.go +++ b/x/feemarket/keeper/genesis_test.go @@ -1,7 +1,7 @@ package keeper_test import ( - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) func (s *KeeperTestSuite) TestInitGenesis() { diff --git a/x/feemarket/keeper/keeper.go b/x/feemarket/keeper/keeper.go index 7a6792518..e1736a456 100644 --- a/x/feemarket/keeper/keeper.go +++ b/x/feemarket/keeper/keeper.go @@ -10,21 +10,28 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) // Keeper is the x/feemarket keeper. type Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - ak types.AccountKeeper - resolver types.DenomResolver + cdc codec.BinaryCodec + storeKey storetypes.StoreKey + ak types.AccountKeeper + resolver types.DenomResolver + feePayLiabilities FeePayLiabilityChecker // The address that is capable of executing a MsgParams message. // Typically, this will be the governance module's address. authority string } +// FeePayLiabilityChecker guards denomination changes while denomination-less +// FeePay ledger balances are still backed by the current fee denomination. +type FeePayLiabilityChecker interface { + HasOutstandingBalances(ctx sdk.Context) bool +} + // NewKeeper constructs a new feemarket keeper. func NewKeeper( cdc codec.BinaryCodec, @@ -94,6 +101,12 @@ func (k *Keeper) SetDenomResolver(resolver types.DenomResolver) { k.resolver = resolver } +// SetFeePayLiabilityChecker wires the cross-module invariant after both keepers +// have been constructed, avoiding a keeper-construction cycle. +func (k *Keeper) SetFeePayLiabilityChecker(checker FeePayLiabilityChecker) { + k.feePayLiabilities = checker +} + // GetState returns the feemarket module's state. func (k *Keeper) GetState(ctx sdk.Context) (types.State, error) { store := ctx.KVStore(k.storeKey) diff --git a/x/feemarket/keeper/keeper_test.go b/x/feemarket/keeper/keeper_test.go index c9f1d7aa7..1517eeaa9 100644 --- a/x/feemarket/keeper/keeper_test.go +++ b/x/feemarket/keeper/keeper_test.go @@ -12,9 +12,9 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/CosmosContracts/juno/v30/testutil" - "github.com/CosmosContracts/juno/v30/x/feemarket/keeper" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/testutil" + "github.com/CosmosContracts/juno/v31/x/feemarket/keeper" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) type KeeperTestSuite struct { diff --git a/x/feemarket/keeper/msg_server.go b/x/feemarket/keeper/msg_server.go index bb69c25be..afdf02424 100644 --- a/x/feemarket/keeper/msg_server.go +++ b/x/feemarket/keeper/msg_server.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) var _ types.MsgServer = (*MsgServer)(nil) @@ -45,6 +45,9 @@ func (ms MsgServer) UpdateParams(goCtx context.Context, msg *types.MsgUpdatePara if err != nil { return nil, errorsmod.Wrap(err, "failed to get params") } + if gotParams.FeeDenom != params.FeeDenom && ms.k.feePayLiabilities != nil && ms.k.feePayLiabilities.HasOutstandingBalances(ctx) { + return nil, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "cannot change fee denom while FeePay has outstanding FeePay balances") + } // if going from disabled -> enabled, set enabled height if !gotParams.Enabled && msg.Params.Enabled { diff --git a/x/feemarket/keeper/msg_server_test.go b/x/feemarket/keeper/msg_server_test.go index 97ab8361f..a06a8b96d 100644 --- a/x/feemarket/keeper/msg_server_test.go +++ b/x/feemarket/keeper/msg_server_test.go @@ -3,7 +3,8 @@ package keeper_test import ( sdkmath "cosmossdk.io/math" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" ) func (s *KeeperTestSuite) TestMsgParams() { @@ -31,6 +32,38 @@ func (s *KeeperTestSuite) TestMsgParams() { s.Require().Equal(req.Params, params) }) + s.Run("rejects fee denom change while FeePay has outstanding balances", func() { + before, err := s.App.AppKeepers.FeeMarketKeeper.GetParams(s.Ctx) + s.Require().NoError(err) + + s.App.AppKeepers.FeePayKeeper.SetFeePayContract(s.Ctx, feepaytypes.FeePayContract{ + ContractAddress: s.authorityAccount.String(), + Balance: 1, + }) + + changed := before + changed.FeeDenom = "uother" + _, err = s.msgServer.UpdateParams(s.Ctx, &types.MsgUpdateParams{ + Authority: s.authorityAccount.String(), + Params: changed, + }) + s.Require().ErrorContains(err, "outstanding FeePay balances") + + after, err := s.App.AppKeepers.FeeMarketKeeper.GetParams(s.Ctx) + s.Require().NoError(err) + s.Require().Equal(before, after) + + s.App.AppKeepers.FeePayKeeper.SetFeePayContract(s.Ctx, feepaytypes.FeePayContract{ + ContractAddress: s.authorityAccount.String(), + Balance: 0, + }) + _, err = s.msgServer.UpdateParams(s.Ctx, &types.MsgUpdateParams{ + Authority: s.authorityAccount.String(), + Params: changed, + }) + s.Require().NoError(err) + }) + s.Run("rejects a req with invalid signer", func() { req := &types.MsgUpdateParams{ Authority: "invalid", diff --git a/x/feemarket/keeper/query_server.go b/x/feemarket/keeper/query_server.go index 960b3519e..eea5c5f14 100644 --- a/x/feemarket/keeper/query_server.go +++ b/x/feemarket/keeper/query_server.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) var _ types.QueryServer = (*QueryServer)(nil) diff --git a/x/feemarket/keeper/query_server_test.go b/x/feemarket/keeper/query_server_test.go index ea4ac9247..07755f436 100644 --- a/x/feemarket/keeper/query_server_test.go +++ b/x/feemarket/keeper/query_server_test.go @@ -3,7 +3,7 @@ package keeper_test import ( "cosmossdk.io/math" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) func (s *KeeperTestSuite) TestParamsRequest() { diff --git a/x/feemarket/module/autocli.go b/x/feemarket/module/autocli.go index df8fc9272..4c0c48c5b 100644 --- a/x/feemarket/module/autocli.go +++ b/x/feemarket/module/autocli.go @@ -3,7 +3,7 @@ package module import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - feemarketv1 "github.com/CosmosContracts/juno/v30/api/juno/feemarket/v1" + feemarketv1 "github.com/CosmosContracts/juno/v31/api/juno/feemarket/v1" ) // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. diff --git a/x/feemarket/module/module.go b/x/feemarket/module/module.go index d77629071..b94c6dbb5 100644 --- a/x/feemarket/module/module.go +++ b/x/feemarket/module/module.go @@ -14,8 +14,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/CosmosContracts/juno/v30/x/feemarket/keeper" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/keeper" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) // ConsensusVersion is the x/feemarket module's consensus version identifier. diff --git a/x/feemarket/post/fee.go b/x/feemarket/post/fee.go index 6471a62a0..b8a03d778 100644 --- a/x/feemarket/post/fee.go +++ b/x/feemarket/post/fee.go @@ -12,12 +12,12 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - "github.com/CosmosContracts/juno/v30/app/ante/decorators" - feemarketkeeper "github.com/CosmosContracts/juno/v30/x/feemarket/keeper" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - feepayhelpers "github.com/CosmosContracts/juno/v30/x/feepay/helpers" - feepaykeeper "github.com/CosmosContracts/juno/v30/x/feepay/keeper" - feepaytypes "github.com/CosmosContracts/juno/v30/x/feepay/types" + "github.com/CosmosContracts/juno/v31/app/ante/decorators" + feemarketkeeper "github.com/CosmosContracts/juno/v31/x/feemarket/keeper" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + feepayhelpers "github.com/CosmosContracts/juno/v31/x/feepay/helpers" + feepaykeeper "github.com/CosmosContracts/juno/v31/x/feepay/keeper" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" ) // BankSendGasConsumption is the gas consumption of the bank sends that occur during feemarket handler execution. @@ -285,22 +285,13 @@ func (dfd FeeMarketDeductDecorator) PayOutFeeAndRefundFeePay(ctx sdk.Context, fe // the tx fee is zero — but stay defensive) fee, refund = dfd.capAtCollectorBalance(ctx, fee, refund) - var events sdk.Events - - if !fee.IsNil() && !fee.IsZero() { - if err := DeductCoins(dfd.bankKeeper, ctx, sdk.NewCoins(fee), params.DistributeFees); err != nil { - return err - } - - events = append(events, sdk.NewEvent( - feemarkettypes.EventTypeFeePay, - sdk.NewAttribute(sdk.AttributeKeyFee, fee.String()), - )) - } - + // Resolve and validate any refund ledger credit before moving coins. This + // keeps conversion/overflow rejection atomic even for direct keeper calls. + var ( + refundContract *feepaytypes.FeePayContract + refundBalance uint64 + ) if !refund.IsNil() && !refund.IsZero() { - // CONTRACT: a valid feepay tx has exactly one MsgExecuteContract on a - // registered contract (enforced by IsValidFeePayTransaction). msgs := feeTx.GetMsgs() if len(msgs) != 1 { return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "feepay tx must contain exactly one message, got %d", len(msgs)) @@ -310,17 +301,37 @@ func (dfd FeeMarketDeductDecorator) PayOutFeeAndRefundFeePay(ctx sdk.Context, fe return errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "feepay tx message must be a MsgExecuteContract, got %T", msgs[0]) } - contract, err := dfd.feepayKeeper.GetContract(ctx, cw.GetContract()) + refundContract, err = dfd.feepayKeeper.GetContract(ctx, cw.GetContract()) if err != nil { return errorsmod.Wrapf(err, "error getting feepay contract %s for escrow refund", cw.GetContract()) } + refundBalance, err = feepaytypes.ContractBalanceAfterAddition(refundContract.Balance, refund.Amount) + if err != nil { + return err + } + } + + var events sdk.Events + + if !fee.IsNil() && !fee.IsZero() { + if err := DeductCoins(dfd.bankKeeper, ctx, sdk.NewCoins(fee), params.DistributeFees); err != nil { + return err + } + + events = append(events, sdk.NewEvent( + feemarkettypes.EventTypeFeePay, + sdk.NewAttribute(sdk.AttributeKeyFee, fee.String()), + )) + } + if !refund.IsNil() && !refund.IsZero() { if err := dfd.bankKeeper.SendCoinsFromModuleToModule(ctx, feemarkettypes.FeeCollectorName, feepaytypes.ModuleName, sdk.NewCoins(refund)); err != nil { return errorsmod.Wrapf(err, "error refunding feepay escrow") } - dfd.feepayKeeper.SetContractBalance(ctx, contract, contract.Balance+refund.Amount.Uint64()) + dfd.feepayKeeper.SetContractBalance(ctx, refundContract, refundBalance) + cw := feeTx.GetMsgs()[0].(*wasmtypes.MsgExecuteContract) events = append(events, sdk.NewEvent( feemarkettypes.EventTypeFeePayRefund, sdk.NewAttribute(feemarkettypes.AttributeKeyRefund, refund.String()), diff --git a/x/feemarket/post/fee_test.go b/x/feemarket/post/fee_test.go index 2331b43dd..9bf754218 100644 --- a/x/feemarket/post/fee_test.go +++ b/x/feemarket/post/fee_test.go @@ -2,11 +2,13 @@ package post_test import ( "fmt" + stdmath "math" "testing" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + protov2 "google.golang.org/protobuf/proto" ibcchanneltypes "github.com/cosmos/ibc-go/v10/modules/core/04-channel/types" @@ -27,13 +29,13 @@ import ( govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - junoapp "github.com/CosmosContracts/juno/v30/app" - "github.com/CosmosContracts/juno/v30/app/ante/decorators" - "github.com/CosmosContracts/juno/v30/testutil" - keeper "github.com/CosmosContracts/juno/v30/x/feemarket/keeper" - "github.com/CosmosContracts/juno/v30/x/feemarket/post" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" - feepaytypes "github.com/CosmosContracts/juno/v30/x/feepay/types" + junoapp "github.com/CosmosContracts/juno/v31/app" + "github.com/CosmosContracts/juno/v31/app/ante/decorators" + "github.com/CosmosContracts/juno/v31/testutil" + keeper "github.com/CosmosContracts/juno/v31/x/feemarket/keeper" + "github.com/CosmosContracts/juno/v31/x/feemarket/post" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" ) type PostTestSuite struct { @@ -54,6 +56,17 @@ type PostTestCase struct { StateUpdate func(*PostTestSuite) } +type feePayTestTx struct { + msgs []sdk.Msg +} + +func (testTx feePayTestTx) GetMsgs() []sdk.Msg { return testTx.msgs } +func (feePayTestTx) GetMsgsV2() ([]protov2.Message, error) { return nil, nil } +func (feePayTestTx) GetGas() uint64 { return 1 } +func (feePayTestTx) GetFee() sdk.Coins { return nil } +func (feePayTestTx) FeePayer() []byte { return nil } +func (feePayTestTx) FeeGranter() []byte { return nil } + func TestPostTestSuite(t *testing.T) { suite.Run(t, new(PostTestSuite)) } @@ -858,6 +871,196 @@ func (s *PostTestSuite) TestFeePayNoProposerTipAndRefund() { s.Require().Equal(preExisting+consumed, s.App.AppKeepers.BankKeeper.GetBalance(s.Ctx, collectorAddr, "stake").Amount.Int64()) } +// TestFeePayUsesConfiguredFeeDenom covers the consensus-sensitive case where +// feemarket's configured fee denom differs from the staking bond denom. +func (s *PostTestSuite) TestFeePayUsesConfiguredFeeDenom() { + s.SetupTest() + + const ( + feeDenom = "ufee" + gasLimit = uint64(300_000) + initialBalance = uint64(10_000_000) + ) + + params, err := s.App.AppKeepers.FeeMarketKeeper.GetParams(s.Ctx) + s.Require().NoError(err) + params.FeeDenom = feeDenom + s.Require().NoError(s.App.AppKeepers.FeeMarketKeeper.SetParams(s.Ctx, params)) + + contractAddr := sdk.AccAddress([]byte("fee_denom_contract_x")).String() + s.App.AppKeepers.FeePayKeeper.SetFeePayContract(s.Ctx, feepaytypes.FeePayContract{ + ContractAddress: contractAddr, + Balance: initialBalance, + WalletLimit: 100, + }) + s.FundModuleAcc(feepaytypes.ModuleName, sdk.NewCoins(sdk.NewInt64Coin(feeDenom, int64(initialBalance)))) + + signerPriv, _, signerAddr := testdata.KeyTestPubAddr() + acc := s.App.AppKeepers.AccountKeeper.NewAccountWithAddress(s.Ctx, signerAddr) + s.Require().NoError(acc.SetPubKey(signerPriv.PubKey())) + s.App.AppKeepers.AccountKeeper.SetAccount(s.Ctx, acc) + + execMsg := &wasmtypes.MsgExecuteContract{Sender: signerAddr.String(), Contract: contractAddr, Msg: []byte("{}")} + s.Require().NoError(s.TxBuilder.SetMsgs(execMsg)) + s.TxBuilder.SetFeeAmount(nil) + s.TxBuilder.SetGasLimit(gasLimit) + testTx, err := s.CreateTestTx( + []cryptotypes.PrivKey{signerPriv}, + []uint64{acc.GetAccountNumber()}, + []uint64{0}, + s.Ctx.ChainID(), + ) + s.Require().NoError(err) + s.Ctx = s.Ctx.WithGasMeter(storetypes.NewGasMeter(NewTestGasLimit())) + + newCtx, err := s.AnteHandler(s.Ctx, testTx, false) + s.Require().NoError(err) + s.Ctx = newCtx + + escrow := int64(gasLimit) + feepayAddr := s.App.AppKeepers.AccountKeeper.GetModuleAddress(feepaytypes.ModuleName) + collectorAddr := s.App.AppKeepers.AccountKeeper.GetModuleAddress(types.FeeCollectorName) + s.Require().Equal(int64(initialBalance)-escrow, s.App.AppKeepers.BankKeeper.GetBalance(s.Ctx, feepayAddr, feeDenom).Amount.Int64()) + s.Require().Equal(escrow, s.App.AppKeepers.BankKeeper.GetBalance(s.Ctx, collectorAddr, feeDenom).Amount.Int64()) + + _, err = s.PostHandler(s.Ctx, testTx, false, true) + s.Require().NoError(err) + + contract, err := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contractAddr) + s.Require().NoError(err) + consumed := int64(initialBalance) - int64(contract.Balance) + s.Require().Positive(consumed) + s.Require().Less(consumed, escrow) + s.Require().Equal(int64(initialBalance)-consumed, s.App.AppKeepers.BankKeeper.GetBalance(s.Ctx, feepayAddr, feeDenom).Amount.Int64()) + s.Require().Equal(consumed, s.App.AppKeepers.BankKeeper.GetBalance(s.Ctx, collectorAddr, feeDenom).Amount.Int64()) + s.Require().True(s.App.AppKeepers.BankKeeper.GetBalance(s.Ctx, feepayAddr, "stake").IsZero()) +} + +func (s *PostTestSuite) TestFeePayMissingConfiguredFeeDenomFundsHasNoMutation() { + s.SetupTest() + + const ( + feeDenom = "ufee" + gasLimit = uint64(300_000) + initialBalance = uint64(10_000_000) + ) + + params, err := s.App.AppKeepers.FeeMarketKeeper.GetParams(s.Ctx) + s.Require().NoError(err) + params.FeeDenom = feeDenom + s.Require().NoError(s.App.AppKeepers.FeeMarketKeeper.SetParams(s.Ctx, params)) + + contractAddr := sdk.AccAddress([]byte("missing_fee_funds_xx")).String() + s.App.AppKeepers.FeePayKeeper.SetFeePayContract(s.Ctx, feepaytypes.FeePayContract{ + ContractAddress: contractAddr, + Balance: initialBalance, + WalletLimit: 100, + }) + // Deliberately fund only the bond denom. Accounting claims sufficient + // funds, but the configured fee-denom escrow is absent. + s.FundModuleAcc(feepaytypes.ModuleName, sdk.NewCoins(sdk.NewInt64Coin("stake", int64(initialBalance)))) + + signerPriv, _, signerAddr := testdata.KeyTestPubAddr() + acc := s.App.AppKeepers.AccountKeeper.NewAccountWithAddress(s.Ctx, signerAddr) + s.Require().NoError(acc.SetPubKey(signerPriv.PubKey())) + s.App.AppKeepers.AccountKeeper.SetAccount(s.Ctx, acc) + + execMsg := &wasmtypes.MsgExecuteContract{Sender: signerAddr.String(), Contract: contractAddr, Msg: []byte("{}")} + s.Require().NoError(s.TxBuilder.SetMsgs(execMsg)) + s.TxBuilder.SetFeeAmount(nil) + s.TxBuilder.SetGasLimit(gasLimit) + testTx, err := s.CreateTestTx( + []cryptotypes.PrivKey{signerPriv}, + []uint64{acc.GetAccountNumber()}, + []uint64{0}, + s.Ctx.ChainID(), + ) + s.Require().NoError(err) + s.Ctx = s.Ctx.WithGasMeter(storetypes.NewGasMeter(NewTestGasLimit())) + + _, err = s.AnteHandler(s.Ctx, testTx, false) + s.Require().ErrorIs(err, sdkerrors.ErrInsufficientFunds) + s.Require().ErrorContains(err, "error transferring funds from FeePay to FeeCollector") + + contract, getErr := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contractAddr) + s.Require().NoError(getErr) + s.Require().Equal(initialBalance, contract.Balance) + uses, getErr := s.App.AppKeepers.FeePayKeeper.GetContractUses(s.Ctx, contract, signerAddr.String()) + s.Require().NoError(getErr) + s.Require().Zero(uses) + feepayAddr := s.App.AppKeepers.AccountKeeper.GetModuleAddress(feepaytypes.ModuleName) + collectorAddr := s.App.AppKeepers.AccountKeeper.GetModuleAddress(types.FeeCollectorName) + s.Require().Equal(int64(initialBalance), s.App.AppKeepers.BankKeeper.GetBalance(s.Ctx, feepayAddr, "stake").Amount.Int64()) + s.Require().True(s.App.AppKeepers.BankKeeper.GetBalance(s.Ctx, feepayAddr, feeDenom).IsZero()) + s.Require().True(s.App.AppKeepers.BankKeeper.GetBalance(s.Ctx, collectorAddr, feeDenom).IsZero()) +} + +func (s *PostTestSuite) TestFeePayAnteRejectsRequiredFeeAboveUint64Atomically() { + s.SetupTest() + state, err := s.App.AppKeepers.FeeMarketKeeper.GetState(s.Ctx) + s.Require().NoError(err) + state.BaseGasPrice = math.LegacyNewDec(3) + s.Require().NoError(s.App.AppKeepers.FeeMarketKeeper.SetState(s.Ctx, state)) + + contractAddr := sdk.AccAddress([]byte("12345678901234567890")).String() + s.App.AppKeepers.FeePayKeeper.SetFeePayContract(s.Ctx, feepaytypes.FeePayContract{ + ContractAddress: contractAddr, Balance: stdmath.MaxUint64, WalletLimit: 10, + }) + signerPriv, _, signerAddr := testdata.KeyTestPubAddr() + acc := s.App.AppKeepers.AccountKeeper.NewAccountWithAddress(s.Ctx, signerAddr) + s.Require().NoError(acc.SetPubKey(signerPriv.PubKey())) + s.App.AppKeepers.AccountKeeper.SetAccount(s.Ctx, acc) + s.Require().NoError(s.TxBuilder.SetMsgs(&wasmtypes.MsgExecuteContract{ + Sender: signerAddr.String(), Contract: contractAddr, Msg: []byte("{}"), + })) + s.TxBuilder.SetFeeAmount(nil) + s.TxBuilder.SetGasLimit(uint64(stdmath.MaxInt64)) + testTx, err := s.CreateTestTx([]cryptotypes.PrivKey{signerPriv}, + []uint64{acc.GetAccountNumber()}, []uint64{0}, s.Ctx.ChainID()) + s.Require().NoError(err) + + _, err = s.AnteHandler(s.Ctx.WithGasMeter(storetypes.NewGasMeter(NewTestGasLimit())), testTx, false) + s.Require().ErrorIs(err, feepaytypes.ErrFeePayAmountOutOfRange) + contract, getErr := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contractAddr) + s.Require().NoError(getErr) + s.Require().Equal(uint64(stdmath.MaxUint64), contract.Balance) + uses, getErr := s.App.AppKeepers.FeePayKeeper.GetContractUses(s.Ctx, contract, signerAddr.String()) + s.Require().NoError(getErr) + s.Require().Zero(uses) + collectorAddr := s.App.AppKeepers.AccountKeeper.GetModuleAddress(types.FeeCollectorName) + s.Require().True(s.App.AppKeepers.BankKeeper.GetBalance(s.Ctx, collectorAddr, "stake").IsZero()) +} + +func (s *PostTestSuite) TestFeePayRefundOverflowIsAtomic() { + s.SetupTest() + contractAddr := sdk.AccAddress([]byte("12345678901234567890")).String() + s.App.AppKeepers.FeePayKeeper.SetFeePayContract(s.Ctx, feepaytypes.FeePayContract{ + ContractAddress: contractAddr, + Balance: stdmath.MaxUint64, + }) + s.FundModuleAcc(types.FeeCollectorName, sdk.NewCoins(sdk.NewInt64Coin("stake", 1))) + + dfd := post.NewFeeMarketDeductDecorator( + s.App.AppKeepers.AccountKeeper, + s.App.AppKeepers.BankKeeper, + *s.App.AppKeepers.FeeMarketKeeper, + s.App.AppKeepers.FeePayKeeper, + s.App.AppKeepers.StakingKeeper, + ) + testTx := feePayTestTx{msgs: []sdk.Msg{&wasmtypes.MsgExecuteContract{Contract: contractAddr}}} + collectorAddr := s.App.AppKeepers.AccountKeeper.GetModuleAddress(types.FeeCollectorName) + feepayAddr := s.App.AppKeepers.AccountKeeper.GetModuleAddress(feepaytypes.ModuleName) + err := dfd.PayOutFeeAndRefundFeePay(s.Ctx, testTx, + sdk.NewCoin("stake", math.ZeroInt()), sdk.NewInt64Coin("stake", 1)) + s.Require().ErrorIs(err, feepaytypes.ErrFeePayBalanceOverflow) + + contract, getErr := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contractAddr) + s.Require().NoError(getErr) + s.Require().Equal(uint64(stdmath.MaxUint64), contract.Balance) + s.Require().Equal(math.NewInt(1), s.App.AppKeepers.BankKeeper.GetBalance(s.Ctx, collectorAddr, "stake").Amount) + s.Require().True(s.App.AppKeepers.BankKeeper.GetBalance(s.Ctx, feepayAddr, "stake").IsZero()) +} + // TestTipPaidToProposerOperatorAccount asserts the proposer tip goes to the // validator OPERATOR account resolved via the consensus address — not to the // raw consensus address cast to an AccAddress (an unspendable account). diff --git a/x/feemarket/types/genesis_test.go b/x/feemarket/types/genesis_test.go index 358c01941..64f6c07f3 100644 --- a/x/feemarket/types/genesis_test.go +++ b/x/feemarket/types/genesis_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) func TestGenesis(t *testing.T) { diff --git a/x/feemarket/types/msgs_test.go b/x/feemarket/types/msgs_test.go index ff0a3a493..1fdaae785 100644 --- a/x/feemarket/types/msgs_test.go +++ b/x/feemarket/types/msgs_test.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) func TestMsgParams(t *testing.T) { diff --git a/x/feemarket/types/params_test.go b/x/feemarket/types/params_test.go index c1cbd4e29..6d113a49b 100644 --- a/x/feemarket/types/params_test.go +++ b/x/feemarket/types/params_test.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) func TestParams(t *testing.T) { diff --git a/x/feemarket/types/state_fuzz_test.go b/x/feemarket/types/state_fuzz_test.go index 82d8becc0..963c33f1b 100644 --- a/x/feemarket/types/state_fuzz_test.go +++ b/x/feemarket/types/state_fuzz_test.go @@ -7,7 +7,7 @@ import ( "cosmossdk.io/math" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) func FuzzDefaultFeeMarket(f *testing.F) { diff --git a/x/feemarket/types/state_test.go b/x/feemarket/types/state_test.go index 60ba38b43..cc20901e7 100644 --- a/x/feemarket/types/state_test.go +++ b/x/feemarket/types/state_test.go @@ -8,7 +8,7 @@ import ( "cosmossdk.io/math" - "github.com/CosmosContracts/juno/v30/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feemarket/types" ) var OneHundred = math.LegacyMustNewDecFromStr("100") diff --git a/x/feepay/helpers/fee_pay_tx_validator.go b/x/feepay/helpers/fee_pay_tx_validator.go index ff7151ca6..85e1d3ecf 100644 --- a/x/feepay/helpers/fee_pay_tx_validator.go +++ b/x/feepay/helpers/fee_pay_tx_validator.go @@ -7,7 +7,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - feepaykeeper "github.com/CosmosContracts/juno/v30/x/feepay/keeper" + feepaykeeper "github.com/CosmosContracts/juno/v31/x/feepay/keeper" ) // IsValidFeePayTransaction checks if a transaction should be processed as a FeePay transaction. diff --git a/x/feepay/helpers/fee_pay_tx_validator_test.go b/x/feepay/helpers/fee_pay_tx_validator_test.go index ec56df7bc..309e8ba17 100644 --- a/x/feepay/helpers/fee_pay_tx_validator_test.go +++ b/x/feepay/helpers/fee_pay_tx_validator_test.go @@ -9,9 +9,9 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/testutil" - "github.com/CosmosContracts/juno/v30/x/feepay/helpers" - "github.com/CosmosContracts/juno/v30/x/feepay/types" + "github.com/CosmosContracts/juno/v31/testutil" + "github.com/CosmosContracts/juno/v31/x/feepay/helpers" + "github.com/CosmosContracts/juno/v31/x/feepay/types" ) type HelpersTestSuite struct { diff --git a/x/feepay/keeper/feepay.go b/x/feepay/keeper/feepay.go index daee510ef..240943cf4 100644 --- a/x/feepay/keeper/feepay.go +++ b/x/feepay/keeper/feepay.go @@ -13,8 +13,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/CosmosContracts/juno/v30/app/utils" - "github.com/CosmosContracts/juno/v30/x/feepay/types" + "github.com/CosmosContracts/juno/v31/app/utils" + "github.com/CosmosContracts/juno/v31/x/feepay/types" ) // IsContractRegistered checks if a contract is registered as a feepay contract @@ -96,6 +96,48 @@ func (k Keeper) GetAllContracts(ctx context.Context) []types.FeePayContract { return contracts } +// GetAllWalletUsages returns every persisted wallet usage counter in store-key +// order so exported genesis is deterministic. +func (k Keeper) GetAllWalletUsages(ctx context.Context) []types.FeePayWalletUsage { + usages := []types.FeePayWalletUsage{} + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + iterator := storetypes.KVStorePrefixIterator(store, StoreKeyContractUses) + defer iterator.Close() //nolint:errcheck + + for ; iterator.Valid(); iterator.Next() { + var usage types.FeePayWalletUsage + k.cdc.MustUnmarshal(iterator.Value(), &usage) + usages = append(usages, usage) + } + return usages +} + +// SetWalletUsage restores one validated wallet usage entry from genesis. +func (k Keeper) SetWalletUsage(ctx context.Context, usage types.FeePayWalletUsage) { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + contractUsesPrefix := prefix.NewStore(store, StoreKeyContractUses) + key := []byte(usage.ContractAddress + "-" + usage.WalletAddress) + contractUsesPrefix.Set(key, k.cdc.MustMarshal(&usage)) +} + +// HasOutstandingBalances reports whether changing the configured fee denom +// would reinterpret any existing denomination-less FeePay liability. +func (k Keeper) HasOutstandingBalances(ctx sdk.Context) bool { + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + iterator := storetypes.KVStorePrefixIterator(store, StoreKeyContracts) + defer iterator.Close() //nolint:errcheck + + for ; iterator.Valid(); iterator.Next() { + var contract types.FeePayContract + k.cdc.MustUnmarshal(iterator.Value(), &contract) + if contract.Balance != 0 { + return true + } + } + + return false +} + // RegisterContract registers a contract in the KV store func (k Keeper) RegisterContract(ctx context.Context, rfp *types.MsgRegisterFeePayContract) error { _, err := sdk.AccAddressFromBech32(rfp.SenderAddress) @@ -174,21 +216,13 @@ func (k Keeper) UnregisterContract(ctx context.Context, rfp *types.MsgUnregister return err } - // Remove contract from KV store - store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) - prefixStore := prefix.NewStore(store, StoreKeyContracts) - prefixStore.Delete([]byte(rfp.ContractAddress)) - - // Remove all usage entries for contract - prefixStore = prefix.NewStore(store, StoreKeyContractUses) - iterator := storetypes.KVStorePrefixIterator(prefixStore, []byte(rfp.ContractAddress)) - - for ; iterator.Valid(); iterator.Next() { - store.Delete(iterator.Key()) + feeDenom, err := k.feeDenom(ctx) + if err != nil { + return err } // Calculate coins to refund - coins := sdk.NewCoins(sdk.NewCoin(k.bondDenom, math.NewIntFromUint64(contract.Balance))) + coins := sdk.NewCoins(sdk.NewCoin(feeDenom, math.NewIntFromUint64(contract.Balance))) // Default refund address to admin, fallback to creator var refundAddr string @@ -197,9 +231,33 @@ func (k Keeper) UnregisterContract(ctx context.Context, rfp *types.MsgUnregister } else { refundAddr = contractInfo.Creator } + refundAccount, err := sdk.AccAddressFromBech32(refundAddr) + if err != nil { + return err + } + + // Complete every fallible operation before deleting the contract ledger and + // usage state. This keeps direct keeper calls atomic on refund failure, not + // only calls wrapped by BaseApp's transaction cache. + if err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, refundAccount, coins); err != nil { + return err + } + + // Remove contract from KV store + store := runtime.KVStoreAdapter(k.storeService.OpenKVStore(ctx)) + prefixStore := prefix.NewStore(store, StoreKeyContracts) + prefixStore.Delete([]byte(rfp.ContractAddress)) + + // Remove all usage entries for contract + prefixStore = prefix.NewStore(store, StoreKeyContractUses) + iterator := storetypes.KVStorePrefixIterator(prefixStore, []byte(rfp.ContractAddress)) + defer iterator.Close() //nolint:errcheck + + for ; iterator.Valid(); iterator.Next() { + prefixStore.Delete(iterator.Key()) + } - // Send coins from the FeePay module to the refund address - return k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, sdk.MustAccAddressFromBech32(refundAddr), coins) + return nil } // SetContractBalance sets the contract's balance in the KV store @@ -215,29 +273,36 @@ func (k Keeper) SetContractBalance(ctx context.Context, fpc *types.FeePayContrac // FundContract funds an existing feepay contract with tokens func (k Keeper) FundContract(ctx context.Context, fpc *types.FeePayContract, senderAddr sdk.AccAddress, coins sdk.Coins) error { - // Only transfer the bond denom + feeDenom, err := k.feeDenom(ctx) + if err != nil { + return err + } + + // Only transfer the configured fee denom. var transferCoin sdk.Coin for _, c := range coins { - if c.Denom == k.bondDenom { + if c.Denom == feeDenom { transferCoin = c } } // Ensure the transfer coin was set if transferCoin == (sdk.Coin{}) { - return types.ErrInvalidJunoFundAmount.Wrapf("contract must be funded with '%s'", k.bondDenom) + return types.ErrInvalidJunoFundAmount.Wrapf("contract must be funded with '%s'", feeDenom) + } + + newBalance, err := types.ContractBalanceAfterAddition(fpc.Balance, transferCoin.Amount) + if err != nil { + return err } - // Transfer ONLY the bond-denom coin from sender to module. Transferring - // the whole `coins` slice would pull non-bond denoms into the module - // account while crediting the contract only for the bond-denom amount — - // stranding the rest. + // Complete all validation before transferring bank funds. A rejected + // amount must not move coins without a matching uint64 ledger credit. if err := k.bankKeeper.SendCoinsFromAccountToModule(ctx, senderAddr, types.ModuleName, sdk.NewCoins(transferCoin)); err != nil { return err } - // Increment the fpc balance - k.SetContractBalance(ctx, fpc, fpc.Balance+transferCoin.Amount.Uint64()) + k.SetContractBalance(ctx, fpc, newBalance) return nil } diff --git a/x/feepay/keeper/genesis.go b/x/feepay/keeper/genesis.go index 491d2cdd4..6878170ca 100644 --- a/x/feepay/keeper/genesis.go +++ b/x/feepay/keeper/genesis.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/CosmosContracts/juno/v30/x/feepay/types" + "github.com/CosmosContracts/juno/v31/x/feepay/types" ) // InitGenesis import module genesis @@ -26,17 +26,23 @@ func (k Keeper) InitGenesis( // the module account cannot cover a "funded" contract's fee. totalBalances := math.ZeroInt() for _, feepay := range data.FeePayContracts { - // TODO: future, add all wallet interactions for exports? k.SetFeePayContract(ctx, feepay) totalBalances = totalBalances.Add(math.NewIntFromUint64(feepay.Balance)) } + for _, usage := range data.WalletUsages { + k.SetWalletUsage(ctx, usage) + } + feeDenom, err := k.feeDenom(ctx) + if err != nil { + panic(err) + } moduleAddr := authtypes.NewModuleAddress(types.ModuleName) - moduleBalance := k.bankKeeper.GetBalance(ctx, moduleAddr, k.bondDenom).Amount + moduleBalance := k.bankKeeper.GetBalance(ctx, moduleAddr, feeDenom).Amount if totalBalances.GT(moduleBalance) { panic(fmt.Sprintf( "feepay genesis: sum of imported contract balances (%s%s) exceeds feepay module account balance (%s%s)", - totalBalances, k.bondDenom, moduleBalance, k.bondDenom, + totalBalances, feeDenom, moduleBalance, feeDenom, )) } } @@ -45,9 +51,11 @@ func (k Keeper) InitGenesis( func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState { params := k.GetParams(ctx) contracts := k.GetAllContracts(ctx) + usages := k.GetAllWalletUsages(ctx) return &types.GenesisState{ Params: params, FeePayContracts: contracts, + WalletUsages: usages, } } diff --git a/x/feepay/keeper/genesis_test.go b/x/feepay/keeper/genesis_test.go index 45fdef453..07dce735b 100644 --- a/x/feepay/keeper/genesis_test.go +++ b/x/feepay/keeper/genesis_test.go @@ -2,10 +2,13 @@ package keeper_test import ( "fmt" + "math" + + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/feepay/types" + "github.com/CosmosContracts/juno/v31/x/feepay/types" ) func (s *KeeperTestSuite) TestFeeShareInitGenesis() { @@ -68,7 +71,7 @@ func (s *KeeperTestSuite) TestInitGenesisBalanceValidation() { s.Run("funded module account imports cleanly", func() { s.SetupTest() // reset - s.FundModuleAcc(types.ModuleName, sdk.NewCoins(sdk.NewInt64Coin("ujuno", 1_000_000))) + s.FundModuleAcc(types.ModuleName, sdk.NewCoins(sdk.NewInt64Coin("stake", 1_000_000))) s.Require().NotPanics(func() { s.App.AppKeepers.FeePayKeeper.InitGenesis(s.Ctx, genesisWithBalance) @@ -79,3 +82,54 @@ func (s *KeeperTestSuite) TestInitGenesisBalanceValidation() { s.Require().Equal(uint64(1_000_000), contract.Balance) }) } + +func (s *KeeperTestSuite) TestInitGenesisSupportsMaxUint64Balance() { + s.SetupTest() + contractAddr := sdk.AccAddress([]byte("12345678901234567890")).String() + maxAmount := sdkmath.NewIntFromUint64(math.MaxUint64) + s.FundModuleAcc(types.ModuleName, sdk.NewCoins(sdk.NewCoin("stake", maxAmount))) + genesis := types.GenesisState{ + Params: types.DefaultParams(), + FeePayContracts: []types.FeePayContract{{ + ContractAddress: contractAddr, + Balance: math.MaxUint64, + }}, + } + + s.Require().NotPanics(func() { + s.App.AppKeepers.FeePayKeeper.InitGenesis(s.Ctx, genesis) + }) + contract, err := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contractAddr) + s.Require().NoError(err) + s.Require().Equal(uint64(math.MaxUint64), contract.Balance) + moduleAddr := s.App.AppKeepers.AccountKeeper.GetModuleAddress(types.ModuleName) + s.Require().Equal(maxAmount, s.bankKeeper.GetBalance(s.Ctx, moduleAddr, "stake").Amount) +} + +func (s *KeeperTestSuite) TestFeePayGenesisRoundTripPreservesWalletUsage() { + contractAddr := "juno1qsrercqegvs4ye0yqg93knv73ye5dc3prqwd6jcdcuj8ggp6w0us66deup" + walletAddr := "juno1p30mp2fh2p6603h9mkxc8alw6wplss72dfd385" + contract := types.FeePayContract{ + ContractAddress: contractAddr, + Balance: 1_000_000, + WalletLimit: 10, + } + + s.App.AppKeepers.FeePayKeeper.SetFeePayContract(s.Ctx, contract) + s.Require().NoError(s.App.AppKeepers.FeePayKeeper.IncrementContractUses(s.Ctx, &contract, walletAddr, 3)) + exported := s.App.AppKeepers.FeePayKeeper.ExportGenesis(s.Ctx) + s.Require().Equal([]types.FeePayWalletUsage{{ + ContractAddress: contractAddr, + WalletAddress: walletAddr, + Uses: 3, + }}, exported.WalletUsages) + + s.SetupTest() + s.FundModuleAcc(types.ModuleName, sdk.NewCoins(sdk.NewInt64Coin("stake", 1_000_000))) + s.App.AppKeepers.FeePayKeeper.InitGenesis(s.Ctx, *exported) + restored, err := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contractAddr) + s.Require().NoError(err) + uses, err := s.App.AppKeepers.FeePayKeeper.GetContractUses(s.Ctx, restored, walletAddr) + s.Require().NoError(err) + s.Require().Equal(uint64(3), uses) +} diff --git a/x/feepay/keeper/grpc_query.go b/x/feepay/keeper/grpc_query.go index efb7f5913..6ef6db330 100644 --- a/x/feepay/keeper/grpc_query.go +++ b/x/feepay/keeper/grpc_query.go @@ -5,8 +5,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - globalerrors "github.com/CosmosContracts/juno/v30/app/utils" - "github.com/CosmosContracts/juno/v30/x/feepay/types" + globalerrors "github.com/CosmosContracts/juno/v31/app/utils" + "github.com/CosmosContracts/juno/v31/x/feepay/types" ) var _ types.QueryServer = queryServer{} diff --git a/x/feepay/keeper/grpc_query_test.go b/x/feepay/keeper/grpc_query_test.go index 80834ba71..20d0f8e5b 100644 --- a/x/feepay/keeper/grpc_query_test.go +++ b/x/feepay/keeper/grpc_query_test.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/CosmosContracts/juno/v30/testutil/common/nullify" - "github.com/CosmosContracts/juno/v30/x/feepay/types" + "github.com/CosmosContracts/juno/v31/testutil/common/nullify" + "github.com/CosmosContracts/juno/v31/x/feepay/types" ) func (s *KeeperTestSuite) TestQueryContract() { @@ -151,7 +151,9 @@ func (s *KeeperTestSuite) TestQueryContracts() { func (s *KeeperTestSuite) TestQueryEligibility() { // Get & fund creator _, _, sender := testdata.KeyTestPubAddr() - s.FundAcc(sender, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(1_000_000)), sdk.NewCoin("ujuno", sdkmath.NewInt(100_000_000)))) + // Contract instantiation consumes one stake, so fund beyond the exact + // FeePay deposit to keep this fixture focused on eligibility behavior. + s.FundAcc(sender, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(2_000_000)), sdk.NewCoin("ujuno", sdkmath.NewInt(100_000_000)))) // Instantiate the contractAddr contractAddr := s.InstantiateContract(sender.String(), "", wasmContract) @@ -175,7 +177,7 @@ func (s *KeeperTestSuite) TestQueryEligibility() { _, err := s.msgServer.FundFeePayContract(s.Ctx, &types.MsgFundFeePayContract{ SenderAddress: sender.String(), ContractAddress: contractAddr, - Amount: sdk.NewCoins(sdk.NewCoin("ujuno", sdkmath.NewInt(1_000_000))), + Amount: sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(1_000_000))), }) s.Require().NoError(err) diff --git a/x/feepay/keeper/keeper.go b/x/feepay/keeper/keeper.go index 78ae9edac..5c2dd7b57 100644 --- a/x/feepay/keeper/keeper.go +++ b/x/feepay/keeper/keeper.go @@ -14,7 +14,8 @@ import ( authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - feepaytypes "github.com/CosmosContracts/juno/v30/x/feepay/types" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + feepaytypes "github.com/CosmosContracts/juno/v31/x/feepay/types" ) var ( @@ -32,13 +33,18 @@ type Keeper struct { wasmKeeper wasmkeeper.Keeper accountKeeper authkeeper.AccountKeeper - bondDenom string + feeMarketKeeper FeeMarketKeeper // the address capable of executing a MsgUpdateParams message. Typically, this // should be the x/gov module account. authority string } +// FeeMarketKeeper provides the denomination backing FeePay balances. +type FeeMarketKeeper interface { + GetParams(ctx sdk.Context) (feemarkettypes.Params, error) +} + // NewKeeper creates new instances of the fees Keeper func NewKeeper( cdc codec.BinaryCodec, @@ -46,17 +52,17 @@ func NewKeeper( bk bankkeeper.Keeper, wk wasmkeeper.Keeper, ak authkeeper.AccountKeeper, - bondDenom string, + fmk FeeMarketKeeper, authority string, ) Keeper { return Keeper{ - cdc: cdc, - storeService: ss, - bankKeeper: bk, - wasmKeeper: wk, - accountKeeper: ak, - bondDenom: bondDenom, - authority: authority, + cdc: cdc, + storeService: ss, + bankKeeper: bk, + wasmKeeper: wk, + accountKeeper: ak, + feeMarketKeeper: fmk, + authority: authority, } } @@ -70,3 +76,12 @@ func (Keeper) Logger(ctx context.Context) log.Logger { sdkCtx := sdk.UnwrapSDKContext(ctx) return sdkCtx.Logger().With("module", fmt.Sprintf("x/%s", feepaytypes.ModuleName)) } + +func (k Keeper) feeDenom(ctx context.Context) (string, error) { + params, err := k.feeMarketKeeper.GetParams(sdk.UnwrapSDKContext(ctx)) + if err != nil { + return "", err + } + + return params.FeeDenom, nil +} diff --git a/x/feepay/keeper/keeper_test.go b/x/feepay/keeper/keeper_test.go index 13a9ab506..fdfaeaaad 100644 --- a/x/feepay/keeper/keeper_test.go +++ b/x/feepay/keeper/keeper_test.go @@ -11,9 +11,9 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - "github.com/CosmosContracts/juno/v30/testutil" - "github.com/CosmosContracts/juno/v30/x/feepay/keeper" - "github.com/CosmosContracts/juno/v30/x/feepay/types" + "github.com/CosmosContracts/juno/v31/testutil" + "github.com/CosmosContracts/juno/v31/x/feepay/keeper" + "github.com/CosmosContracts/juno/v31/x/feepay/types" ) type KeeperTestSuite struct { diff --git a/x/feepay/keeper/msg_server.go b/x/feepay/keeper/msg_server.go index 26bc607db..e96e57860 100644 --- a/x/feepay/keeper/msg_server.go +++ b/x/feepay/keeper/msg_server.go @@ -8,8 +8,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - globalerrors "github.com/CosmosContracts/juno/v30/app/utils" - "github.com/CosmosContracts/juno/v30/x/feepay/types" + globalerrors "github.com/CosmosContracts/juno/v31/app/utils" + "github.com/CosmosContracts/juno/v31/x/feepay/types" ) var _ types.MsgServer = &msgServer{} diff --git a/x/feepay/keeper/msg_server_test.go b/x/feepay/keeper/msg_server_test.go index bab37b2a5..0358079bf 100644 --- a/x/feepay/keeper/msg_server_test.go +++ b/x/feepay/keeper/msg_server_test.go @@ -1,6 +1,8 @@ package keeper_test import ( + "math" + _ "embed" sdkmath "cosmossdk.io/math" @@ -9,7 +11,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" // govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/CosmosContracts/juno/v30/x/feepay/types" + "github.com/CosmosContracts/juno/v31/x/feepay/types" ) func (s *KeeperTestSuite) TestRegisterFeePayContract() { @@ -155,11 +157,46 @@ func (s *KeeperTestSuite) TestUnregisterFeePayContract() { } } +func (s *KeeperTestSuite) TestUnregisterFeePayContractPreservesStateWhenRefundFails() { + s.SetupTest() + _, _, sender := testdata.KeyTestPubAddr() + s.FundAcc(sender, sdk.NewCoins(sdk.NewInt64Coin("stake", 1_000_000))) + + contractAddr := s.InstantiateContract(sender.String(), "", wasmContract) + params, err := s.App.AppKeepers.FeeMarketKeeper.GetParams(s.Ctx) + s.Require().NoError(err) + params.FeeDenom = "urefund" + s.Require().NoError(s.App.AppKeepers.FeeMarketKeeper.SetParams(s.Ctx, params)) + + s.registerFeePayContract(sender.String(), contractAddr, 0, 3) + contract, err := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contractAddr) + s.Require().NoError(err) + s.App.AppKeepers.FeePayKeeper.SetContractBalance(s.Ctx, contract, 100) + s.Require().Equal(uint64(100), contract.Balance) + s.Require().True(s.bankKeeper.GetBalance(s.Ctx, s.App.AppKeepers.AccountKeeper.GetModuleAddress(types.ModuleName), "urefund").IsZero()) + s.Require().NoError(s.App.AppKeepers.FeePayKeeper.IncrementContractUses(s.Ctx, contract, sender.String(), 2)) + + _, err = s.msgServer.UnregisterFeePayContract(s.Ctx, &types.MsgUnregisterFeePayContract{ + SenderAddress: sender.String(), + ContractAddress: contractAddr, + }) + s.Require().Error(err) + + preserved, err := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contractAddr) + s.Require().NoError(err) + s.Require().Equal(uint64(100), preserved.Balance) + uses, err := s.App.AppKeepers.FeePayKeeper.GetContractUses(s.Ctx, preserved, sender.String()) + s.Require().NoError(err) + s.Require().Equal(uint64(2), uses) +} + func (s *KeeperTestSuite) TestFundFeePayContract() { s.SetupTest() _, _, sender := testdata.KeyTestPubAddr() _, _, admin := testdata.KeyTestPubAddr() - s.FundAcc(sender, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(1_000_000)), sdk.NewCoin("ujuno", sdkmath.NewInt(100_000_000)))) + // Contract instantiation consumes one stake, so fund beyond the exact + // FeePay deposit to keep this fixture focused on denomination handling. + s.FundAcc(sender, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(2_000_000)), sdk.NewCoin("ujuno", sdkmath.NewInt(100_000_000)))) s.FundAcc(admin, sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(1_000_000)))) contract := s.InstantiateContract(sender.String(), "", wasmContract) @@ -198,14 +235,14 @@ func (s *KeeperTestSuite) TestFundFeePayContract() { desc: "Fail - Wallet Not Enough Funds", contractAddress: contract, senderAddress: sender.String(), - amount: sdk.NewCoins(sdk.NewCoin("ujuno", sdkmath.NewInt(100_000_000_000))), + amount: sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100_000_000_000))), shouldErr: true, }, { desc: "Success - Contract Funded", contractAddress: contract, senderAddress: sender.String(), - amount: sdk.NewCoins(sdk.NewCoin("ujuno", sdkmath.NewInt(1_000_000))), + amount: sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(1_000_000))), shouldErr: false, }, } { @@ -225,6 +262,115 @@ func (s *KeeperTestSuite) TestFundFeePayContract() { } } +func (s *KeeperTestSuite) TestConfiguredFeeDenomFundingAndUnregisterRefund() { + s.SetupTest() + _, _, sender := testdata.KeyTestPubAddr() + const feeDenom = "ufee" + const amount = int64(1_000_000) + + params, err := s.App.AppKeepers.FeeMarketKeeper.GetParams(s.Ctx) + s.Require().NoError(err) + params.FeeDenom = feeDenom + s.Require().NoError(s.App.AppKeepers.FeeMarketKeeper.SetParams(s.Ctx, params)) + + s.FundAcc(sender, sdk.NewCoins( + sdk.NewInt64Coin("stake", 1_000_000), + sdk.NewInt64Coin(feeDenom, amount), + )) + contract := s.InstantiateContract(sender.String(), "", wasmContract) + s.registerFeePayContract(sender.String(), contract, 0, 1) + + _, err = s.msgServer.FundFeePayContract(s.Ctx, &types.MsgFundFeePayContract{ + SenderAddress: sender.String(), + ContractAddress: contract, + Amount: sdk.NewCoins(sdk.NewInt64Coin(feeDenom, amount)), + }) + s.Require().NoError(err) + + moduleAddr := s.App.AppKeepers.AccountKeeper.GetModuleAddress(types.ModuleName) + s.Require().Equal(sdkmath.NewInt(amount), s.bankKeeper.GetBalance(s.Ctx, moduleAddr, feeDenom).Amount) + funded, err := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contract) + s.Require().NoError(err) + s.Require().Equal(uint64(amount), funded.Balance) + + beforeRefund := s.bankKeeper.GetBalance(s.Ctx, sender, feeDenom).Amount + _, err = s.msgServer.UnregisterFeePayContract(s.Ctx, &types.MsgUnregisterFeePayContract{ + SenderAddress: sender.String(), + ContractAddress: contract, + }) + s.Require().NoError(err) + s.Require().Equal(beforeRefund.AddRaw(amount), s.bankKeeper.GetBalance(s.Ctx, sender, feeDenom).Amount) + s.Require().True(s.bankKeeper.GetBalance(s.Ctx, moduleAddr, feeDenom).IsZero()) +} + +func (s *KeeperTestSuite) TestFundFeePayContractRejectsUint64OverflowAtomically() { + s.SetupTest() + _, _, sender := testdata.KeyTestPubAddr() + contractAddr := sdk.AccAddress([]byte("12345678901234567890")).String() + moduleAddr := s.App.AppKeepers.AccountKeeper.GetModuleAddress(types.ModuleName) + + s.App.AppKeepers.FeePayKeeper.SetFeePayContract(s.Ctx, types.FeePayContract{ + ContractAddress: contractAddr, + Balance: math.MaxUint64 - 1, + }) + s.FundAcc(sender, sdk.NewCoins(sdk.NewInt64Coin("stake", 2))) + beforeSender := s.bankKeeper.GetBalance(s.Ctx, sender, "stake").Amount + beforeModule := s.bankKeeper.GetBalance(s.Ctx, moduleAddr, "stake").Amount + + _, err := s.msgServer.FundFeePayContract(s.Ctx, &types.MsgFundFeePayContract{ + SenderAddress: sender.String(), ContractAddress: contractAddr, + Amount: sdk.NewCoins(sdk.NewInt64Coin("stake", 2)), + }) + s.Require().ErrorIs(err, types.ErrFeePayBalanceOverflow) + + contract, getErr := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contractAddr) + s.Require().NoError(getErr) + s.Require().Equal(uint64(math.MaxUint64-1), contract.Balance) + s.Require().Equal(beforeSender, s.bankKeeper.GetBalance(s.Ctx, sender, "stake").Amount) + s.Require().Equal(beforeModule, s.bankKeeper.GetBalance(s.Ctx, moduleAddr, "stake").Amount) +} + +func (s *KeeperTestSuite) TestFundFeePayContractRejectsAmountAboveUint64Atomically() { + s.SetupTest() + _, _, sender := testdata.KeyTestPubAddr() + contractAddr := sdk.AccAddress([]byte("12345678901234567890")).String() + s.App.AppKeepers.FeePayKeeper.SetFeePayContract(s.Ctx, types.FeePayContract{ContractAddress: contractAddr}) + aboveMax := sdkmath.NewIntFromUint64(math.MaxUint64).AddRaw(1) + moduleAddr := s.App.AppKeepers.AccountKeeper.GetModuleAddress(types.ModuleName) + + _, err := s.msgServer.FundFeePayContract(s.Ctx, &types.MsgFundFeePayContract{ + SenderAddress: sender.String(), ContractAddress: contractAddr, + Amount: sdk.NewCoins(sdk.NewCoin("stake", aboveMax)), + }) + s.Require().ErrorIs(err, types.ErrFeePayAmountOutOfRange) + + contract, getErr := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contractAddr) + s.Require().NoError(getErr) + s.Require().Zero(contract.Balance) + s.Require().True(s.bankKeeper.GetBalance(s.Ctx, moduleAddr, "stake").IsZero()) +} + +func (s *KeeperTestSuite) TestFundFeePayContractSupportsMaxUint64AndPreservesBacking() { + s.SetupTest() + _, _, sender := testdata.KeyTestPubAddr() + contractAddr := sdk.AccAddress([]byte("12345678901234567890")).String() + s.App.AppKeepers.FeePayKeeper.SetFeePayContract(s.Ctx, types.FeePayContract{ContractAddress: contractAddr}) + maxAmount := sdkmath.NewIntFromUint64(math.MaxUint64) + s.FundAcc(sender, sdk.NewCoins(sdk.NewCoin("stake", maxAmount))) + + _, err := s.msgServer.FundFeePayContract(s.Ctx, &types.MsgFundFeePayContract{ + SenderAddress: sender.String(), ContractAddress: contractAddr, + Amount: sdk.NewCoins(sdk.NewCoin("stake", maxAmount)), + }) + s.Require().NoError(err) + + contract, getErr := s.App.AppKeepers.FeePayKeeper.GetContract(s.Ctx, contractAddr) + s.Require().NoError(getErr) + s.Require().Equal(uint64(math.MaxUint64), contract.Balance) + moduleAddr := s.App.AppKeepers.AccountKeeper.GetModuleAddress(types.ModuleName) + s.Require().Equal(maxAmount, s.bankKeeper.GetBalance(s.Ctx, moduleAddr, "stake").Amount) +} + func (s *KeeperTestSuite) TestUpdateFeePayContractWalletLimit() { s.SetupTest() _, _, sender := testdata.KeyTestPubAddr() diff --git a/x/feepay/keeper/params.go b/x/feepay/keeper/params.go index cf2a81478..faedf2614 100644 --- a/x/feepay/keeper/params.go +++ b/x/feepay/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/CosmosContracts/juno/v30/x/feepay/types" + "github.com/CosmosContracts/juno/v31/x/feepay/types" ) // SetParams sets the x/feepay module parameters. diff --git a/x/feepay/module/autocli.go b/x/feepay/module/autocli.go index c3e6ead61..d788d0f99 100644 --- a/x/feepay/module/autocli.go +++ b/x/feepay/module/autocli.go @@ -3,7 +3,7 @@ package module import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - feepayv1 "github.com/CosmosContracts/juno/v30/api/juno/feepay/v1" + feepayv1 "github.com/CosmosContracts/juno/v31/api/juno/feepay/v1" ) // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. diff --git a/x/feepay/module/module.go b/x/feepay/module/module.go index 40033f864..7aa6bd092 100644 --- a/x/feepay/module/module.go +++ b/x/feepay/module/module.go @@ -17,8 +17,8 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - "github.com/CosmosContracts/juno/v30/x/feepay/keeper" - "github.com/CosmosContracts/juno/v30/x/feepay/types" + "github.com/CosmosContracts/juno/v31/x/feepay/keeper" + "github.com/CosmosContracts/juno/v31/x/feepay/types" ) // type check to ensure the interface is properly implemented diff --git a/x/feepay/spec/02_state.md b/x/feepay/spec/02_state.md index 2263a1ecf..282937531 100644 --- a/x/feepay/spec/02_state.md +++ b/x/feepay/spec/02_state.md @@ -36,7 +36,7 @@ message FeePayWalletUsage { ## Genesis & Params -The `x/feepay` module's `GenesisState` defines the state necessary for initializing the chain from a previously exported height. It contains the module parameters and the fee pay contracts. As of now, it does not contain the wallet usage. The params are used to enable or disable the module. This value can be modified with a governance proposal. +The `x/feepay` module's `GenesisState` defines the state necessary for initializing the chain from a previously exported height. It contains the module parameters, fee pay contracts, and per-contract wallet usage counters. Exporting and importing these counters preserves wallet-limit enforcement across a restart. During initialization, the sum of contract ledger balances must not exceed the module account's balance in the configured fee denom. The params are used to enable or disable the module. This value can be modified with a governance proposal. ```go // GenesisState defines the module's genesis state. @@ -46,6 +46,9 @@ message GenesisState { // fee_pay_contracts are the feepay module contracts repeated FeePayContract fee_pay_contracts = 2 [ (gogoproto.nullable) = false ]; + + // wallet_usages are the per-contract wallet counters that enforce wallet limits + repeated FeePayWalletUsage wallet_usages = 3 [ (gogoproto.nullable) = false ]; } // Params defines the feepay module params diff --git a/x/feepay/types/accounting.go b/x/feepay/types/accounting.go new file mode 100644 index 000000000..20504104f --- /dev/null +++ b/x/feepay/types/accounting.go @@ -0,0 +1,41 @@ +package types + +import ( + "math" + + sdkmath "cosmossdk.io/math" +) + +// MaxFeePayContractBalance is the largest amount representable by the +// consensus FeePay contract balance field. +const MaxFeePayContractBalance = uint64(math.MaxUint64) + +// ContractBalanceAfterAddition converts amount without truncation and returns +// the resulting balance only when it fits the FeePay uint64 ledger. +func ContractBalanceAfterAddition(balance uint64, amount sdkmath.Int) (uint64, error) { + if !amount.BigInt().IsUint64() { + return 0, ErrFeePayAmountOutOfRange.Wrapf("amount %s is outside uint64 range", amount) + } + + addition := amount.Uint64() + if addition > MaxFeePayContractBalance-balance { + return 0, ErrFeePayBalanceOverflow.Wrapf("balance %d plus amount %s exceeds %d", balance, amount, MaxFeePayContractBalance) + } + + return balance + addition, nil +} + +// ContractBalanceAfterSubtraction converts amount without truncation and +// returns the resulting balance only when the ledger has sufficient funds. +func ContractBalanceAfterSubtraction(balance uint64, amount sdkmath.Int) (uint64, error) { + if !amount.BigInt().IsUint64() { + return 0, ErrFeePayAmountOutOfRange.Wrapf("amount %s is outside uint64 range", amount) + } + + deduction := amount.Uint64() + if deduction > balance { + return 0, ErrContractNotEnoughFunds.Wrapf("expected: %s, got: %d", amount, balance) + } + + return balance - deduction, nil +} diff --git a/x/feepay/types/accounting_test.go b/x/feepay/types/accounting_test.go new file mode 100644 index 000000000..6b4457efb --- /dev/null +++ b/x/feepay/types/accounting_test.go @@ -0,0 +1,37 @@ +package types_test + +import ( + "math" + "testing" + + "github.com/stretchr/testify/require" + + sdkmath "cosmossdk.io/math" + + "github.com/CosmosContracts/juno/v31/x/feepay/types" +) + +func TestContractBalanceBoundaries(t *testing.T) { + maxAmount := sdkmath.NewIntFromUint64(math.MaxUint64) + aboveMax := maxAmount.AddRaw(1) + + got, err := types.ContractBalanceAfterAddition(0, maxAmount) + require.NoError(t, err) + require.Equal(t, uint64(math.MaxUint64), got) + + _, err = types.ContractBalanceAfterAddition(0, aboveMax) + require.ErrorIs(t, err, types.ErrFeePayAmountOutOfRange) + + _, err = types.ContractBalanceAfterAddition(math.MaxUint64, sdkmath.OneInt()) + require.ErrorIs(t, err, types.ErrFeePayBalanceOverflow) + + got, err = types.ContractBalanceAfterSubtraction(math.MaxUint64, maxAmount) + require.NoError(t, err) + require.Zero(t, got) + + _, err = types.ContractBalanceAfterSubtraction(math.MaxUint64, aboveMax) + require.ErrorIs(t, err, types.ErrFeePayAmountOutOfRange) + + _, err = types.ContractBalanceAfterSubtraction(0, sdkmath.OneInt()) + require.ErrorIs(t, err, types.ErrContractNotEnoughFunds) +} diff --git a/x/feepay/types/errors.go b/x/feepay/types/errors.go index d323afb9d..eb48bec40 100644 --- a/x/feepay/types/errors.go +++ b/x/feepay/types/errors.go @@ -11,4 +11,6 @@ var ( ErrInvalidJunoFundAmount = errorsmod.Register(ModuleName, 4, "fee pay contracts only accept juno funds") ErrFeePayDisabled = errorsmod.Register(ModuleName, 5, "the FeePay module is disabled") ErrDeductFees = errorsmod.Register(ModuleName, 6, "error deducting fees") + ErrFeePayAmountOutOfRange = errorsmod.Register(ModuleName, 7, "fee pay amount is outside uint64 range") + ErrFeePayBalanceOverflow = errorsmod.Register(ModuleName, 8, "fee pay contract balance overflow") ) diff --git a/x/feepay/types/genesis.go b/x/feepay/types/genesis.go index 249984c99..1271d2586 100644 --- a/x/feepay/types/genesis.go +++ b/x/feepay/types/genesis.go @@ -1,12 +1,24 @@ package types -import sdk "github.com/cosmos/cosmos-sdk/types" +import ( + "errors" + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var ( + errDuplicateFeePayContract = errors.New("duplicate feepay contract") + errUnregisteredUsageContract = errors.New("wallet usage references unregistered feepay contract") + errDuplicateWalletUsage = errors.New("duplicate wallet usage for contract") +) // NewGenesisState creates a new genesis state. func NewGenesisState(params Params, feePayContracts []FeePayContract) GenesisState { return GenesisState{ Params: params, FeePayContracts: feePayContracts, + WalletUsages: []FeePayWalletUsage{}, } } @@ -18,18 +30,42 @@ func DefaultGenesisState() *GenesisState { EnableFeepay: true, }, FeePayContracts: []FeePayContract{}, + WalletUsages: []FeePayWalletUsage{}, } } // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { + contracts := make(map[string]struct{}, len(gs.FeePayContracts)) // Loop through all fee pay contracts and validate they // have a valid bech32 address for _, contract := range gs.FeePayContracts { if _, err := sdk.AccAddressFromBech32(contract.ContractAddress); err != nil { return err } + if _, exists := contracts[contract.ContractAddress]; exists { + return fmt.Errorf("%w %s", errDuplicateFeePayContract, contract.ContractAddress) + } + contracts[contract.ContractAddress] = struct{}{} + } + + seenUsages := make(map[string]struct{}, len(gs.WalletUsages)) + for _, usage := range gs.WalletUsages { + if _, err := sdk.AccAddressFromBech32(usage.ContractAddress); err != nil { + return err + } + if _, err := sdk.AccAddressFromBech32(usage.WalletAddress); err != nil { + return err + } + if _, exists := contracts[usage.ContractAddress]; !exists { + return fmt.Errorf("%w %s", errUnregisteredUsageContract, usage.ContractAddress) + } + key := usage.ContractAddress + "\x00" + usage.WalletAddress + if _, exists := seenUsages[key]; exists { + return fmt.Errorf("%w %s and wallet %s", errDuplicateWalletUsage, usage.ContractAddress, usage.WalletAddress) + } + seenUsages[key] = struct{}{} } return nil diff --git a/x/feepay/types/genesis.pb.go b/x/feepay/types/genesis.pb.go index 4ead1b344..1e19205bf 100644 --- a/x/feepay/types/genesis.pb.go +++ b/x/feepay/types/genesis.pb.go @@ -30,6 +30,8 @@ type GenesisState struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` // fee_pay_contracts are the feepay module contracts FeePayContracts []FeePayContract `protobuf:"bytes,2,rep,name=fee_pay_contracts,json=feePayContracts,proto3" json:"fee_pay_contracts"` + // wallet_usages are the per-contract wallet counters that enforce wallet limits. + WalletUsages []FeePayWalletUsage `protobuf:"bytes,3,rep,name=wallet_usages,json=walletUsages,proto3" json:"wallet_usages"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -79,6 +81,13 @@ func (m *GenesisState) GetFeePayContracts() []FeePayContract { return nil } +func (m *GenesisState) GetWalletUsages() []FeePayWalletUsage { + if m != nil { + return m.WalletUsages + } + return nil +} + // Params defines the feepay module params type Params struct { // enable_feepay defines a parameter to enable the feepay module @@ -133,26 +142,28 @@ func init() { func init() { proto.RegisterFile("juno/feepay/v1/genesis.proto", fileDescriptor_ac1bd21601b5f553) } var fileDescriptor_ac1bd21601b5f553 = []byte{ - // 297 bytes of a gzipped FileDescriptorProto + // 335 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xc9, 0x2a, 0xcd, 0xcb, 0xd7, 0x4f, 0x4b, 0x4d, 0x2d, 0x48, 0xac, 0xd4, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x03, 0xc9, 0xea, 0x41, 0x64, 0xf5, 0xca, 0x0c, 0xa5, 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x89, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x98, 0xa9, 0x0f, 0x62, 0x41, 0x45, 0xa5, 0xd1, 0x8c, 0x85, 0x1a, 0x01, - 0x96, 0x54, 0x5a, 0xc0, 0xc8, 0xc5, 0xe3, 0x0e, 0xb1, 0x27, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0xc8, + 0x96, 0x54, 0xfa, 0xcc, 0xc8, 0xc5, 0xe3, 0x0e, 0xb1, 0x27, 0xb8, 0x24, 0xb1, 0x24, 0x55, 0xc8, 0x92, 0x8b, 0xad, 0x20, 0xb1, 0x28, 0x31, 0xb7, 0x58, 0x82, 0x51, 0x81, 0x51, 0x83, 0xdb, 0x48, 0x4c, 0x0f, 0xd5, 0x5e, 0xbd, 0x00, 0xb0, 0xac, 0x13, 0xe7, 0x89, 0x7b, 0xf2, 0x0c, 0x2b, 0x9e, 0x6f, 0xd0, 0x62, 0x0c, 0x82, 0x6a, 0x10, 0x0a, 0xe5, 0x12, 0x4c, 0x4b, 0x4d, 0x8d, 0x2f, 0x48, 0xac, 0x8c, 0x4f, 0xce, 0xcf, 0x2b, 0x29, 0x4a, 0x4c, 0x2e, 0x29, 0x96, 0x60, 0x52, 0x60, 0xd6, 0xe0, 0x36, 0x92, 0x43, 0x37, 0xc5, 0x2d, 0x35, 0x35, 0x20, 0xb1, 0xd2, 0x19, 0xaa, 0x0c, 0xd9, - 0x34, 0xfe, 0x34, 0x14, 0xa9, 0x62, 0x25, 0x63, 0x2e, 0x36, 0x88, 0x9d, 0x42, 0xca, 0x5c, 0xbc, - 0xa9, 0x79, 0x89, 0x49, 0x39, 0xa9, 0xf1, 0x10, 0x83, 0xc0, 0x4e, 0xe4, 0x08, 0xe2, 0x81, 0x08, - 0xba, 0x81, 0xc5, 0xac, 0x58, 0x5e, 0x2c, 0x90, 0x67, 0x74, 0xf2, 0x38, 0xf1, 0x48, 0x8e, 0xf1, - 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, - 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xbd, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, - 0x5c, 0x7d, 0xe7, 0xfc, 0xe2, 0xdc, 0xfc, 0x62, 0xb8, 0x55, 0xfa, 0xe0, 0x90, 0xaa, 0x80, 0x85, - 0x55, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0xa0, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x6f, 0x20, 0x5c, 0xf5, 0x9e, 0x01, 0x00, 0x00, + 0x34, 0xfe, 0x34, 0x14, 0xa9, 0x62, 0xa1, 0x40, 0x2e, 0xde, 0xf2, 0xc4, 0x9c, 0x9c, 0xd4, 0x92, + 0xf8, 0xd2, 0xe2, 0xc4, 0xf4, 0xd4, 0x62, 0x09, 0x66, 0xb0, 0x91, 0x8a, 0xd8, 0x8d, 0x0c, 0x07, + 0x2b, 0x0d, 0x05, 0xa9, 0x44, 0x36, 0x95, 0xa7, 0x1c, 0x21, 0x5e, 0xac, 0x64, 0xcc, 0xc5, 0x06, + 0xf1, 0x86, 0x90, 0x32, 0x17, 0x6f, 0x6a, 0x5e, 0x62, 0x52, 0x4e, 0x6a, 0x3c, 0xc4, 0x20, 0xb0, + 0xaf, 0x39, 0x82, 0x78, 0x20, 0x82, 0x6e, 0x60, 0x31, 0x2b, 0x96, 0x17, 0x0b, 0xe4, 0x19, 0x9d, + 0x3c, 0x4e, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, + 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, 0x58, 0x8e, 0x21, 0x4a, 0x2f, 0x3d, 0xb3, 0x24, + 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0xdf, 0x39, 0xbf, 0x38, 0x37, 0xbf, 0x18, 0xee, 0x7a, + 0x7d, 0x70, 0xe0, 0x57, 0xc0, 0x82, 0xbf, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0x1c, 0xf6, + 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x37, 0xd2, 0x01, 0x15, 0xf1, 0x01, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { @@ -199,6 +210,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.WalletUsages) > 0 { + for iNdEx := len(m.WalletUsages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.WalletUsages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } if len(m.FeePayContracts) > 0 { for iNdEx := len(m.FeePayContracts) - 1; iNdEx >= 0; iNdEx-- { { @@ -284,6 +309,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.WalletUsages) > 0 { + for _, e := range m.WalletUsages { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -401,6 +432,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WalletUsages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WalletUsages = append(m.WalletUsages, FeePayWalletUsage{}) + if err := m.WalletUsages[len(m.WalletUsages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/feepay/types/genesis_pulsar_roundtrip_test.go b/x/feepay/types/genesis_pulsar_roundtrip_test.go new file mode 100644 index 000000000..1dc4cdc94 --- /dev/null +++ b/x/feepay/types/genesis_pulsar_roundtrip_test.go @@ -0,0 +1,41 @@ +package types_test + +import ( + "testing" + + "google.golang.org/protobuf/proto" + + feepayv1 "github.com/CosmosContracts/juno/v31/api/juno/feepay/v1" +) + +func TestGenesisStateWalletUsagesGeneratedRoundTrip(t *testing.T) { + usage := &feepayv1.FeePayWalletUsage{ + ContractAddress: "juno1contract", + WalletAddress: "juno1wallet", + Uses: 7, + } + original := &feepayv1.GenesisState{WalletUsages: []*feepayv1.FeePayWalletUsage{usage}} + + field := original.ProtoReflect().Descriptor().Fields().ByName("wallet_usages") + if field == nil { + t.Fatal("wallet_usages missing from generated descriptor") + } + if field.Number() != 3 || !field.IsList() || field.Message().FullName() != "juno.feepay.v1.FeePayWalletUsage" { + t.Fatalf("unexpected wallet_usages descriptor: number=%d list=%t message=%s", field.Number(), field.IsList(), field.Message().FullName()) + } + if got := original.GetWalletUsages(); len(got) != 1 || got[0].GetUses() != 7 { + t.Fatalf("generated getter lost wallet usage: %#v", got) + } + + wire, err := proto.Marshal(original) + if err != nil { + t.Fatalf("marshal: %v", err) + } + var restored feepayv1.GenesisState + if err := proto.Unmarshal(wire, &restored); err != nil { + t.Fatalf("unmarshal: %v", err) + } + if !proto.Equal(original, &restored) { + t.Fatalf("wallet usages did not round trip: got %#v", restored.GetWalletUsages()) + } +} diff --git a/x/feepay/types/genesis_test.go b/x/feepay/types/genesis_test.go new file mode 100644 index 000000000..b3c12af04 --- /dev/null +++ b/x/feepay/types/genesis_test.go @@ -0,0 +1,108 @@ +package types_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/CosmosContracts/juno/v31/x/feepay/types" +) + +func TestGenesisStateValidateWalletUsages(t *testing.T) { + contractAddr := "cosmos15u3dt79t6sxxa3x3kpkhzsy56edaa5a66wvt3kxmukqjz2sx0hesh45zsv" + walletAddr := "cosmos168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8skhnwe8" + contract := types.FeePayContract{ContractAddress: contractAddr, WalletLimit: 10} + usage := types.FeePayWalletUsage{ContractAddress: contractAddr, WalletAddress: walletAddr, Uses: 3} + + tests := []struct { + name string + state types.GenesisState + valid bool + }{ + { + name: "valid usage", + state: types.GenesisState{ + Params: types.DefaultParams(), + FeePayContracts: []types.FeePayContract{contract}, + WalletUsages: []types.FeePayWalletUsage{usage}, + }, + valid: true, + }, + { + name: "usage references unregistered contract", + state: types.GenesisState{ + Params: types.DefaultParams(), + WalletUsages: []types.FeePayWalletUsage{usage}, + }, + }, + { + name: "duplicate usage", + state: types.GenesisState{ + Params: types.DefaultParams(), + FeePayContracts: []types.FeePayContract{contract}, + WalletUsages: []types.FeePayWalletUsage{usage, usage}, + }, + }, + { + name: "invalid wallet", + state: types.GenesisState{ + Params: types.DefaultParams(), + FeePayContracts: []types.FeePayContract{contract}, + WalletUsages: []types.FeePayWalletUsage{{ + ContractAddress: contractAddr, + WalletAddress: "not-an-address", + Uses: 1, + }}, + }, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + err := tc.state.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} + +func TestGenesisStateValidatePreservesErrorMessages(t *testing.T) { + contractAddr := "cosmos15u3dt79t6sxxa3x3kpkhzsy56edaa5a66wvt3kxmukqjz2sx0hesh45zsv" + walletAddr := "cosmos168ctmpyppk90d34p3jjy658zf5a5l3w8wk35wht6ccqj4mr0yv8skhnwe8" + contract := types.FeePayContract{ContractAddress: contractAddr, WalletLimit: 10} + usage := types.FeePayWalletUsage{ContractAddress: contractAddr, WalletAddress: walletAddr, Uses: 3} + + tests := []struct { + name string + state types.GenesisState + want string + }{ + { + name: "duplicate contract", + state: types.GenesisState{FeePayContracts: []types.FeePayContract{contract, contract}}, + want: "duplicate feepay contract " + contractAddr, + }, + { + name: "unregistered contract usage", + state: types.GenesisState{WalletUsages: []types.FeePayWalletUsage{usage}}, + want: "wallet usage references unregistered feepay contract " + contractAddr, + }, + { + name: "duplicate wallet usage", + state: types.GenesisState{ + FeePayContracts: []types.FeePayContract{contract}, + WalletUsages: []types.FeePayWalletUsage{usage, usage}, + }, + want: "duplicate wallet usage for contract " + contractAddr + " and wallet " + walletAddr, + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + require.EqualError(t, tc.state.Validate(), tc.want) + }) + } +} diff --git a/x/feepay/types/tx.pb.go b/x/feepay/types/tx.pb.go index 866701389..527b7fab7 100644 --- a/x/feepay/types/tx.pb.go +++ b/x/feepay/types/tx.pb.go @@ -14,7 +14,6 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -451,57 +450,55 @@ func init() { func init() { proto.RegisterFile("juno/feepay/v1/tx.proto", fileDescriptor_d739bd30c8846fd5) } var fileDescriptor_d739bd30c8846fd5 = []byte{ - // 788 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xbf, 0x4f, 0x23, 0x47, - 0x14, 0xf6, 0xda, 0x04, 0x89, 0x81, 0x00, 0x59, 0x11, 0xb0, 0x97, 0xb0, 0x36, 0x8b, 0x10, 0xc6, - 0x09, 0xbb, 0xb1, 0x91, 0xa2, 0xc4, 0x4d, 0x14, 0x5b, 0x22, 0x44, 0x8a, 0x25, 0xe4, 0x28, 0x4a, - 0x94, 0xc6, 0x1a, 0xdb, 0xc3, 0xb2, 0xc4, 0x3b, 0xb3, 0xda, 0x19, 0x1b, 0x2c, 0xa5, 0x88, 0x52, - 0x45, 0x57, 0xdd, 0xb5, 0xd7, 0x1c, 0xe5, 0xe9, 0x2a, 0x17, 0x57, 0x5f, 0x4d, 0x89, 0xae, 0xba, - 0xe2, 0x7e, 0x09, 0x0a, 0x5f, 0x75, 0xf7, 0x2f, 0x9c, 0x76, 0x77, 0x76, 0xc1, 0x3f, 0x96, 0x85, - 0xe2, 0x24, 0x1a, 0xdb, 0x33, 0xdf, 0xf7, 0xbe, 0x79, 0xef, 0x9b, 0x37, 0x4f, 0x06, 0x4b, 0x87, - 0x6d, 0x4c, 0xb4, 0x7d, 0x84, 0x2c, 0xd8, 0xd5, 0x3a, 0x79, 0x8d, 0x1d, 0xab, 0x96, 0x4d, 0x18, - 0x11, 0x67, 0x1d, 0x40, 0xf5, 0x00, 0xb5, 0x93, 0x97, 0xbe, 0x80, 0xa6, 0x81, 0x89, 0xe6, 0x7e, - 0x7a, 0x14, 0x49, 0x6e, 0x10, 0x6a, 0x12, 0xaa, 0xd5, 0x21, 0x45, 0x5a, 0x27, 0x5f, 0x47, 0x0c, - 0xe6, 0xb5, 0x06, 0x31, 0x30, 0xc7, 0x97, 0x38, 0x6e, 0x52, 0xdd, 0x91, 0x36, 0xa9, 0xce, 0x81, - 0x94, 0x07, 0xd4, 0xdc, 0x95, 0xe6, 0x2d, 0x38, 0xb4, 0xa0, 0x13, 0x9d, 0x78, 0xfb, 0xce, 0x2f, - 0xbe, 0xfb, 0x95, 0x4e, 0x88, 0xde, 0x42, 0x1a, 0xb4, 0x0c, 0x0d, 0x62, 0x4c, 0x18, 0x64, 0x06, - 0xc1, 0x7e, 0xcc, 0xf2, 0x50, 0x0d, 0x3c, 0x69, 0x1e, 0x3a, 0x04, 0xea, 0x08, 0x23, 0x6a, 0xf0, - 0x50, 0xe5, 0x83, 0x00, 0x52, 0x15, 0xaa, 0x57, 0x91, 0x6e, 0x50, 0x86, 0xec, 0x1d, 0x84, 0xf6, - 0x60, 0xb7, 0x4c, 0x30, 0xb3, 0x61, 0x83, 0x89, 0x3f, 0x82, 0x59, 0x8a, 0x70, 0x13, 0xd9, 0x35, - 0xd8, 0x6c, 0xda, 0x88, 0xd2, 0xa4, 0x90, 0x11, 0xb2, 0x53, 0xa5, 0xe4, 0xf3, 0xa7, 0x5b, 0x0b, - 0x3c, 0xed, 0x9f, 0x3c, 0xe4, 0x37, 0x66, 0x1b, 0x58, 0xaf, 0x7e, 0xee, 0xf1, 0xf9, 0xa6, 0xb8, - 0x0b, 0xe6, 0xf7, 0x11, 0xaa, 0x59, 0xb0, 0x5b, 0x6b, 0x70, 0xd1, 0x64, 0x3c, 0x23, 0x64, 0xa7, - 0x0b, 0xb2, 0x3a, 0xe8, 0xaf, 0x3a, 0x78, 0x74, 0x75, 0x76, 0x7f, 0x60, 0x5d, 0xfc, 0xf9, 0xff, - 0x93, 0x74, 0xec, 0xdd, 0x49, 0x3a, 0xf6, 0x5f, 0xbf, 0x97, 0x1b, 0xca, 0xea, 0x5e, 0xbf, 0x97, - 0xdb, 0x70, 0xcb, 0x3c, 0xf6, 0x0b, 0x0d, 0xad, 0x49, 0x59, 0x03, 0xab, 0xa1, 0x60, 0x15, 0x51, - 0x8b, 0x60, 0x8a, 0x94, 0xf7, 0x02, 0x58, 0xae, 0x50, 0xfd, 0x77, 0x6c, 0x7f, 0x22, 0x63, 0xca, - 0x60, 0xde, 0x37, 0x24, 0x90, 0x88, 0x47, 0x48, 0xcc, 0xf9, 0x11, 0x7c, 0xbb, 0xf8, 0x4b, 0x84, - 0x27, 0x9b, 0x23, 0x9e, 0x84, 0x15, 0xa4, 0xac, 0x83, 0xb5, 0x6b, 0xe0, 0xc0, 0x97, 0x57, 0x71, - 0xf0, 0x65, 0x85, 0xea, 0x3b, 0x6d, 0xdc, 0xbc, 0x8b, 0x8e, 0x88, 0x5d, 0x30, 0x09, 0x4d, 0xd2, - 0xc6, 0x2c, 0x99, 0xc8, 0x24, 0xb2, 0xd3, 0x85, 0x94, 0xca, 0xe3, 0x9c, 0x27, 0xaa, 0xf2, 0x27, - 0xaa, 0x96, 0x89, 0x81, 0x4b, 0x3b, 0xa7, 0xaf, 0xd3, 0xb1, 0x27, 0x6f, 0xd2, 0x59, 0xdd, 0x60, - 0x07, 0xed, 0xba, 0xda, 0x20, 0x26, 0x7f, 0x89, 0xfc, 0x6b, 0x8b, 0x36, 0xff, 0xd6, 0x58, 0xd7, - 0x42, 0xd4, 0x0d, 0xa0, 0x0f, 0xfb, 0xbd, 0xdc, 0x4c, 0x0b, 0xe9, 0xb0, 0xe1, 0x34, 0xb3, 0x81, - 0xe9, 0xe3, 0x7e, 0x2f, 0x27, 0x54, 0xf9, 0x81, 0xc5, 0x72, 0xc4, 0x65, 0xac, 0x8d, 0x5c, 0xc6, - 0xa8, 0x8b, 0x4a, 0x1a, 0xac, 0x8c, 0x05, 0x82, 0x0b, 0x78, 0x14, 0x07, 0x8a, 0x73, 0x51, 0x56, - 0x13, 0x32, 0x34, 0xc8, 0xf9, 0x03, 0xb6, 0x5a, 0x88, 0xfd, 0x6a, 0x98, 0xc6, 0x5d, 0xb9, 0x8d, - 0x55, 0x30, 0x73, 0xe4, 0x26, 0x55, 0x6b, 0x39, 0x59, 0x25, 0x13, 0x19, 0x21, 0x3b, 0x51, 0x9d, - 0x3e, 0xba, 0x4c, 0xb4, 0xb8, 0x17, 0xe1, 0xda, 0xb7, 0xa3, 0x2d, 0x7c, 0x7d, 0xe9, 0xca, 0x37, - 0x20, 0x17, 0xcd, 0x0a, 0xfc, 0x7c, 0x26, 0x80, 0xb9, 0x80, 0xbe, 0x07, 0x6d, 0x68, 0x52, 0xf1, - 0x3b, 0x30, 0x05, 0xdb, 0xec, 0x80, 0xd8, 0x06, 0xeb, 0x46, 0xfa, 0x76, 0x49, 0x15, 0x7f, 0x00, - 0x93, 0x96, 0xab, 0xc0, 0x47, 0xdc, 0xe2, 0xf0, 0x88, 0xf3, 0xf4, 0x4b, 0x53, 0x4e, 0xe7, 0xf1, - 0xe6, 0xf1, 0x02, 0x8a, 0xdf, 0x5f, 0xb5, 0xe1, 0x52, 0xd2, 0x71, 0x60, 0x25, 0xc4, 0x01, 0x4f, - 0x4c, 0x49, 0x81, 0xa5, 0xa1, 0x2d, 0xbf, 0xb6, 0xc2, 0xcb, 0x09, 0x90, 0xa8, 0x50, 0x5d, 0xec, - 0x80, 0xc5, 0x90, 0xf9, 0xbe, 0x39, 0x9c, 0x61, 0xe8, 0x64, 0x94, 0xf2, 0x37, 0xa6, 0xfa, 0xe7, - 0x8b, 0xff, 0x80, 0x64, 0xe8, 0x00, 0xfd, 0x7a, 0x8c, 0x5c, 0x18, 0x59, 0xda, 0xbe, 0x05, 0x39, - 0x38, 0xfd, 0x10, 0x88, 0x63, 0xc6, 0xd4, 0xfa, 0x18, 0xa9, 0x51, 0x9a, 0xb4, 0x75, 0x23, 0x5a, - 0x70, 0xd6, 0x03, 0x01, 0xa4, 0xa3, 0x9e, 0x64, 0x61, 0x5c, 0x11, 0xd7, 0xc7, 0x48, 0xc5, 0xdb, - 0xc7, 0x04, 0x39, 0xfd, 0x09, 0x66, 0x06, 0xba, 0x3a, 0x1d, 0xaa, 0xe5, 0x11, 0xa4, 0x8d, 0x08, - 0x82, 0xaf, 0x2c, 0x7d, 0xf6, 0xaf, 0xd3, 0xbb, 0xa5, 0xdd, 0xd3, 0x73, 0x59, 0x38, 0x3b, 0x97, - 0x85, 0xb7, 0xe7, 0xb2, 0x70, 0xff, 0x42, 0x8e, 0x9d, 0x5d, 0xc8, 0xb1, 0x17, 0x17, 0x72, 0xec, - 0x2f, 0xf5, 0xca, 0x48, 0x2d, 0xbb, 0x8f, 0xc6, 0x4f, 0x94, 0x6a, 0x83, 0xdd, 0xec, 0x8e, 0xd7, - 0xfa, 0xa4, 0xfb, 0x5f, 0x64, 0xfb, 0x63, 0x00, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x1d, 0x7f, 0x79, - 0x8c, 0x09, 0x00, 0x00, + // 767 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcd, 0x4f, 0x13, 0x4f, + 0x18, 0xee, 0xb6, 0xfc, 0x48, 0x18, 0xf8, 0x01, 0x6e, 0x10, 0xda, 0x45, 0xb6, 0x65, 0x09, 0xa1, + 0x54, 0xd9, 0xb5, 0x25, 0x31, 0xda, 0x8b, 0xb1, 0x4d, 0x10, 0x13, 0x9b, 0x90, 0x1a, 0xa3, 0xf1, + 0xd2, 0x4c, 0xdb, 0x61, 0x59, 0xec, 0xee, 0x34, 0x3b, 0xd3, 0x42, 0x13, 0x0f, 0xc6, 0x93, 0xf1, + 0xa4, 0x57, 0x2f, 0x72, 0x34, 0x9e, 0x7a, 0xf0, 0xec, 0x99, 0x23, 0xf1, 0xe4, 0xc1, 0xaf, 0xc0, + 0xa1, 0x9e, 0xf4, 0x5f, 0x30, 0xbb, 0x3b, 0xbb, 0xd0, 0x8f, 0x65, 0xe1, 0x60, 0xc2, 0xa5, 0xed, + 0xcc, 0xf3, 0xbc, 0xcf, 0xbc, 0xef, 0x33, 0xef, 0xbc, 0x29, 0x98, 0xd9, 0x6e, 0x18, 0x58, 0xd9, + 0x44, 0xa8, 0x0e, 0x5b, 0x4a, 0x33, 0xad, 0xd0, 0x5d, 0xb9, 0x6e, 0x62, 0x8a, 0xf9, 0x71, 0x0b, + 0x90, 0x1d, 0x40, 0x6e, 0xa6, 0x85, 0x4b, 0x50, 0xd7, 0x0c, 0xac, 0xd8, 0x9f, 0x0e, 0x45, 0x10, + 0x2b, 0x98, 0xe8, 0x98, 0x28, 0x65, 0x48, 0x90, 0xd2, 0x4c, 0x97, 0x11, 0x85, 0x69, 0xa5, 0x82, + 0x35, 0x83, 0xe1, 0x33, 0x0c, 0xd7, 0x89, 0x6a, 0x49, 0xeb, 0x44, 0x65, 0x40, 0xcc, 0x01, 0x4a, + 0xf6, 0x4a, 0x71, 0x16, 0x0c, 0x9a, 0x52, 0xb1, 0x8a, 0x9d, 0x7d, 0xeb, 0x17, 0xdb, 0x9d, 0xed, + 0xc9, 0x92, 0xa5, 0xe5, 0x80, 0x57, 0x7a, 0x40, 0x15, 0x19, 0x88, 0x68, 0x4c, 0x50, 0xfa, 0xc3, + 0x81, 0x58, 0x81, 0xa8, 0x45, 0xa4, 0x6a, 0x84, 0x22, 0x73, 0x0d, 0xa1, 0x0d, 0xd8, 0xca, 0x63, + 0x83, 0x9a, 0xb0, 0x42, 0xf9, 0xdb, 0x60, 0x9c, 0x20, 0xa3, 0x8a, 0xcc, 0x12, 0xac, 0x56, 0x4d, + 0x44, 0x48, 0x94, 0x4b, 0x70, 0xc9, 0x91, 0x5c, 0xf4, 0xf3, 0xc7, 0x95, 0x29, 0x96, 0xd8, 0x1d, + 0x07, 0x79, 0x40, 0x4d, 0xcd, 0x50, 0x8b, 0xff, 0x3b, 0x7c, 0xb6, 0xc9, 0xaf, 0x83, 0xc9, 0x4d, + 0x84, 0x4a, 0x75, 0xd8, 0x2a, 0x55, 0x98, 0x68, 0x34, 0x9c, 0xe0, 0x92, 0xa3, 0x19, 0x51, 0xee, + 0x76, 0x50, 0xee, 0x3e, 0xba, 0x38, 0xbe, 0xd9, 0xb5, 0xce, 0xde, 0x7d, 0xb9, 0x17, 0x0f, 0xfd, + 0xda, 0x8b, 0x87, 0x5e, 0x74, 0xda, 0xa9, 0x9e, 0xac, 0x5e, 0x75, 0xda, 0xa9, 0x25, 0xbb, 0xcc, + 0x5d, 0xb7, 0x50, 0xdf, 0x9a, 0xa4, 0x05, 0x30, 0xef, 0x0b, 0x16, 0x11, 0xa9, 0x63, 0x83, 0x20, + 0xe9, 0x37, 0x07, 0x66, 0x0b, 0x44, 0x7d, 0x68, 0x98, 0xff, 0xc8, 0x98, 0x3c, 0x98, 0x74, 0x0d, + 0xf1, 0x24, 0xc2, 0x01, 0x12, 0x13, 0x6e, 0x04, 0xdb, 0xce, 0xde, 0x0b, 0xf0, 0x64, 0xb9, 0xcf, + 0x13, 0xbf, 0x82, 0xa4, 0x45, 0xb0, 0x70, 0x0a, 0xec, 0xf9, 0xf2, 0x2d, 0x0c, 0x2e, 0x17, 0x88, + 0xba, 0xd6, 0x30, 0xaa, 0x17, 0xd1, 0x11, 0xbe, 0x05, 0x86, 0xa1, 0x8e, 0x1b, 0x06, 0x8d, 0x46, + 0x12, 0x91, 0xe4, 0x68, 0x26, 0x26, 0xb3, 0x38, 0xeb, 0x11, 0xca, 0xec, 0x11, 0xca, 0x79, 0xac, + 0x19, 0xb9, 0xb5, 0xfd, 0xef, 0xf1, 0xd0, 0x87, 0x1f, 0xf1, 0xa4, 0xaa, 0xd1, 0xad, 0x46, 0x59, + 0xae, 0x60, 0x9d, 0xbd, 0x35, 0xf6, 0xb5, 0x42, 0xaa, 0x4f, 0x15, 0xda, 0xaa, 0x23, 0x62, 0x07, + 0x90, 0xb7, 0x9d, 0x76, 0x6a, 0xac, 0x86, 0x54, 0x58, 0xb1, 0x9a, 0x59, 0x33, 0xc8, 0xfb, 0x4e, + 0x3b, 0xc5, 0x15, 0xd9, 0x81, 0xd9, 0x7c, 0xc0, 0x65, 0x2c, 0xf4, 0x5d, 0x46, 0xbf, 0x8b, 0x52, + 0x1c, 0xcc, 0x0d, 0x04, 0xbc, 0x0b, 0x78, 0x17, 0x06, 0x92, 0x75, 0x51, 0xf5, 0x2a, 0xa4, 0xa8, + 0x9b, 0xf3, 0x08, 0xd6, 0x6a, 0x88, 0xde, 0xd7, 0x74, 0xed, 0xa2, 0xdc, 0xc6, 0x3c, 0x18, 0xdb, + 0xb1, 0x93, 0x2a, 0xd5, 0xac, 0xac, 0xa2, 0x91, 0x04, 0x97, 0x1c, 0x2a, 0x8e, 0xee, 0x1c, 0x27, + 0x9a, 0xdd, 0x08, 0x70, 0xed, 0x7a, 0x7f, 0x0b, 0x9f, 0x5e, 0xba, 0x74, 0x0d, 0xa4, 0x82, 0x59, + 0x9e, 0x9f, 0x9f, 0x38, 0x30, 0xe1, 0xd1, 0x37, 0xa0, 0x09, 0x75, 0xc2, 0xdf, 0x00, 0x23, 0xb0, + 0x41, 0xb7, 0xb0, 0xa9, 0xd1, 0x56, 0xa0, 0x6f, 0xc7, 0x54, 0xfe, 0x16, 0x18, 0xae, 0xdb, 0x0a, + 0x6c, 0xc4, 0x4d, 0xf7, 0x8e, 0x38, 0x47, 0x3f, 0x37, 0x62, 0x75, 0x1e, 0x6b, 0x1e, 0x27, 0x20, + 0x7b, 0xf3, 0xa4, 0x0d, 0xc7, 0x92, 0x96, 0x03, 0x73, 0x3e, 0x0e, 0x38, 0x62, 0x52, 0x0c, 0xcc, + 0xf4, 0x6c, 0xb9, 0xb5, 0x65, 0xbe, 0x0e, 0x81, 0x48, 0x81, 0xa8, 0x7c, 0x13, 0x4c, 0xfb, 0xcc, + 0xf7, 0xe5, 0xde, 0x0c, 0x7d, 0x27, 0xa3, 0x90, 0x3e, 0x33, 0xd5, 0x3d, 0x9f, 0x7f, 0x06, 0xa2, + 0xbe, 0x03, 0xf4, 0xea, 0x00, 0x39, 0x3f, 0xb2, 0xb0, 0x7a, 0x0e, 0xb2, 0x77, 0xfa, 0x36, 0xe0, + 0x07, 0x8c, 0xa9, 0xc5, 0x01, 0x52, 0xfd, 0x34, 0x61, 0xe5, 0x4c, 0x34, 0xef, 0xac, 0x37, 0x1c, + 0x88, 0x07, 0x3d, 0xc9, 0xcc, 0xa0, 0x22, 0x4e, 0x8f, 0x11, 0xb2, 0xe7, 0x8f, 0xf1, 0x72, 0x7a, + 0x0c, 0xc6, 0xba, 0xba, 0x3a, 0xee, 0xab, 0xe5, 0x10, 0x84, 0xa5, 0x00, 0x82, 0xab, 0x2c, 0xfc, + 0xf7, 0xdc, 0xea, 0xdd, 0xdc, 0xfa, 0xfe, 0xa1, 0xc8, 0x1d, 0x1c, 0x8a, 0xdc, 0xcf, 0x43, 0x91, + 0x7b, 0x7d, 0x24, 0x86, 0x0e, 0x8e, 0xc4, 0xd0, 0x97, 0x23, 0x31, 0xf4, 0x44, 0x3e, 0x31, 0x52, + 0xf3, 0xf6, 0xa3, 0x71, 0x13, 0x25, 0x4a, 0x77, 0x37, 0xdb, 0xe3, 0xb5, 0x3c, 0x6c, 0xff, 0x17, + 0x59, 0xfd, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x65, 0x9b, 0x6b, 0x15, 0x6e, 0x09, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/feeshare/ante/ante.go b/x/feeshare/ante/ante.go index b36e9bd3c..67842908d 100644 --- a/x/feeshare/ante/ante.go +++ b/x/feeshare/ante/ante.go @@ -14,9 +14,9 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - "github.com/CosmosContracts/juno/v30/x/feeshare/keeper" - "github.com/CosmosContracts/juno/v30/x/feeshare/types" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + "github.com/CosmosContracts/juno/v31/x/feeshare/keeper" + "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) // FeeSharePayoutDecorator Run his after we already deduct the fee from the account with diff --git a/x/feeshare/ante/ante_test.go b/x/feeshare/ante/ante_test.go index 28345c87c..660dc5684 100644 --- a/x/feeshare/ante/ante_test.go +++ b/x/feeshare/ante/ante_test.go @@ -14,11 +14,11 @@ import ( "github.com/cosmos/cosmos-sdk/x/authz" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - "github.com/CosmosContracts/juno/v30/testutil" - feemarkettypes "github.com/CosmosContracts/juno/v30/x/feemarket/types" - ante "github.com/CosmosContracts/juno/v30/x/feeshare/ante" - feesharekeeper "github.com/CosmosContracts/juno/v30/x/feeshare/keeper" - feesharetypes "github.com/CosmosContracts/juno/v30/x/feeshare/types" + "github.com/CosmosContracts/juno/v31/testutil" + feemarkettypes "github.com/CosmosContracts/juno/v31/x/feemarket/types" + ante "github.com/CosmosContracts/juno/v31/x/feeshare/ante" + feesharekeeper "github.com/CosmosContracts/juno/v31/x/feeshare/keeper" + feesharetypes "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) // Define an empty ante handle diff --git a/x/feeshare/keeper/feeshare.go b/x/feeshare/keeper/feeshare.go index 469d84071..136821fa8 100644 --- a/x/feeshare/keeper/feeshare.go +++ b/x/feeshare/keeper/feeshare.go @@ -9,7 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/runtime" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/feeshare/types" + "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) // GetFeeShares returns all registered FeeShares. diff --git a/x/feeshare/keeper/genesis.go b/x/feeshare/keeper/genesis.go index 62e7e4853..2210428b0 100644 --- a/x/feeshare/keeper/genesis.go +++ b/x/feeshare/keeper/genesis.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/feeshare/types" + "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) // InitGenesis import module genesis diff --git a/x/feeshare/keeper/genesis_test.go b/x/feeshare/keeper/genesis_test.go index 06588be9e..9bf9bc3a7 100644 --- a/x/feeshare/keeper/genesis_test.go +++ b/x/feeshare/keeper/genesis_test.go @@ -5,7 +5,7 @@ import ( sdkmath "cosmossdk.io/math" - "github.com/CosmosContracts/juno/v30/x/feeshare/types" + "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) func (s *KeeperTestSuite) TestFeeShareInitGenesis() { diff --git a/x/feeshare/keeper/grpc_query.go b/x/feeshare/keeper/grpc_query.go index a6e34058c..20b2dd21d 100644 --- a/x/feeshare/keeper/grpc_query.go +++ b/x/feeshare/keeper/grpc_query.go @@ -12,7 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/CosmosContracts/juno/v30/x/feeshare/types" + "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) var _ types.QueryServer = queryServer{} diff --git a/x/feeshare/keeper/grpc_query_test.go b/x/feeshare/keeper/grpc_query_test.go index 792fad409..ca4c99c65 100644 --- a/x/feeshare/keeper/grpc_query_test.go +++ b/x/feeshare/keeper/grpc_query_test.go @@ -7,8 +7,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "github.com/CosmosContracts/juno/v30/testutil/common/nullify" - "github.com/CosmosContracts/juno/v30/x/feeshare/types" + "github.com/CosmosContracts/juno/v31/testutil/common/nullify" + "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) func (s *KeeperTestSuite) TestFeeShares() { diff --git a/x/feeshare/keeper/keeper.go b/x/feeshare/keeper/keeper.go index d9636ffa3..3ec81f049 100644 --- a/x/feeshare/keeper/keeper.go +++ b/x/feeshare/keeper/keeper.go @@ -14,7 +14,7 @@ import ( authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - revtypes "github.com/CosmosContracts/juno/v30/x/feeshare/types" + revtypes "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) // Keeper of this module maintains collections of feeshares for contracts diff --git a/x/feeshare/keeper/keeper_test.go b/x/feeshare/keeper/keeper_test.go index a7cd912a0..d279e15d9 100644 --- a/x/feeshare/keeper/keeper_test.go +++ b/x/feeshare/keeper/keeper_test.go @@ -12,8 +12,8 @@ import ( authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - "github.com/CosmosContracts/juno/v30/testutil" - "github.com/CosmosContracts/juno/v30/x/feeshare/types" + "github.com/CosmosContracts/juno/v31/testutil" + "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) type KeeperTestSuite struct { diff --git a/x/feeshare/keeper/msg_server.go b/x/feeshare/keeper/msg_server.go index f0abebdbe..d79bda5b0 100644 --- a/x/feeshare/keeper/msg_server.go +++ b/x/feeshare/keeper/msg_server.go @@ -11,7 +11,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/CosmosContracts/juno/v30/x/feeshare/types" + "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) var _ types.MsgServer = &Keeper{} diff --git a/x/feeshare/keeper/msg_server_test.go b/x/feeshare/keeper/msg_server_test.go index d4f270090..318528d64 100644 --- a/x/feeshare/keeper/msg_server_test.go +++ b/x/feeshare/keeper/msg_server_test.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/CosmosContracts/juno/v30/x/feeshare/types" + "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) func (s *KeeperTestSuite) TestGetContractAdminOrCreatorAddress() { diff --git a/x/feeshare/keeper/params.go b/x/feeshare/keeper/params.go index 4e19b8696..188596893 100644 --- a/x/feeshare/keeper/params.go +++ b/x/feeshare/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/CosmosContracts/juno/v30/x/feeshare/types" + "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) // SetParams sets the x/feeshare module parameters. diff --git a/x/feeshare/module/autocli.go b/x/feeshare/module/autocli.go index de3a56caa..e6353c556 100644 --- a/x/feeshare/module/autocli.go +++ b/x/feeshare/module/autocli.go @@ -3,7 +3,7 @@ package module import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - feesharev1 "github.com/CosmosContracts/juno/v30/api/juno/feeshare/v1" + feesharev1 "github.com/CosmosContracts/juno/v31/api/juno/feeshare/v1" ) // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. diff --git a/x/feeshare/module/module.go b/x/feeshare/module/module.go index 185fda879..b29e7ca08 100644 --- a/x/feeshare/module/module.go +++ b/x/feeshare/module/module.go @@ -17,8 +17,8 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - "github.com/CosmosContracts/juno/v30/x/feeshare/keeper" - "github.com/CosmosContracts/juno/v30/x/feeshare/types" + "github.com/CosmosContracts/juno/v31/x/feeshare/keeper" + "github.com/CosmosContracts/juno/v31/x/feeshare/types" ) // type check to ensure the interface is properly implemented diff --git a/x/feeshare/types/tx.pb.go b/x/feeshare/types/tx.pb.go index dcd8b3af0..514cc54ee 100644 --- a/x/feeshare/types/tx.pb.go +++ b/x/feeshare/types/tx.pb.go @@ -12,7 +12,6 @@ import ( _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -371,44 +370,43 @@ func init() { func init() { proto.RegisterFile("juno/feeshare/v1/tx.proto", fileDescriptor_db5ab2575863a062) } var fileDescriptor_db5ab2575863a062 = []byte{ - // 591 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x55, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xde, 0x4d, 0xb0, 0x90, 0x51, 0x6c, 0xb2, 0x16, 0x9a, 0x6c, 0x75, 0x63, 0x53, 0x04, 0x8d, - 0x74, 0xc7, 0x56, 0xf0, 0x10, 0x4f, 0x26, 0xa8, 0x20, 0x04, 0x24, 0xc5, 0x8b, 0x08, 0x65, 0x92, - 0x8c, 0x93, 0x95, 0xec, 0xcc, 0x32, 0x33, 0x69, 0x9b, 0x9b, 0x78, 0x12, 0x4f, 0xfe, 0x00, 0x0f, - 0x3d, 0x0a, 0x1e, 0xcc, 0xc1, 0x5f, 0xe0, 0xa9, 0xc7, 0xe2, 0xc9, 0x93, 0x48, 0x72, 0x88, 0x3f, - 0x43, 0x76, 0x77, 0x36, 0xc9, 0x26, 0x5b, 0x53, 0x3c, 0x89, 0x97, 0x90, 0x7d, 0xdf, 0xf7, 0xbe, - 0xf7, 0xde, 0xb7, 0x6f, 0x66, 0x41, 0xe1, 0x55, 0x8f, 0x32, 0xf8, 0x12, 0x63, 0xd1, 0x41, 0x1c, - 0xc3, 0x83, 0x1d, 0x28, 0x8f, 0x6c, 0x8f, 0x33, 0xc9, 0x8c, 0xac, 0x0f, 0xd9, 0x11, 0x64, 0x1f, - 0xec, 0x98, 0x39, 0xe4, 0x3a, 0x94, 0xc1, 0xe0, 0x37, 0x24, 0x99, 0xeb, 0x2d, 0x26, 0x5c, 0x26, - 0xa0, 0x2b, 0x88, 0x9f, 0xec, 0x0a, 0xa2, 0x80, 0x42, 0x08, 0xec, 0x07, 0x4f, 0x30, 0x7c, 0x50, - 0xd0, 0x1a, 0x61, 0x84, 0x85, 0x71, 0xff, 0x9f, 0x8a, 0x5e, 0x25, 0x8c, 0x91, 0x2e, 0x86, 0xc8, - 0x73, 0x20, 0xa2, 0x94, 0x49, 0x24, 0x1d, 0x46, 0xa3, 0x1c, 0x6b, 0xa1, 0x4f, 0x82, 0x29, 0x16, - 0x8e, 0xc2, 0x4b, 0x9f, 0x53, 0xe0, 0x4a, 0x5d, 0x90, 0x06, 0x26, 0x8e, 0x90, 0x98, 0x3f, 0xc2, - 0x78, 0xcf, 0x27, 0x1a, 0x35, 0x90, 0x6d, 0x31, 0x2a, 0x39, 0x6a, 0xc9, 0x7d, 0xd4, 0x6e, 0x73, - 0x2c, 0x44, 0x5e, 0xbf, 0xae, 0xdf, 0xcc, 0x54, 0xf3, 0xdf, 0xbe, 0x6c, 0xaf, 0xa9, 0xbe, 0x1e, - 0x84, 0xc8, 0x9e, 0xe4, 0x0e, 0x25, 0x8d, 0xd5, 0x28, 0x43, 0x85, 0x7d, 0x91, 0x36, 0xf6, 0xba, - 0xac, 0x8f, 0xf9, 0x44, 0x24, 0xb5, 0x4c, 0x24, 0xca, 0x88, 0x44, 0x1e, 0x03, 0xe3, 0xd0, 0x91, - 0x9d, 0x36, 0x47, 0x87, 0x33, 0x32, 0xe9, 0x25, 0x32, 0xb9, 0x69, 0x8e, 0x02, 0x2a, 0x0f, 0xdf, - 0x1e, 0x17, 0xb5, 0x5f, 0xc7, 0x45, 0xed, 0xcd, 0x78, 0x50, 0x5e, 0x68, 0xec, 0xdd, 0x78, 0x50, - 0xde, 0x0a, 0xcc, 0x3a, 0x9a, 0xda, 0x95, 0xe0, 0x4c, 0xe9, 0x1a, 0xd8, 0x48, 0x08, 0x37, 0xb0, - 0xf0, 0x18, 0x15, 0xb8, 0xf4, 0x29, 0x05, 0x72, 0x75, 0x41, 0x9e, 0x79, 0x6d, 0x24, 0xf1, 0xff, - 0x6c, 0x67, 0x6d, 0xa9, 0x9d, 0x9b, 0x09, 0x76, 0xc6, 0x7d, 0x29, 0x6d, 0x80, 0xc2, 0x42, 0x70, - 0x62, 0xe5, 0x50, 0x0f, 0xac, 0xac, 0x21, 0xda, 0xc2, 0xdd, 0x7f, 0xcf, 0xca, 0xbf, 0x74, 0x20, - 0x3e, 0x8e, 0x72, 0x20, 0x1e, 0x9c, 0x38, 0xf0, 0x55, 0x07, 0xab, 0x13, 0x7f, 0x9e, 0x22, 0x8e, - 0x5c, 0x61, 0xdc, 0x03, 0x19, 0xd4, 0x93, 0x1d, 0xc6, 0x1d, 0xd9, 0x5f, 0x3a, 0xf8, 0x94, 0x6a, - 0xdc, 0x07, 0x2b, 0x5e, 0xa0, 0x10, 0x0c, 0x7a, 0x71, 0x37, 0x6f, 0xcf, 0xdf, 0x53, 0x76, 0x58, - 0xa1, 0x9a, 0x39, 0xf9, 0x51, 0xd4, 0x3e, 0x8e, 0x07, 0x65, 0xbd, 0xa1, 0x52, 0x2a, 0x95, 0xd9, - 0x51, 0xa7, 0xa2, 0xfe, 0x8c, 0xc5, 0x33, 0xdf, 0x72, 0x28, 0x57, 0x2a, 0x80, 0xf5, 0xb9, 0x50, - 0x34, 0xdf, 0xee, 0x87, 0x34, 0x48, 0xd7, 0x05, 0x31, 0x3a, 0x20, 0xbb, 0x70, 0x03, 0xdd, 0x58, - 0xec, 0x2f, 0xe1, 0xdc, 0x99, 0xdb, 0xe7, 0xa2, 0x45, 0x15, 0x8d, 0x26, 0xb8, 0x3c, 0x77, 0x34, - 0xb7, 0x12, 0x05, 0xe2, 0x24, 0xf3, 0xf6, 0x39, 0x48, 0xb3, 0x35, 0xe6, 0x76, 0x36, 0xb9, 0x46, - 0x9c, 0x74, 0x46, 0x8d, 0xe4, 0xcd, 0x30, 0x5e, 0x80, 0x4b, 0xb1, 0xad, 0xd8, 0xfc, 0x43, 0x83, - 0x21, 0xc5, 0xbc, 0xb5, 0x94, 0x12, 0xa9, 0x9b, 0x17, 0x5e, 0xfb, 0x6f, 0xbf, 0xfa, 0xe4, 0x64, - 0x68, 0xe9, 0xa7, 0x43, 0x4b, 0xff, 0x39, 0xb4, 0xf4, 0xf7, 0x23, 0x4b, 0x3b, 0x1d, 0x59, 0xda, - 0xf7, 0x91, 0xa5, 0x3d, 0xbf, 0x43, 0x1c, 0xd9, 0xe9, 0x35, 0xed, 0x16, 0x73, 0x61, 0x2d, 0x58, - 0xbc, 0x9a, 0x3a, 0x61, 0x02, 0xce, 0xef, 0x83, 0xec, 0x7b, 0x58, 0x34, 0x57, 0x82, 0xef, 0xcd, - 0xdd, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x0d, 0xd9, 0x95, 0x5b, 0x39, 0x07, 0x00, 0x00, + // 573 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0xcc, 0x2a, 0xcd, 0xcb, + 0xd7, 0x4f, 0x4b, 0x4d, 0x2d, 0xce, 0x48, 0x2c, 0x4a, 0xd5, 0x2f, 0x33, 0xd4, 0x2f, 0xa9, 0xd0, + 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x00, 0x49, 0xe9, 0xc1, 0xa4, 0xf4, 0xca, 0x0c, 0xa5, + 0x04, 0x13, 0x73, 0x33, 0xf3, 0xf2, 0xf5, 0xc1, 0x24, 0x44, 0x91, 0x94, 0x78, 0x72, 0x7e, 0x71, + 0x6e, 0x7e, 0xb1, 0x7e, 0x6e, 0x71, 0x3a, 0x48, 0x73, 0x6e, 0x71, 0x3a, 0x54, 0x42, 0x12, 0x22, + 0x11, 0x0f, 0xe6, 0xe9, 0x43, 0x38, 0x50, 0x29, 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0x88, 0x38, 0x88, + 0x05, 0x15, 0x95, 0xc3, 0x70, 0x49, 0x7a, 0x6a, 0x5e, 0x6a, 0x71, 0x26, 0x54, 0x97, 0xd2, 0x7a, + 0x26, 0x2e, 0x61, 0xdf, 0xe2, 0xf4, 0xa0, 0xd4, 0xf4, 0xcc, 0xe2, 0x92, 0xd4, 0x22, 0xb7, 0xd4, + 0xd4, 0x60, 0x90, 0x42, 0x21, 0x67, 0x2e, 0x81, 0xe4, 0xfc, 0xbc, 0x92, 0xa2, 0xc4, 0xe4, 0x92, + 0xf8, 0xc4, 0x94, 0x94, 0xa2, 0xd4, 0xe2, 0x62, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0x89, + 0x4b, 0x5b, 0x74, 0x45, 0xa0, 0x36, 0x3b, 0x42, 0x64, 0x82, 0x4b, 0x8a, 0x32, 0xf3, 0xd2, 0x83, + 0xf8, 0x61, 0x3a, 0xa0, 0xc2, 0x20, 0x43, 0x52, 0x52, 0x0b, 0x72, 0xf2, 0x2b, 0x53, 0x8b, 0xe0, + 0x86, 0x30, 0x11, 0x32, 0x04, 0xa6, 0x03, 0x66, 0x88, 0x3b, 0x97, 0x50, 0x79, 0x66, 0x49, 0x46, + 0x4a, 0x51, 0x62, 0x39, 0x92, 0x31, 0xcc, 0x04, 0x8c, 0x11, 0x44, 0xe8, 0x81, 0x4a, 0x58, 0xb9, + 0x76, 0x2c, 0x90, 0x67, 0x78, 0xb1, 0x40, 0x9e, 0xa1, 0xe9, 0xf9, 0x06, 0x2d, 0x0c, 0x87, 0x75, + 0x3d, 0xdf, 0xa0, 0xa5, 0x0c, 0x0e, 0xac, 0x0a, 0x44, 0x70, 0x61, 0x09, 0x19, 0x25, 0x59, 0x2e, + 0x69, 0x2c, 0xc2, 0x41, 0xa9, 0xc5, 0x05, 0xf9, 0x79, 0xc5, 0xa9, 0x4a, 0xab, 0x99, 0xb8, 0x04, + 0x7d, 0x8b, 0xd3, 0x43, 0x0b, 0x52, 0x12, 0x4b, 0x52, 0x87, 0x73, 0x70, 0x3a, 0x13, 0x0c, 0x4e, + 0x45, 0x2c, 0xc1, 0x89, 0x1a, 0x2e, 0x4a, 0xd2, 0x5c, 0x92, 0x18, 0x82, 0xf0, 0xa0, 0x7c, 0xc4, + 0x08, 0x0e, 0x4a, 0xe7, 0xc4, 0xbc, 0xe4, 0xd4, 0x9c, 0xc1, 0x17, 0x94, 0x64, 0x86, 0x00, 0xaa, + 0x77, 0xa0, 0x21, 0x80, 0x2a, 0x08, 0x0f, 0x81, 0x43, 0x8c, 0x5c, 0xfc, 0xf0, 0xf0, 0x09, 0x48, + 0x2c, 0x4a, 0xcc, 0x2d, 0x16, 0x32, 0xe3, 0xe2, 0x4c, 0x2c, 0x2d, 0xc9, 0xc8, 0x2f, 0xca, 0x2c, + 0xa9, 0x24, 0xe8, 0x71, 0x84, 0x52, 0x21, 0x6b, 0x2e, 0xb6, 0x02, 0xb0, 0x09, 0x60, 0x8f, 0x72, + 0x1b, 0x49, 0xe8, 0xa1, 0x97, 0x44, 0x7a, 0x10, 0x1b, 0x9c, 0x38, 0x4f, 0xdc, 0x93, 0x67, 0x58, + 0xf1, 0x7c, 0x83, 0x16, 0x63, 0x10, 0x54, 0x8b, 0x95, 0x15, 0xb2, 0x57, 0x11, 0x86, 0x82, 0xfc, + 0x28, 0x8f, 0x33, 0x96, 0x21, 0xc6, 0x29, 0x49, 0x72, 0x89, 0xa3, 0x09, 0xc1, 0xfc, 0x67, 0x34, + 0x87, 0x99, 0x8b, 0xd9, 0xb7, 0x38, 0x5d, 0x28, 0x83, 0x4b, 0x00, 0xa3, 0x04, 0x52, 0xc5, 0x74, + 0x1f, 0x96, 0x7c, 0x27, 0xa5, 0x4b, 0x94, 0x32, 0x98, 0x8d, 0x42, 0x49, 0x5c, 0x7c, 0x68, 0x59, + 0x53, 0x19, 0xab, 0x01, 0xa8, 0x8a, 0xa4, 0xb4, 0x89, 0x50, 0x84, 0x6c, 0x07, 0x5a, 0x9a, 0xc5, + 0x6e, 0x07, 0xaa, 0x22, 0x1c, 0x76, 0x60, 0x4f, 0x19, 0x42, 0x31, 0x5c, 0x3c, 0x28, 0xa9, 0x42, + 0x11, 0x8f, 0x03, 0x21, 0x4a, 0xa4, 0x34, 0x09, 0x2a, 0x81, 0x99, 0x2e, 0xc5, 0xda, 0x00, 0x8a, + 0x7d, 0x27, 0xaf, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, + 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x32, 0x48, 0xcf, + 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x77, 0x06, 0x27, 0x3c, 0x67, 0x68, 0x0e, + 0x2b, 0xd6, 0x47, 0x4f, 0x0f, 0x25, 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0xfa, 0xc6, 0x18, + 0x10, 0x00, 0x00, 0xff, 0xff, 0x8c, 0xde, 0xa4, 0x13, 0x1b, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/globalfee/README.md b/x/globalfee/README.md new file mode 100644 index 000000000..2da448c10 --- /dev/null +++ b/x/globalfee/README.md @@ -0,0 +1,7 @@ +# Retired globalfee codec compatibility + +The globalfee keeper, stores, module manager registration, and transaction routing remain removed. This directory preserves only the historical generated message/parameter types and codec registration needed to decode governance proposals retained in mainnet state. + +Removing these types makes `junod export` and historical governance queries panic on `/gaia.globalfee.v1beta1.MsgUpdateParams`. + +The restored files come from this repository immediately before commit `0c859ad0` removed the module. diff --git a/x/globalfee/types/codec.go b/x/globalfee/types/codec.go new file mode 100644 index 000000000..f93320df1 --- /dev/null +++ b/x/globalfee/types/codec.go @@ -0,0 +1,24 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" + "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +// RegisterLegacyAminoCodec registers concrete types on the LegacyAmino codec +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(Params{}, "gaia/x/globalfee/Params", nil) + legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "gaia/x/globalfee/MsgUpdateParams") +} + +func RegisterInterfaces(registry types.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgUpdateParams{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/x/globalfee/types/genesis.pb.go b/x/globalfee/types/genesis.pb.go new file mode 100644 index 000000000..4d0a98e22 --- /dev/null +++ b/x/globalfee/types/genesis.pb.go @@ -0,0 +1,550 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: gaia/globalfee/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState - initial state of module +type GenesisState struct { + // Params of this module + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_015b3e8b7a7c65c5, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// Params defines the set of module parameters. +type Params struct { + // Minimum stores the minimum gas price(s) for all TX on the chain. + // When multiple coins are defined then they are accepted alternatively. + // The list must be sorted by denoms asc. No duplicate denoms or zero amount + // values allowed. For more information see + // https://docs.cosmos.network/main/modules/auth#concepts + MinimumGasPrices github_com_cosmos_cosmos_sdk_types.DecCoins `protobuf:"bytes,1,rep,name=minimum_gas_prices,json=minimumGasPrices,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.DecCoins" json:"minimum_gas_prices"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_015b3e8b7a7c65c5, []int{1} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetMinimumGasPrices() github_com_cosmos_cosmos_sdk_types.DecCoins { + if m != nil { + return m.MinimumGasPrices + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "gaia.globalfee.v1beta1.GenesisState") + proto.RegisterType((*Params)(nil), "gaia.globalfee.v1beta1.Params") +} + +func init() { + proto.RegisterFile("gaia/globalfee/v1beta1/genesis.proto", fileDescriptor_015b3e8b7a7c65c5) +} + +var fileDescriptor_015b3e8b7a7c65c5 = []byte{ + // 318 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0x4f, 0xcc, 0x4c, + 0xd4, 0x4f, 0xcf, 0xc9, 0x4f, 0x4a, 0xcc, 0x49, 0x4b, 0x4d, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, + 0x49, 0x34, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, + 0x17, 0x12, 0x03, 0xa9, 0xd2, 0x83, 0xab, 0xd2, 0x83, 0xaa, 0x92, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, + 0xcb, 0xd7, 0x07, 0x93, 0x10, 0xa5, 0x52, 0x72, 0xc9, 0xf9, 0xc5, 0xb9, 0xf9, 0xc5, 0xfa, 0x49, + 0x89, 0xc5, 0x08, 0xd3, 0x92, 0xf3, 0x33, 0xf3, 0xa0, 0xf2, 0x22, 0xe9, 0xf9, 0xe9, 0xf9, 0x60, + 0xa6, 0x3e, 0x88, 0x05, 0x11, 0x55, 0x0a, 0xe4, 0xe2, 0x71, 0x87, 0xd8, 0x18, 0x5c, 0x92, 0x58, + 0x92, 0x2a, 0xe4, 0xc8, 0xc5, 0x56, 0x90, 0x58, 0x94, 0x98, 0x5b, 0x2c, 0xc1, 0xa8, 0xc0, 0xa8, + 0xc1, 0x6d, 0x24, 0xa7, 0x87, 0xdd, 0x05, 0x7a, 0x01, 0x60, 0x55, 0x4e, 0x9c, 0x27, 0xee, 0xc9, + 0x33, 0xac, 0x78, 0xbe, 0x41, 0x8b, 0x31, 0x08, 0xaa, 0x51, 0x69, 0x2a, 0x23, 0x17, 0x1b, 0x44, + 0x56, 0xa8, 0x85, 0x91, 0x4b, 0x28, 0x37, 0x33, 0x2f, 0x33, 0xb7, 0x34, 0x37, 0x3e, 0x3d, 0xb1, + 0x38, 0xbe, 0xa0, 0x28, 0x33, 0x39, 0x15, 0x64, 0x34, 0xb3, 0x06, 0xb7, 0x91, 0x8c, 0x1e, 0xc4, + 0xc5, 0x7a, 0x20, 0x17, 0xc3, 0xcd, 0x75, 0x49, 0x4d, 0x76, 0xce, 0xcf, 0xcc, 0x73, 0xb2, 0x00, + 0x19, 0xbc, 0xea, 0xbe, 0xbc, 0x76, 0x7a, 0x66, 0x49, 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0xae, + 0x3e, 0xd4, 0x87, 0x10, 0x4a, 0xb7, 0x38, 0x25, 0x5b, 0xbf, 0xa4, 0xb2, 0x20, 0xb5, 0x18, 0xa6, + 0xa7, 0x18, 0xe2, 0x0e, 0x01, 0xa8, 0x8d, 0xee, 0x89, 0xc5, 0x01, 0x60, 0xfb, 0xac, 0x58, 0x5e, + 0x2c, 0x90, 0x67, 0x74, 0x72, 0x3a, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, + 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, + 0x0d, 0x4c, 0x3b, 0xc0, 0xb1, 0x53, 0x81, 0x14, 0x3f, 0x60, 0x9b, 0x92, 0xd8, 0xc0, 0xa1, 0x66, + 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x6d, 0xb8, 0x36, 0x35, 0xbe, 0x01, 0x00, 0x00, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if len(this.MinimumGasPrices) != len(that1.MinimumGasPrices) { + return false + } + for i := range this.MinimumGasPrices { + if !this.MinimumGasPrices[i].Equal(&that1.MinimumGasPrices[i]) { + return false + } + } + return true +} +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.MinimumGasPrices) > 0 { + for iNdEx := len(m.MinimumGasPrices) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.MinimumGasPrices[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.MinimumGasPrices) > 0 { + for _, e := range m.MinimumGasPrices { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Params) 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 ErrIntOverflowGenesis + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinimumGasPrices", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.MinimumGasPrices = append(m.MinimumGasPrices, types.DecCoin{}) + if err := m.MinimumGasPrices[len(m.MinimumGasPrices)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/globalfee/types/params.go b/x/globalfee/types/params.go new file mode 100644 index 000000000..330c7206c --- /dev/null +++ b/x/globalfee/types/params.go @@ -0,0 +1,73 @@ +package types + +import ( + "errors" + "fmt" + + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var ( + errDuplicateDenomination = errors.New("duplicate denomination") + errUnsortedDenomination = errors.New("is not sorted") + errNegativeCoinAmount = errors.New("amount is negative") +) + +// DefaultParams returns default parameters +func DefaultParams() Params { + return Params{MinimumGasPrices: sdk.DecCoins(nil)} +} + +// Validate performs basic validation. +func (p Params) Validate() error { + return ValidateMinimumGasPrices(p.MinimumGasPrices) +} + +// ValidateMinimumGasPrices requires non-negative fees. +func ValidateMinimumGasPrices(i any) error { + v, ok := i.(sdk.DecCoins) + if !ok { + return errorsmod.Wrapf(sdkerrors.ErrInvalidType, "type: %T, expected sdk.DecCoins", i) + } + + dec := DecCoins(v) + return dec.Validate() +} + +type DecCoins sdk.DecCoins + +// Validate checks that the DecCoins are sorted, have nonnegtive amount, with a valid and unique +// denomination (i.e no duplicates). Otherwise, it returns an error. +func (coins DecCoins) Validate() error { + if len(coins) == 0 { + return nil + } + + lowDenom := "" + seenDenoms := make(map[string]bool) + + for i, coin := range coins { + if seenDenoms[coin.Denom] { + return fmt.Errorf("%w %s", errDuplicateDenomination, coin.Denom) + } + if err := sdk.ValidateDenom(coin.Denom); err != nil { + return err + } + // skip the denom order check for the first denom in the coins list + if i != 0 && coin.Denom <= lowDenom { + return fmt.Errorf("denomination %s %w", coin.Denom, errUnsortedDenomination) + } + if coin.IsNegative() { + return fmt.Errorf("coin %s %w", coin.Amount, errNegativeCoinAmount) + } + + // we compare each coin against the last denom + lowDenom = coin.Denom + seenDenoms[coin.Denom] = true + } + + return nil +} diff --git a/x/globalfee/types/params_test.go b/x/globalfee/types/params_test.go new file mode 100644 index 000000000..3af658dec --- /dev/null +++ b/x/globalfee/types/params_test.go @@ -0,0 +1,49 @@ +package types + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func TestDecCoinsValidatePreservesErrorMessages(t *testing.T) { + tests := []struct { + name string + coins DecCoins + want string + }{ + { + name: "duplicate denomination", + coins: DecCoins{ + sdk.NewDecCoinFromDec("aaa", math.LegacyOneDec()), + sdk.NewDecCoinFromDec("aaa", math.LegacyOneDec()), + }, + want: "duplicate denomination aaa", + }, + { + name: "unsorted denomination", + coins: DecCoins{ + sdk.NewDecCoinFromDec("bbb", math.LegacyOneDec()), + sdk.NewDecCoinFromDec("aaa", math.LegacyOneDec()), + }, + want: "denomination aaa is not sorted", + }, + { + name: "negative amount", + coins: DecCoins{ + {Denom: "aaa", Amount: math.LegacyNewDec(-1)}, + }, + want: "coin -1.000000000000000000 amount is negative", + }, + } + + for _, tc := range tests { + t.Run(tc.name, func(t *testing.T) { + require.EqualError(t, tc.coins.Validate(), tc.want) + }) + } +} diff --git a/x/globalfee/types/tx.pb.go b/x/globalfee/types/tx.pb.go new file mode 100644 index 000000000..6a096033d --- /dev/null +++ b/x/globalfee/types/tx.pb.go @@ -0,0 +1,586 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: gaia/globalfee/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgUpdateParams is the Msg/UpdateParams request type. +type MsgUpdateParams struct { + // authority is the address of the governance account. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params defines the x/mint parameters to update. + // + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_1b7ff262ac5784d9, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1b7ff262ac5784d9, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "gaia.globalfee.v1beta1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "gaia.globalfee.v1beta1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("gaia/globalfee/v1beta1/tx.proto", fileDescriptor_1b7ff262ac5784d9) } + +var fileDescriptor_1b7ff262ac5784d9 = []byte{ + // 360 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4f, 0x4f, 0xcc, 0x4c, + 0xd4, 0x4f, 0xcf, 0xc9, 0x4f, 0x4a, 0xcc, 0x49, 0x4b, 0x4d, 0xd5, 0x2f, 0x33, 0x4c, 0x4a, 0x2d, + 0x49, 0x34, 0xd4, 0x2f, 0xa9, 0xd0, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x03, 0x29, 0xd0, + 0x83, 0x2b, 0xd0, 0x83, 0x2a, 0x90, 0x12, 0x4c, 0xcc, 0xcd, 0xcc, 0xcb, 0xd7, 0x07, 0x93, 0x10, + 0xa5, 0x52, 0xe2, 0xc9, 0xf9, 0xc5, 0xb9, 0xf9, 0xc5, 0xfa, 0xb9, 0xc5, 0xe9, 0xfa, 0x65, 0x86, + 0x20, 0x0a, 0x2a, 0x21, 0x09, 0x91, 0x88, 0x07, 0xf3, 0xf4, 0x21, 0x1c, 0xa8, 0x94, 0x0a, 0x0e, + 0xfb, 0xd3, 0x53, 0xf3, 0x52, 0x8b, 0x33, 0x61, 0xaa, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0x21, 0xba, + 0x41, 0x2c, 0x88, 0xa8, 0xd2, 0x49, 0x46, 0x2e, 0x7e, 0xdf, 0xe2, 0xf4, 0xd0, 0x82, 0x94, 0xc4, + 0x92, 0xd4, 0x80, 0xc4, 0xa2, 0xc4, 0xdc, 0x62, 0x21, 0x33, 0x2e, 0xce, 0xc4, 0xd2, 0x92, 0x8c, + 0xfc, 0xa2, 0xcc, 0x92, 0x4a, 0x09, 0x46, 0x05, 0x46, 0x0d, 0x4e, 0x27, 0x89, 0x4b, 0x5b, 0x74, + 0x45, 0xa0, 0x96, 0x3a, 0xa6, 0xa4, 0x14, 0xa5, 0x16, 0x17, 0x07, 0x97, 0x14, 0x65, 0xe6, 0xa5, + 0x07, 0x21, 0x94, 0x0a, 0x39, 0x72, 0xb1, 0x15, 0x80, 0x4d, 0x90, 0x60, 0x52, 0x60, 0xd4, 0xe0, + 0x36, 0x92, 0xd3, 0xc3, 0xee, 0x6f, 0x3d, 0x88, 0x3d, 0x4e, 0x9c, 0x27, 0xee, 0xc9, 0x33, 0xac, + 0x78, 0xbe, 0x41, 0x8b, 0x31, 0x08, 0xaa, 0xd1, 0xca, 0xba, 0x63, 0x81, 0x3c, 0xc3, 0x8b, 0x05, + 0xf2, 0x0c, 0x4d, 0xcf, 0x37, 0x68, 0x21, 0x8c, 0xee, 0x7a, 0xbe, 0x41, 0x4b, 0x01, 0xec, 0xcb, + 0x0a, 0x24, 0x7f, 0xa2, 0xb9, 0x5b, 0x49, 0x92, 0x4b, 0x1c, 0x4d, 0x28, 0x28, 0xb5, 0xb8, 0x20, + 0x3f, 0xaf, 0x38, 0xd5, 0xa8, 0x8c, 0x8b, 0xd9, 0xb7, 0x38, 0x5d, 0x28, 0x83, 0x8b, 0x07, 0xc5, + 0xa7, 0xea, 0xb8, 0x5c, 0x88, 0x66, 0x8e, 0x94, 0x3e, 0x91, 0x0a, 0x61, 0x16, 0x4a, 0xb1, 0x36, + 0x80, 0xfc, 0xe5, 0xe4, 0x74, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, + 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x1a, + 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xd0, 0xd8, 0xd4, 0xc7, 0xf0, 0x60, + 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x38, 0xa6, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, + 0xf2, 0x7e, 0xbe, 0xcb, 0x67, 0x02, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // UpdateParams defines a governance operation for updating the x/mint module + // parameters. The authority is hard-coded to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/gaia.globalfee.v1beta1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // UpdateParams defines a governance operation for updating the x/mint module + // parameters. The authority is hard-coded to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/gaia.globalfee.v1beta1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var Msg_serviceDesc = _Msg_serviceDesc +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "gaia.globalfee.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "gaia/globalfee/v1beta1/tx.proto", +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/legacy/pob/README.md b/x/legacy/pob/README.md new file mode 100644 index 000000000..136ceebad --- /dev/null +++ b/x/legacy/pob/README.md @@ -0,0 +1,7 @@ +# Legacy proposer-builder protobuf compatibility + +This directory preserves only the generated protobuf types needed to decode historical governance state after the proposer-builder module was removed. + +Source: `github.com/skip-mev/pob/x/builder/types` at commit `5fdb53bc1feb` (`v0.0.0-20230906203828-5fdb53bc1feb`). The copied generated files are `tx.pb.go`, `genesis.pb.go`, and `codec.go`. + +The package is codec-only: it has no keeper, stores, module manager registration, transaction routing, or runtime behavior. Removing it makes `junod export` and historical governance queries panic when they encounter `/pob.builder.v1.MsgUpdateParams` retained in mainnet state. diff --git a/x/legacy/pob/types/codec.go b/x/legacy/pob/types/codec.go new file mode 100644 index 000000000..892d08986 --- /dev/null +++ b/x/legacy/pob/types/codec.go @@ -0,0 +1,43 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" + "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +var ( + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewLegacyAmino() +) + +func init() { + RegisterLegacyAminoCodec(amino) + cryptocodec.RegisterCrypto(amino) + sdk.RegisterLegacyAminoCodec(amino) +} + +// RegisterLegacyAminoCodec registers the necessary x/builder interfaces and +// concrete types on the provided LegacyAmino codec. These types are used for +// Amino JSON serialization. +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + legacy.RegisterAminoMsg(cdc, &MsgAuctionBid{}, "pob/x/builder/MsgAuctionBid") + legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "pob/x/builder/MsgUpdateParams") + + cdc.RegisterConcrete(Params{}, "pob/builder/Params", nil) +} + +// RegisterInterfaces registers the x/builder interfaces types with the +// interface registry. +func RegisterInterfaces(registry types.InterfaceRegistry) { + registry.RegisterImplementations( + (*sdk.Msg)(nil), + &MsgAuctionBid{}, + &MsgUpdateParams{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} diff --git a/x/legacy/pob/types/genesis.pb.go b/x/legacy/pob/types/genesis.pb.go new file mode 100644 index 000000000..44a077402 --- /dev/null +++ b/x/legacy/pob/types/genesis.pb.go @@ -0,0 +1,757 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pob/builder/v1/genesis.proto + +package types + +import ( + cosmossdk_io_math "cosmossdk.io/math" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + proto "github.com/cosmos/gogoproto/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the genesis state of the x/builder module. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_287f1bdff5ccfc33, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// Params defines the parameters of the x/builder module. +type Params struct { + // max_bundle_size is the maximum number of transactions that can be bundled + // in a single bundle. + MaxBundleSize uint32 `protobuf:"varint,1,opt,name=max_bundle_size,json=maxBundleSize,proto3" json:"max_bundle_size,omitempty"` + // escrow_account_address is the address of the account that will receive a + // portion of the bid proceeds. + EscrowAccountAddress []byte `protobuf:"bytes,2,opt,name=escrow_account_address,json=escrowAccountAddress,proto3" json:"escrow_account_address,omitempty"` + // reserve_fee specifies the bid floor for the auction. + ReserveFee types.Coin `protobuf:"bytes,3,opt,name=reserve_fee,json=reserveFee,proto3" json:"reserve_fee"` + // min_bid_increment specifies the minimum amount that the next bid must be + // greater than the previous bid. + MinBidIncrement types.Coin `protobuf:"bytes,4,opt,name=min_bid_increment,json=minBidIncrement,proto3" json:"min_bid_increment"` + // front_running_protection specifies whether front running and sandwich + // attack protection is enabled. + FrontRunningProtection bool `protobuf:"varint,5,opt,name=front_running_protection,json=frontRunningProtection,proto3" json:"front_running_protection,omitempty"` + // proposer_fee defines the portion of the winning bid that goes to the block + // proposer that proposed the block. + ProposerFee cosmossdk_io_math.LegacyDec `protobuf:"bytes,6,opt,name=proposer_fee,json=proposerFee,proto3,customtype=cosmossdk.io/math.LegacyDec" json:"proposer_fee"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_287f1bdff5ccfc33, []int{1} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetMaxBundleSize() uint32 { + if m != nil { + return m.MaxBundleSize + } + return 0 +} + +func (m *Params) GetEscrowAccountAddress() []byte { + if m != nil { + return m.EscrowAccountAddress + } + return nil +} + +func (m *Params) GetReserveFee() types.Coin { + if m != nil { + return m.ReserveFee + } + return types.Coin{} +} + +func (m *Params) GetMinBidIncrement() types.Coin { + if m != nil { + return m.MinBidIncrement + } + return types.Coin{} +} + +func (m *Params) GetFrontRunningProtection() bool { + if m != nil { + return m.FrontRunningProtection + } + return false +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "pob.builder.v1.GenesisState") + proto.RegisterType((*Params)(nil), "pob.builder.v1.Params") +} + +func init() { proto.RegisterFile("pob/builder/v1/genesis.proto", fileDescriptor_287f1bdff5ccfc33) } + +var fileDescriptor_287f1bdff5ccfc33 = []byte{ + // 499 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x86, 0x63, 0x5a, 0x22, 0xba, 0x49, 0xa9, 0x6a, 0x55, 0x91, 0x5b, 0x90, 0x1b, 0xf5, 0x00, + 0x51, 0xa5, 0xec, 0x2a, 0x80, 0x10, 0xe2, 0x96, 0x10, 0x8a, 0x90, 0x38, 0x44, 0xee, 0x09, 0x2e, + 0xd6, 0x7a, 0x3d, 0x75, 0x57, 0xe9, 0xee, 0x5a, 0xbb, 0x1b, 0x93, 0xf6, 0x11, 0x38, 0xf1, 0x18, + 0x1c, 0x7b, 0x40, 0x3c, 0x43, 0x8f, 0x15, 0x27, 0xc4, 0xa1, 0x42, 0xc9, 0xa1, 0xaf, 0x81, 0xec, + 0x75, 0x8b, 0x38, 0xf6, 0x62, 0xd9, 0xf3, 0xcd, 0xfc, 0xf3, 0xcf, 0x78, 0xd0, 0xe3, 0x5c, 0x25, + 0x24, 0x99, 0xf1, 0x93, 0x14, 0x34, 0x29, 0x06, 0x24, 0x03, 0x09, 0x86, 0x1b, 0x9c, 0x6b, 0x65, + 0x95, 0xff, 0x30, 0x57, 0x09, 0xae, 0x29, 0x2e, 0x06, 0x3b, 0x5b, 0x99, 0xca, 0x54, 0x85, 0x48, + 0xf9, 0xe6, 0xb2, 0x76, 0x42, 0xa6, 0x8c, 0x50, 0x86, 0x24, 0xd4, 0x00, 0x29, 0x06, 0x09, 0x58, + 0x3a, 0x20, 0x4c, 0x71, 0x59, 0xf3, 0x4d, 0x2a, 0xb8, 0x54, 0xa4, 0x7a, 0xd6, 0xa1, 0x6d, 0x57, + 0x12, 0x3b, 0x2d, 0xf7, 0xe1, 0xd0, 0xde, 0x18, 0xb5, 0xdf, 0x39, 0x13, 0x87, 0x96, 0x5a, 0xf0, + 0x5f, 0xa0, 0x66, 0x4e, 0x35, 0x15, 0x26, 0xf0, 0xba, 0x5e, 0xaf, 0xf5, 0xac, 0x83, 0xff, 0x37, + 0x85, 0x27, 0x15, 0x1d, 0xad, 0x5e, 0x5c, 0xed, 0x36, 0xa2, 0x3a, 0x77, 0xef, 0xc7, 0x0a, 0x6a, + 0x3a, 0xe0, 0x3f, 0x41, 0x1b, 0x82, 0xce, 0xe3, 0x64, 0x26, 0xd3, 0x13, 0x88, 0x0d, 0x3f, 0x83, + 0x4a, 0x69, 0x3d, 0x5a, 0x17, 0x74, 0x3e, 0xaa, 0xa2, 0x87, 0xfc, 0xac, 0x6c, 0xd4, 0x01, 0xc3, + 0xb4, 0xfa, 0x1c, 0x53, 0xc6, 0xd4, 0x4c, 0xda, 0x98, 0xa6, 0xa9, 0x06, 0x63, 0x82, 0x7b, 0x5d, + 0xaf, 0xd7, 0x8e, 0xb6, 0x1c, 0x1d, 0x3a, 0x38, 0x74, 0xcc, 0x7f, 0x8b, 0x5a, 0x1a, 0x0c, 0xe8, + 0x02, 0xe2, 0x23, 0x80, 0x60, 0xa5, 0xf2, 0xb8, 0x8d, 0xeb, 0x91, 0xca, 0x95, 0xe0, 0x7a, 0x25, + 0xf8, 0x8d, 0xe2, 0x72, 0xb4, 0x56, 0xda, 0xfc, 0x76, 0x7d, 0xbe, 0xef, 0x45, 0xa8, 0x2e, 0x3c, + 0x00, 0xf0, 0x27, 0x68, 0x53, 0x70, 0x19, 0x27, 0x3c, 0x8d, 0xb9, 0x64, 0x1a, 0x04, 0x48, 0x1b, + 0xac, 0xde, 0x41, 0x6c, 0x43, 0x70, 0x39, 0xe2, 0xe9, 0xfb, 0x9b, 0x62, 0xff, 0x15, 0x0a, 0x8e, + 0xb4, 0x92, 0x36, 0xd6, 0x33, 0x29, 0xb9, 0xcc, 0xaa, 0x5d, 0x03, 0xb3, 0x5c, 0xc9, 0xe0, 0x7e, + 0xd7, 0xeb, 0x3d, 0x88, 0x3a, 0x15, 0x8f, 0x1c, 0x9e, 0xdc, 0x52, 0xff, 0x23, 0x6a, 0xe7, 0x5a, + 0xe5, 0xca, 0x80, 0xae, 0x66, 0x6a, 0x76, 0xbd, 0xde, 0xda, 0xe8, 0x65, 0xd9, 0xeb, 0xf7, 0xd5, + 0xee, 0x23, 0xe7, 0xc6, 0xa4, 0x53, 0xcc, 0x15, 0x11, 0xd4, 0x1e, 0xe3, 0x0f, 0x90, 0x51, 0x76, + 0x3a, 0x06, 0xf6, 0xf3, 0x7b, 0x1f, 0xd5, 0x66, 0xc7, 0xc0, 0x9c, 0xb1, 0xd6, 0x8d, 0xd6, 0x01, + 0xc0, 0xeb, 0xee, 0x97, 0xeb, 0xf3, 0xfd, 0x5a, 0xa1, 0x6f, 0xd2, 0x29, 0x99, 0xdf, 0x1e, 0x5f, + 0xfd, 0x1b, 0x87, 0x17, 0x8b, 0xd0, 0xbb, 0x5c, 0x84, 0xde, 0x9f, 0x45, 0xe8, 0x7d, 0x5d, 0x86, + 0x8d, 0xcb, 0x65, 0xd8, 0xf8, 0xb5, 0x0c, 0x1b, 0x9f, 0x9e, 0x66, 0xdc, 0x1e, 0xcf, 0x12, 0xcc, + 0x94, 0x20, 0x66, 0xca, 0xf3, 0xbe, 0x80, 0x82, 0x94, 0xe7, 0xfb, 0x4f, 0xc3, 0x9e, 0xe6, 0x60, + 0x92, 0x66, 0x75, 0x48, 0xcf, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x0b, 0xb6, 0x7e, 0x29, 0xdc, + 0x02, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.ProposerFee.Size() + i -= size + if _, err := m.ProposerFee.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + if m.FrontRunningProtection { + i-- + if m.FrontRunningProtection { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + { + size, err := m.MinBidIncrement.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + { + size, err := m.ReserveFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.EscrowAccountAddress) > 0 { + i -= len(m.EscrowAccountAddress) + copy(dAtA[i:], m.EscrowAccountAddress) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.EscrowAccountAddress))) + i-- + dAtA[i] = 0x12 + } + if m.MaxBundleSize != 0 { + i = encodeVarintGenesis(dAtA, i, uint64(m.MaxBundleSize)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.MaxBundleSize != 0 { + n += 1 + sovGenesis(uint64(m.MaxBundleSize)) + } + l = len(m.EscrowAccountAddress) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = m.ReserveFee.Size() + n += 1 + l + sovGenesis(uint64(l)) + l = m.MinBidIncrement.Size() + n += 1 + l + sovGenesis(uint64(l)) + if m.FrontRunningProtection { + n += 2 + } + l = m.ProposerFee.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Params) 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 ErrIntOverflowGenesis + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field MaxBundleSize", wireType) + } + m.MaxBundleSize = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.MaxBundleSize |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EscrowAccountAddress", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EscrowAccountAddress = append(m.EscrowAccountAddress[:0], dAtA[iNdEx:postIndex]...) + if m.EscrowAccountAddress == nil { + m.EscrowAccountAddress = []byte{} + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ReserveFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ReserveFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinBidIncrement", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinBidIncrement.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field FrontRunningProtection", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.FrontRunningProtection = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerFee", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.ProposerFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/legacy/pob/types/tx.pb.go b/x/legacy/pob/types/tx.pb.go new file mode 100644 index 000000000..224f734b4 --- /dev/null +++ b/x/legacy/pob/types/tx.pb.go @@ -0,0 +1,1054 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: pob/builder/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/cosmos/cosmos-sdk/types/tx/amino" + _ "github.com/cosmos/gogoproto/gogoproto" + grpc1 "github.com/cosmos/gogoproto/grpc" + proto "github.com/cosmos/gogoproto/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgAuctionBid defines a request type for sending bids to the x/builder +// module. +type MsgAuctionBid struct { + // bidder is the address of the account that is submitting a bid to the + // auction. + Bidder string `protobuf:"bytes,1,opt,name=bidder,proto3" json:"bidder,omitempty"` + // bid is the amount of coins that the bidder is bidding to participate in the + // auction. + Bid types.Coin `protobuf:"bytes,2,opt,name=bid,proto3" json:"bid"` + // transactions are the bytes of the transactions that the bidder wants to + // bundle together. + Transactions [][]byte `protobuf:"bytes,3,rep,name=transactions,proto3" json:"transactions,omitempty"` +} + +func (m *MsgAuctionBid) Reset() { *m = MsgAuctionBid{} } +func (m *MsgAuctionBid) String() string { return proto.CompactTextString(m) } +func (*MsgAuctionBid) ProtoMessage() {} +func (*MsgAuctionBid) Descriptor() ([]byte, []int) { + return fileDescriptor_5cab4e3a4b082d0a, []int{0} +} +func (m *MsgAuctionBid) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAuctionBid) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAuctionBid.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 *MsgAuctionBid) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAuctionBid.Merge(m, src) +} +func (m *MsgAuctionBid) XXX_Size() int { + return m.Size() +} +func (m *MsgAuctionBid) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAuctionBid.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAuctionBid proto.InternalMessageInfo + +func (m *MsgAuctionBid) GetBidder() string { + if m != nil { + return m.Bidder + } + return "" +} + +func (m *MsgAuctionBid) GetBid() types.Coin { + if m != nil { + return m.Bid + } + return types.Coin{} +} + +func (m *MsgAuctionBid) GetTransactions() [][]byte { + if m != nil { + return m.Transactions + } + return nil +} + +// MsgAuctionBidResponse defines the Msg/AuctionBid response type. +type MsgAuctionBidResponse struct { +} + +func (m *MsgAuctionBidResponse) Reset() { *m = MsgAuctionBidResponse{} } +func (m *MsgAuctionBidResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAuctionBidResponse) ProtoMessage() {} +func (*MsgAuctionBidResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5cab4e3a4b082d0a, []int{1} +} +func (m *MsgAuctionBidResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAuctionBidResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAuctionBidResponse.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 *MsgAuctionBidResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAuctionBidResponse.Merge(m, src) +} +func (m *MsgAuctionBidResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAuctionBidResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAuctionBidResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAuctionBidResponse proto.InternalMessageInfo + +// MsgUpdateParams defines a request type for updating the x/builder module +// parameters. +type MsgUpdateParams struct { + // authority is the address of the account that is authorized to update the + // x/builder module parameters. + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // params is the new parameters for the x/builder module. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_5cab4e3a4b082d0a, []int{2} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the Msg/UpdateParams response type. +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_5cab4e3a4b082d0a, []int{3} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgAuctionBid)(nil), "pob.builder.v1.MsgAuctionBid") + proto.RegisterType((*MsgAuctionBidResponse)(nil), "pob.builder.v1.MsgAuctionBidResponse") + proto.RegisterType((*MsgUpdateParams)(nil), "pob.builder.v1.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "pob.builder.v1.MsgUpdateParamsResponse") +} + +func init() { proto.RegisterFile("pob/builder/v1/tx.proto", fileDescriptor_5cab4e3a4b082d0a) } + +var fileDescriptor_5cab4e3a4b082d0a = []byte{ + // 525 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x52, 0xcf, 0x6b, 0x13, 0x41, + 0x14, 0xce, 0x34, 0x1a, 0xc8, 0x18, 0x15, 0xd7, 0xd6, 0xfc, 0xa8, 0xdd, 0x84, 0x05, 0x69, 0x08, + 0x74, 0xc7, 0xd4, 0xd2, 0x43, 0x6f, 0x59, 0xcf, 0x01, 0x59, 0x11, 0xc4, 0x8b, 0xcc, 0x66, 0x87, + 0xe9, 0x60, 0x77, 0x66, 0xd9, 0x99, 0x84, 0xf6, 0x26, 0x3d, 0x7a, 0x12, 0xfc, 0x07, 0x3c, 0x7a, + 0xcc, 0x41, 0xff, 0x87, 0x9e, 0xa4, 0xe8, 0x41, 0x4f, 0x22, 0x89, 0x10, 0xff, 0x0c, 0x99, 0xdd, + 0xd9, 0x36, 0x1b, 0xc5, 0x5e, 0x42, 0xf6, 0x7d, 0xdf, 0xfb, 0xde, 0xfb, 0xbe, 0x79, 0xb0, 0x1e, + 0x8b, 0x00, 0x05, 0x63, 0x76, 0x14, 0x92, 0x04, 0x4d, 0xfa, 0x48, 0x1d, 0xbb, 0x71, 0x22, 0x94, + 0xb0, 0x6e, 0xc5, 0x22, 0x70, 0x0d, 0xe0, 0x4e, 0xfa, 0xad, 0x75, 0x2a, 0xa8, 0x48, 0x21, 0xa4, + 0xff, 0x65, 0xac, 0xd6, 0x7d, 0x2a, 0x04, 0x3d, 0x22, 0x08, 0xc7, 0x0c, 0x61, 0xce, 0x85, 0xc2, + 0x8a, 0x09, 0x2e, 0x0d, 0x6a, 0x8f, 0x84, 0x8c, 0x84, 0x44, 0x01, 0x96, 0x04, 0x4d, 0xfa, 0x01, + 0x51, 0xb8, 0x8f, 0x46, 0x82, 0xf1, 0xbc, 0x7b, 0x65, 0x38, 0x25, 0x9c, 0x48, 0x96, 0x77, 0x37, + 0xb3, 0xee, 0x97, 0xd9, 0xd0, 0xec, 0xc3, 0x40, 0x75, 0x23, 0x1c, 0x49, 0xaa, 0xfb, 0x22, 0x49, + 0x0d, 0x70, 0x07, 0x47, 0x8c, 0x0b, 0x94, 0xfe, 0x66, 0x25, 0xe7, 0x33, 0x80, 0x37, 0x87, 0x92, + 0x0e, 0xc6, 0x23, 0xbd, 0x9a, 0xc7, 0x42, 0xeb, 0x21, 0xac, 0x04, 0x2c, 0x0c, 0x49, 0xd2, 0x00, + 0x1d, 0xd0, 0xad, 0x7a, 0x8d, 0x2f, 0x1f, 0x77, 0xd6, 0x8d, 0xfe, 0x20, 0x0c, 0x13, 0x22, 0xe5, + 0x53, 0x95, 0x30, 0x4e, 0x7d, 0xc3, 0xb3, 0xf6, 0x61, 0x39, 0x60, 0x61, 0x63, 0xad, 0x03, 0xba, + 0x37, 0x76, 0x9b, 0xae, 0xe1, 0x6a, 0x5b, 0xae, 0xb1, 0xe5, 0x3e, 0x16, 0x8c, 0x7b, 0xd5, 0xb3, + 0x1f, 0xed, 0xd2, 0x87, 0xc5, 0xb4, 0x07, 0x7c, 0xdd, 0x60, 0x39, 0xb0, 0xa6, 0x12, 0xcc, 0x25, + 0x4e, 0x67, 0xcb, 0x46, 0xb9, 0x53, 0xee, 0xd6, 0xfc, 0x42, 0xed, 0x00, 0xfd, 0x7e, 0xdf, 0x2e, + 0x9d, 0x2e, 0xa6, 0x3d, 0x33, 0xec, 0xcd, 0x62, 0xda, 0xdb, 0xd4, 0xc1, 0x1c, 0x5f, 0x44, 0x53, + 0x58, 0xdf, 0xa9, 0xc3, 0x8d, 0x42, 0xc1, 0x27, 0x32, 0x16, 0x5c, 0x12, 0xe7, 0x13, 0x80, 0xb7, + 0x87, 0x92, 0x3e, 0x8b, 0x43, 0xac, 0xc8, 0x13, 0x9c, 0xe0, 0x48, 0x5a, 0xfb, 0xb0, 0x8a, 0xc7, + 0xea, 0x50, 0x24, 0x4c, 0x9d, 0x5c, 0x69, 0xf7, 0x92, 0x6a, 0xed, 0xc1, 0x4a, 0x9c, 0x2a, 0x18, + 0xd3, 0xf7, 0xdc, 0xe2, 0x3d, 0xb8, 0x99, 0xbe, 0x77, 0x4d, 0x3b, 0xf6, 0x0d, 0xf7, 0x60, 0x2f, + 0xf7, 0x72, 0xa9, 0xa4, 0xed, 0x6c, 0xfd, 0x65, 0x67, 0x79, 0x47, 0xa7, 0x09, 0xeb, 0x2b, 0xa5, + 0xdc, 0xd2, 0xee, 0x37, 0x00, 0xcb, 0x43, 0x49, 0x2d, 0x01, 0xe1, 0xd2, 0x03, 0x6e, 0xad, 0x2e, + 0x53, 0xc8, 0xa3, 0xf5, 0xe0, 0xbf, 0xf0, 0x45, 0x5c, 0x9b, 0xa7, 0x5f, 0x7f, 0xbd, 0x5b, 0xdb, + 0x70, 0xee, 0xa2, 0x95, 0x33, 0xd4, 0x2f, 0xf7, 0x1c, 0xd6, 0x0a, 0x39, 0xb6, 0xff, 0xa1, 0xb9, + 0x4c, 0x68, 0x6d, 0x5f, 0x41, 0xc8, 0xc7, 0xb6, 0xae, 0xbf, 0xd6, 0xf7, 0xe1, 0x0d, 0xce, 0x66, + 0x36, 0x38, 0x9f, 0xd9, 0xe0, 0xe7, 0xcc, 0x06, 0x6f, 0xe7, 0x76, 0xe9, 0x7c, 0x6e, 0x97, 0xbe, + 0xcf, 0xed, 0xd2, 0x8b, 0x6d, 0xca, 0xd4, 0xe1, 0x38, 0x70, 0x47, 0x22, 0x42, 0xf2, 0x15, 0x8b, + 0x77, 0x22, 0x32, 0x41, 0xc5, 0x04, 0xd5, 0x49, 0x4c, 0x64, 0x50, 0x49, 0x0f, 0xfc, 0xd1, 0x9f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xf0, 0xeb, 0xfe, 0x5c, 0xc4, 0x03, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // AuctionBid defines a method for sending bids to the x/builder module. + AuctionBid(ctx context.Context, in *MsgAuctionBid, opts ...grpc.CallOption) (*MsgAuctionBidResponse, error) + // UpdateParams defines a governance operation for updating the x/builder + // module parameters. The authority is hard-coded to the x/gov module account. + UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) AuctionBid(ctx context.Context, in *MsgAuctionBid, opts ...grpc.CallOption) (*MsgAuctionBidResponse, error) { + out := new(MsgAuctionBidResponse) + err := c.cc.Invoke(ctx, "/pob.builder.v1.Msg/AuctionBid", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) { + out := new(MsgUpdateParamsResponse) + err := c.cc.Invoke(ctx, "/pob.builder.v1.Msg/UpdateParams", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // AuctionBid defines a method for sending bids to the x/builder module. + AuctionBid(context.Context, *MsgAuctionBid) (*MsgAuctionBidResponse, error) + // UpdateParams defines a governance operation for updating the x/builder + // module parameters. The authority is hard-coded to the x/gov module account. + UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) AuctionBid(ctx context.Context, req *MsgAuctionBid) (*MsgAuctionBidResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AuctionBid not implemented") +} +func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateParams) (*MsgUpdateParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_AuctionBid_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAuctionBid) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AuctionBid(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pob.builder.v1.Msg/AuctionBid", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AuctionBid(ctx, req.(*MsgAuctionBid)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateParams) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateParams(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pob.builder.v1.Msg/UpdateParams", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "pob.builder.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "AuctionBid", + Handler: _Msg_AuctionBid_Handler, + }, + { + MethodName: "UpdateParams", + Handler: _Msg_UpdateParams_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "pob/builder/v1/tx.proto", +} + +func (m *MsgAuctionBid) 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 *MsgAuctionBid) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAuctionBid) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Transactions) > 0 { + for iNdEx := len(m.Transactions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Transactions[iNdEx]) + copy(dAtA[i:], m.Transactions[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Transactions[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.Bid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Bidder) > 0 { + i -= len(m.Bidder) + copy(dAtA[i:], m.Bidder) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bidder))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAuctionBidResponse) 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 *MsgAuctionBidResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAuctionBidResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgAuctionBid) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Bidder) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Bid.Size() + n += 1 + l + sovTx(uint64(l)) + if len(m.Transactions) > 0 { + for _, b := range m.Transactions { + l = len(b) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgAuctionBidResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgAuctionBid) 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 ErrIntOverflowTx + } + 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: MsgAuctionBid: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAuctionBid: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bidder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bidder = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Bid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Transactions", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Transactions = append(m.Transactions, make([]byte, postIndex-iNdEx)) + copy(m.Transactions[len(m.Transactions)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAuctionBidResponse) 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 ErrIntOverflowTx + } + 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: MsgAuctionBidResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAuctionBidResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParams) 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 ErrIntOverflowTx + } + 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: MsgUpdateParams: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + 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 ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authority = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) 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 ErrIntOverflowTx + } + 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: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/mint/keeper/genesis.go b/x/mint/keeper/genesis.go index df1ffd780..5d488676a 100644 --- a/x/mint/keeper/genesis.go +++ b/x/mint/keeper/genesis.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) // InitGenesis new mint genesis diff --git a/x/mint/keeper/genesis_test.go b/x/mint/keeper/genesis_test.go index 988e55c52..3f50ef2a7 100644 --- a/x/mint/keeper/genesis_test.go +++ b/x/mint/keeper/genesis_test.go @@ -3,7 +3,7 @@ package keeper_test import ( sdkmath "cosmossdk.io/math" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) func (s *KeeperTestSuite) TestImportExportGenesis() { diff --git a/x/mint/keeper/grpc_query.go b/x/mint/keeper/grpc_query.go index b77fa211d..d716d02a5 100644 --- a/x/mint/keeper/grpc_query.go +++ b/x/mint/keeper/grpc_query.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) var _ types.QueryServer = queryServer{} diff --git a/x/mint/keeper/grpc_query_test.go b/x/mint/keeper/grpc_query_test.go index c0dbec998..8536a99a2 100644 --- a/x/mint/keeper/grpc_query_test.go +++ b/x/mint/keeper/grpc_query_test.go @@ -1,7 +1,7 @@ package keeper_test import ( - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) func (s *KeeperTestSuite) TestGRPCParams() { diff --git a/x/mint/keeper/keeper.go b/x/mint/keeper/keeper.go index 905d7e9b1..88c2d0de1 100644 --- a/x/mint/keeper/keeper.go +++ b/x/mint/keeper/keeper.go @@ -13,7 +13,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) // Keeper of the mint store diff --git a/x/mint/keeper/keeper_test.go b/x/mint/keeper/keeper_test.go index 4695248f1..e94059c09 100644 --- a/x/mint/keeper/keeper_test.go +++ b/x/mint/keeper/keeper_test.go @@ -7,9 +7,9 @@ import ( authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" - "github.com/CosmosContracts/juno/v30/testutil" - "github.com/CosmosContracts/juno/v30/x/mint/keeper" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/testutil" + "github.com/CosmosContracts/juno/v31/x/mint/keeper" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) type KeeperTestSuite struct { diff --git a/x/mint/keeper/msg_server.go b/x/mint/keeper/msg_server.go index 5d92ba60b..176bf2c6d 100644 --- a/x/mint/keeper/msg_server.go +++ b/x/mint/keeper/msg_server.go @@ -7,7 +7,7 @@ import ( sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) var _ types.MsgServer = msgServer{} diff --git a/x/mint/module/abci.go b/x/mint/module/abci.go index a0313915c..0f2d5ef66 100644 --- a/x/mint/module/abci.go +++ b/x/mint/module/abci.go @@ -9,8 +9,8 @@ import ( "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/mint/keeper" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/keeper" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) // BeginBlocker mints new tokens for the previous block. diff --git a/x/mint/module/autocli.go b/x/mint/module/autocli.go index cf74c8c51..557861a3a 100644 --- a/x/mint/module/autocli.go +++ b/x/mint/module/autocli.go @@ -3,7 +3,7 @@ package module import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - mintv1 "github.com/CosmosContracts/juno/v30/api/juno/mint/v1" + mintv1 "github.com/CosmosContracts/juno/v31/api/juno/mint/v1" ) func (AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { diff --git a/x/mint/module/module.go b/x/mint/module/module.go index e87e0e563..67fb56048 100644 --- a/x/mint/module/module.go +++ b/x/mint/module/module.go @@ -17,9 +17,9 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/CosmosContracts/juno/v30/x/mint/keeper" - "github.com/CosmosContracts/juno/v30/x/mint/simulation" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/keeper" + "github.com/CosmosContracts/juno/v31/x/mint/simulation" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) // ConsensusVersion defines the current x/mint module consensus version. diff --git a/x/mint/simulation/decoder.go b/x/mint/simulation/decoder.go index d2cc22039..e060db24c 100644 --- a/x/mint/simulation/decoder.go +++ b/x/mint/simulation/decoder.go @@ -7,7 +7,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/kv" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) // NewDecodeStore returns a decoder function closure that unmarshals the KVPair's diff --git a/x/mint/simulation/decoder_test.go b/x/mint/simulation/decoder_test.go index d438fb024..e713d20f6 100644 --- a/x/mint/simulation/decoder_test.go +++ b/x/mint/simulation/decoder_test.go @@ -12,8 +12,8 @@ import ( moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" "github.com/cosmos/cosmos-sdk/x/auth" - "github.com/CosmosContracts/juno/v30/x/mint/simulation" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/simulation" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) // TestDecodeStore tests the decoding of the store diff --git a/x/mint/simulation/genesis.go b/x/mint/simulation/genesis.go index 770f81a59..58ee79a8c 100644 --- a/x/mint/simulation/genesis.go +++ b/x/mint/simulation/genesis.go @@ -12,7 +12,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) // Simulation parameter constants diff --git a/x/mint/simulation/genesis_test.go b/x/mint/simulation/genesis_test.go index 818d69140..24df5c0b0 100644 --- a/x/mint/simulation/genesis_test.go +++ b/x/mint/simulation/genesis_test.go @@ -14,8 +14,8 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/CosmosContracts/juno/v30/x/mint/simulation" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/simulation" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) // TestRandomizedGenState tests the normal scenario of applying RandomizedGenState. diff --git a/x/mint/simulation/proposals.go b/x/mint/simulation/proposals.go index 9bfdac486..e020fa1a6 100644 --- a/x/mint/simulation/proposals.go +++ b/x/mint/simulation/proposals.go @@ -8,7 +8,7 @@ import ( simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/CosmosContracts/juno/v30/x/mint/types" + "github.com/CosmosContracts/juno/v31/x/mint/types" ) // Simulation operation weights constants diff --git a/x/stream/keeper/keeper.go b/x/stream/keeper/keeper.go index 42e524c3d..e4d847068 100644 --- a/x/stream/keeper/keeper.go +++ b/x/stream/keeper/keeper.go @@ -11,8 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" - "github.com/CosmosContracts/juno/v30/x/stream/types" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/x/stream/types" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) // Keeper defines the stream module keeper diff --git a/x/stream/keeper/keeper_test.go b/x/stream/keeper/keeper_test.go index 5a44f8e9e..c16aa454f 100644 --- a/x/stream/keeper/keeper_test.go +++ b/x/stream/keeper/keeper_test.go @@ -13,9 +13,9 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - "github.com/CosmosContracts/juno/v30/testutil" - "github.com/CosmosContracts/juno/v30/x/stream/types" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/testutil" + "github.com/CosmosContracts/juno/v31/x/stream/types" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) type KeeperTestSuite struct { diff --git a/x/stream/keeper/query_server.go b/x/stream/keeper/query_server.go index d9ae8a62a..1344ef65c 100644 --- a/x/stream/keeper/query_server.go +++ b/x/stream/keeper/query_server.go @@ -13,8 +13,8 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/CosmosContracts/juno/v30/x/stream/types" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/x/stream/types" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) var _ types.QueryServer = queryServer{} diff --git a/x/stream/module/module.go b/x/stream/module/module.go index 052a8840b..69b77a74a 100644 --- a/x/stream/module/module.go +++ b/x/stream/module/module.go @@ -10,8 +10,8 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/CosmosContracts/juno/v30/x/stream/keeper" - "github.com/CosmosContracts/juno/v30/x/stream/types" + "github.com/CosmosContracts/juno/v31/x/stream/keeper" + "github.com/CosmosContracts/juno/v31/x/stream/types" ) var ( diff --git a/x/stream/types/dispatcher.go b/x/stream/types/dispatcher.go index 038f3c2ae..5ab018035 100644 --- a/x/stream/types/dispatcher.go +++ b/x/stream/types/dispatcher.go @@ -6,7 +6,7 @@ import ( "cosmossdk.io/log" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) // Dispatcher handles the routing of state events to subscriptions diff --git a/x/stream/types/invoker.go b/x/stream/types/invoker.go index 73f3177ff..440367a1c 100644 --- a/x/stream/types/invoker.go +++ b/x/stream/types/invoker.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/codec" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) // RouterInvoker routes gRPC queries through BaseApp's GRPCQueryRouter. diff --git a/x/stream/types/listener.go b/x/stream/types/listener.go index 457613708..c92709ba3 100644 --- a/x/stream/types/listener.go +++ b/x/stream/types/listener.go @@ -9,7 +9,7 @@ import ( "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) // StreamingListener implements the ABCIListener interface for the stream module diff --git a/x/stream/types/stream.go b/x/stream/types/stream.go index 5fdf5010d..9510ba4c5 100644 --- a/x/stream/types/stream.go +++ b/x/stream/types/stream.go @@ -10,7 +10,7 @@ import ( "cosmossdk.io/log" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) // ResolvedStream contains the metadata required to service a dynamic stream. diff --git a/x/stream/types/stream_test.go b/x/stream/types/stream_test.go index 6ed71fa6e..5f2efd8cd 100644 --- a/x/stream/types/stream_test.go +++ b/x/stream/types/stream_test.go @@ -15,7 +15,7 @@ import ( "cosmossdk.io/log" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) func TestRunStreamSkipsIdenticalPayloads(t *testing.T) { diff --git a/x/stream/types/subscription_registry.go b/x/stream/types/subscription_registry.go index bf66eeacf..f2b896666 100644 --- a/x/stream/types/subscription_registry.go +++ b/x/stream/types/subscription_registry.go @@ -13,7 +13,7 @@ import ( "cosmossdk.io/log" - "github.com/CosmosContracts/juno/v30/x/stream/types/encoding" + "github.com/CosmosContracts/juno/v31/x/stream/types/encoding" ) // ConnectionMetadata captures identifying information for a subscriber connection. diff --git a/x/tokenfactory/keeper/admins.go b/x/tokenfactory/keeper/admins.go index 7e3d49c27..c406ded29 100644 --- a/x/tokenfactory/keeper/admins.go +++ b/x/tokenfactory/keeper/admins.go @@ -5,7 +5,7 @@ import ( "github.com/cosmos/gogoproto/proto" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) // GetAuthorityMetadata returns the authority metadata for a specific denom diff --git a/x/tokenfactory/keeper/admins_test.go b/x/tokenfactory/keeper/admins_test.go index d6b1dba27..9ac321f43 100644 --- a/x/tokenfactory/keeper/admins_test.go +++ b/x/tokenfactory/keeper/admins_test.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) func (s *KeeperTestSuite) TestAdminMsgs() { diff --git a/x/tokenfactory/keeper/bankactions.go b/x/tokenfactory/keeper/bankactions.go index 2c3a10211..20982edf4 100644 --- a/x/tokenfactory/keeper/bankactions.go +++ b/x/tokenfactory/keeper/bankactions.go @@ -5,7 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) func (k Keeper) mintTo(ctx context.Context, amount sdk.Coin, mintTo string) error { diff --git a/x/tokenfactory/keeper/createdenom.go b/x/tokenfactory/keeper/createdenom.go index b907ca131..2b3786c86 100644 --- a/x/tokenfactory/keeper/createdenom.go +++ b/x/tokenfactory/keeper/createdenom.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) // CreateDenom handles the full token creation flow from input validation to payment to token creation diff --git a/x/tokenfactory/keeper/createdenom_test.go b/x/tokenfactory/keeper/createdenom_test.go index cc5e6aa8c..9fcb96120 100644 --- a/x/tokenfactory/keeper/createdenom_test.go +++ b/x/tokenfactory/keeper/createdenom_test.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) func (s *KeeperTestSuite) TestMsgCreateDenom() { diff --git a/x/tokenfactory/keeper/genesis.go b/x/tokenfactory/keeper/genesis.go index d28616f7a..6ea3bff2c 100644 --- a/x/tokenfactory/keeper/genesis.go +++ b/x/tokenfactory/keeper/genesis.go @@ -3,7 +3,7 @@ package keeper import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) // InitGenesis initializes the tokenfactory module's state from a provided genesis diff --git a/x/tokenfactory/keeper/genesis_test.go b/x/tokenfactory/keeper/genesis_test.go index 42532db60..8885a5b33 100644 --- a/x/tokenfactory/keeper/genesis_test.go +++ b/x/tokenfactory/keeper/genesis_test.go @@ -4,7 +4,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) func (s *KeeperTestSuite) TestGenesis() { diff --git a/x/tokenfactory/keeper/grpc_query.go b/x/tokenfactory/keeper/grpc_query.go index 5237a25d6..ca318f381 100644 --- a/x/tokenfactory/keeper/grpc_query.go +++ b/x/tokenfactory/keeper/grpc_query.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) var _ types.QueryServer = queryServer{} diff --git a/x/tokenfactory/keeper/keeper.go b/x/tokenfactory/keeper/keeper.go index c18b760cf..6679eec7b 100644 --- a/x/tokenfactory/keeper/keeper.go +++ b/x/tokenfactory/keeper/keeper.go @@ -17,7 +17,7 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" distrkeeper "github.com/cosmos/cosmos-sdk/x/distribution/keeper" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) type Keeper struct { diff --git a/x/tokenfactory/keeper/keeper_test.go b/x/tokenfactory/keeper/keeper_test.go index 0ff20dd07..ab81bc744 100644 --- a/x/tokenfactory/keeper/keeper_test.go +++ b/x/tokenfactory/keeper/keeper_test.go @@ -14,9 +14,9 @@ import ( bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/CosmosContracts/juno/v30/testutil" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/keeper" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/testutil" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/keeper" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) type KeeperTestSuite struct { diff --git a/x/tokenfactory/keeper/msg_server.go b/x/tokenfactory/keeper/msg_server.go index 273961e90..d3b74601d 100644 --- a/x/tokenfactory/keeper/msg_server.go +++ b/x/tokenfactory/keeper/msg_server.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) var _ types.MsgServer = msgServer{} diff --git a/x/tokenfactory/keeper/msg_server_test.go b/x/tokenfactory/keeper/msg_server_test.go index 96e42f471..afd19c73b 100644 --- a/x/tokenfactory/keeper/msg_server_test.go +++ b/x/tokenfactory/keeper/msg_server_test.go @@ -6,7 +6,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) // TestMintDenomMsg tests TypeMsgMint message is emitted on a successful mint diff --git a/x/tokenfactory/keeper/params.go b/x/tokenfactory/keeper/params.go index 328a2a15f..4d1b596d5 100644 --- a/x/tokenfactory/keeper/params.go +++ b/x/tokenfactory/keeper/params.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) // SetParams sets the x/tokenfactory module parameters. diff --git a/x/tokenfactory/module/autocli.go b/x/tokenfactory/module/autocli.go index 49f9010a4..cc1daa9bd 100644 --- a/x/tokenfactory/module/autocli.go +++ b/x/tokenfactory/module/autocli.go @@ -3,7 +3,7 @@ package module import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - tokenfactoryv1beta1 "github.com/CosmosContracts/juno/v30/api/osmosis/tokenfactory/v1beta1" + tokenfactoryv1beta1 "github.com/CosmosContracts/juno/v31/api/osmosis/tokenfactory/v1beta1" ) // AutoCLIOptions implements the autocli.HasAutoCLIConfig interface. diff --git a/x/tokenfactory/module/module.go b/x/tokenfactory/module/module.go index e9852a19a..b2579d3c3 100644 --- a/x/tokenfactory/module/module.go +++ b/x/tokenfactory/module/module.go @@ -18,8 +18,8 @@ import ( authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/keeper" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/keeper" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) var ( diff --git a/x/tokenfactory/types/codec_test.go b/x/tokenfactory/types/codec_test.go index 740ea7629..5224a4e82 100644 --- a/x/tokenfactory/types/codec_test.go +++ b/x/tokenfactory/types/codec_test.go @@ -8,7 +8,7 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) type CodecTestSuite struct { diff --git a/x/tokenfactory/types/denoms_test.go b/x/tokenfactory/types/denoms_test.go index 40fd4a7a7..b06fe2316 100644 --- a/x/tokenfactory/types/denoms_test.go +++ b/x/tokenfactory/types/denoms_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) func TestDeconstructDenom(t *testing.T) { diff --git a/x/tokenfactory/types/genesis_test.go b/x/tokenfactory/types/genesis_test.go index 1f8628358..354b5338d 100644 --- a/x/tokenfactory/types/genesis_test.go +++ b/x/tokenfactory/types/genesis_test.go @@ -5,7 +5,7 @@ import ( "github.com/stretchr/testify/require" - "github.com/CosmosContracts/juno/v30/x/tokenfactory/types" + "github.com/CosmosContracts/juno/v31/x/tokenfactory/types" ) func TestGenesisState_Validate(t *testing.T) { diff --git a/x/voting-snapshot/BENCHMARKS.md b/x/voting-snapshot/BENCHMARKS.md new file mode 100644 index 000000000..0a413d83f --- /dev/null +++ b/x/voting-snapshot/BENCHMARKS.md @@ -0,0 +1,42 @@ +# Voting-snapshot EndBlock benchmark + +This benchmark is the v31 release gate for the rare validator-wide paths used by slashing and bonded-status transitions. It uses deterministic addresses and a mainnet-shaped validator with 1,000, 6,000, and 10,001 delegators. Every operation includes both the staking hook’s validator walk and voting-snapshot’s same-block EndBlock drain. + +## Run + +From the repository root: + +```sh +go test ./x/voting-snapshot/keeper \ + -run '^TestValidatorWalkOverAdvisoryLimitPreservesSameBlockPower$' \ + -count=1 -v + +go test ./x/voting-snapshot/keeper \ + -run '^$' \ + -bench '^BenchmarkValidatorDelegatorWalk$' \ + -benchmem -benchtime=3x -count=3 +``` + +The correctness test deliberately exceeds `MaxDelegatorsPerSnapshotWalk`. It asserts that no delegator is truncated, post-slash power is recorded at the current height, total power is updated at that height, and the validator walk, EndBlock delegation walk, and validator lookups each process exactly 10,001 rows. + +## v31 RC threshold + +On an otherwise idle amd64 release worker, the 10,001-delegator slash and status cases must each satisfy: + +- less than **500 ms/op** in all three runs; +- less than **64 MiB/op**; +- exactly **10,001 validator iterations/op** and **10,001 EndBlock iterations/op**; +- the same-block correctness test passes. + +A single noisy result must be rerun once on an idle worker. Two consecutive controlled runs above either time or allocation threshold block the RC and require a bounded, regression-tested optimization. Results below the threshold do not justify consensus-path optimization. + +## Baseline evidence + +Measured from commit `68d1cbd3c6a490bdbf9848ce4d55b8a10c82cda5` plus this benchmark on Linux/amd64, Intel i7-10710U, Go 1.25.10: + +| Case | 10,001-delegator observed range | Allocations | +|---|---:|---:| +| Slash hook + EndBlock | 121–256 ms/op | about 47.5 MB/op | +| Status hook + EndBlock | 114–158 ms/op | about 47.5 MB/op | + +All observed runs remained below the v31 RC threshold, so no production optimization was introduced. diff --git a/x/voting-snapshot/keeper/benchmark_test.go b/x/voting-snapshot/keeper/benchmark_test.go new file mode 100644 index 000000000..86a8dcb9a --- /dev/null +++ b/x/voting-snapshot/keeper/benchmark_test.go @@ -0,0 +1,202 @@ +package keeper_test + +import ( + "context" + "encoding/binary" + "fmt" + "testing" + + coreheader "cosmossdk.io/core/header" + "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" + + "github.com/cosmos/cosmos-sdk/runtime" + sdktestutil "github.com/cosmos/cosmos-sdk/testutil" + sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + + snapshotkeeper "github.com/CosmosContracts/juno/v31/x/voting-snapshot/keeper" + snapshottypes "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" +) + +const benchmarkDelegators = 10_001 + +type benchmarkStakingKeeper struct { + delegations []stakingtypes.Delegation + byDelegator map[string]stakingtypes.Delegation + validator stakingtypes.Validator + total math.Int + + validatorDelegationIterations int64 + delegatorDelegationIterations int64 + validatorLookups int64 +} + +func (m *benchmarkStakingKeeper) TotalBondedTokens(context.Context) (math.Int, error) { + return m.total, nil +} + +func (m *benchmarkStakingKeeper) IterateAllDelegations(_ context.Context, fn func(stakingtypes.Delegation) bool) error { + for _, delegation := range m.delegations { + if fn(delegation) { + break + } + } + return nil +} + +func (m *benchmarkStakingKeeper) GetValidatorDelegations(context.Context, sdk.ValAddress) ([]stakingtypes.Delegation, error) { + m.validatorDelegationIterations += int64(len(m.delegations)) + return m.delegations, nil +} + +func (m *benchmarkStakingKeeper) IterateDelegatorDelegations(_ context.Context, delegator sdk.AccAddress, fn func(stakingtypes.Delegation) bool) error { + delegation, ok := m.byDelegator[delegator.String()] + if !ok { + return nil + } + m.delegatorDelegationIterations++ + fn(delegation) + return nil +} + +func (m *benchmarkStakingKeeper) GetValidator(context.Context, sdk.ValAddress) (stakingtypes.Validator, error) { + m.validatorLookups++ + return m.validator, nil +} + +func deterministicAddress(index int) sdk.AccAddress { + address := make([]byte, 20) + binary.BigEndian.PutUint64(address[12:], uint64(index+1)) + return sdk.AccAddress(address) +} + +func newBenchmarkVotingSnapshotKeeper(tb testing.TB, delegatorCount int) (sdk.Context, snapshotkeeper.Keeper, *benchmarkStakingKeeper, sdk.ValAddress) { + tb.Helper() + + keys := storetypes.NewKVStoreKeys(snapshottypes.StoreKey) + tkeys := storetypes.NewTransientStoreKeys(snapshottypes.TransientStoreKey) + ctx := sdktestutil.DefaultContextWithKeys(keys, tkeys, nil). + WithBlockHeight(31). + WithHeaderInfo(coreheader.Info{Height: 31}) + + valAddress := sdk.ValAddress(deterministicAddress(0x7fff)) + delegatorShares := math.LegacyNewDec(int64(2 * delegatorCount)) + validator := stakingtypes.Validator{ + OperatorAddress: valAddress.String(), + Status: stakingtypes.Bonded, + Tokens: math.NewInt(int64(2 * delegatorCount)), + DelegatorShares: delegatorShares, + } + stakingKeeper := &benchmarkStakingKeeper{ + delegations: make([]stakingtypes.Delegation, 0, delegatorCount), + byDelegator: make(map[string]stakingtypes.Delegation, delegatorCount), + validator: validator, + total: validator.Tokens, + } + for i := range delegatorCount { + delegator := deterministicAddress(i) + delegation := stakingtypes.Delegation{ + DelegatorAddress: delegator.String(), + ValidatorAddress: valAddress.String(), + Shares: math.LegacyNewDec(2), + } + stakingKeeper.delegations = append(stakingKeeper.delegations, delegation) + stakingKeeper.byDelegator[delegator.String()] = delegation + } + + encoding := moduletestutil.MakeTestEncodingConfig() + keeper := snapshotkeeper.NewKeeper( + encoding.Codec, + runtime.NewKVStoreService(keys[snapshottypes.StoreKey]), + stakingKeeper, + "authority", + snapshottypes.NewTransientKVStoreService(tkeys[snapshottypes.TransientStoreKey]), + ) + if err := keeper.Params.Set(ctx, snapshottypes.DefaultParams()); err != nil { + tb.Fatalf("set params: %v", err) + } + return ctx, keeper, stakingKeeper, valAddress +} + +func TestValidatorWalkOverAdvisoryLimitPreservesSameBlockPower(t *testing.T) { + ctx, keeper, stakingKeeper, validator := newBenchmarkVotingSnapshotKeeper(t, benchmarkDelegators) + + // Model a 50%% slash after BeforeValidatorSlashed has marked every + // delegator dirty. EndBlock must read the settled validator state. + if err := keeper.Hooks().BeforeValidatorSlashed(ctx, validator, math.LegacyMustNewDecFromStr("0.5")); err != nil { + t.Fatal(err) + } + stakingKeeper.validator.Tokens = math.NewInt(benchmarkDelegators) + stakingKeeper.total = stakingKeeper.validator.Tokens + if err := keeper.EndBlocker(ctx); err != nil { + t.Fatal(err) + } + + for _, index := range []int{0, benchmarkDelegators / 2, benchmarkDelegators - 1} { + power, err := keeper.VotingPowerAt(ctx, deterministicAddress(index), ctx.BlockHeight()) + if err != nil { + t.Fatal(err) + } + if !power.Equal(math.OneInt()) { + t.Fatalf("delegator %d: got %s power, want 1", index, power) + } + } + total, err := keeper.TotalVotingPowerAt(ctx, ctx.BlockHeight()) + if err != nil { + t.Fatal(err) + } + if !total.Equal(math.NewInt(benchmarkDelegators)) { + t.Fatalf("got total %s, want %d", total, benchmarkDelegators) + } + if stakingKeeper.validatorDelegationIterations != benchmarkDelegators { + t.Fatalf("validator walk iterations = %d, want %d", stakingKeeper.validatorDelegationIterations, benchmarkDelegators) + } + if stakingKeeper.delegatorDelegationIterations != benchmarkDelegators { + t.Fatalf("end-block delegator iterations = %d, want %d", stakingKeeper.delegatorDelegationIterations, benchmarkDelegators) + } + if stakingKeeper.validatorLookups != benchmarkDelegators { + t.Fatalf("validator lookups = %d, want %d", stakingKeeper.validatorLookups, benchmarkDelegators) + } +} + +func BenchmarkValidatorDelegatorWalk(b *testing.B) { + for _, count := range []int{1_000, 6_000, benchmarkDelegators} { + b.Run(fmt.Sprintf("slash/%d", count), func(b *testing.B) { + ctx, keeper, stakingKeeper, validator := newBenchmarkVotingSnapshotKeeper(b, count) + b.ReportAllocs() + b.ReportMetric(float64(count), "delegators/op") + b.ResetTimer() + for range b.N { + if err := keeper.Hooks().BeforeValidatorSlashed(ctx, validator, math.LegacyZeroDec()); err != nil { + b.Fatal(err) + } + if err := keeper.EndBlocker(ctx); err != nil { + b.Fatal(err) + } + } + b.StopTimer() + b.ReportMetric(float64(stakingKeeper.validatorDelegationIterations)/float64(b.N), "validator-iterations/op") + b.ReportMetric(float64(stakingKeeper.delegatorDelegationIterations)/float64(b.N), "endblock-iterations/op") + }) + + b.Run(fmt.Sprintf("status/%d", count), func(b *testing.B) { + ctx, keeper, stakingKeeper, validator := newBenchmarkVotingSnapshotKeeper(b, count) + b.ReportAllocs() + b.ReportMetric(float64(count), "delegators/op") + b.ResetTimer() + for range b.N { + if err := keeper.Hooks().AfterValidatorBeginUnbonding(ctx, nil, validator); err != nil { + b.Fatal(err) + } + if err := keeper.EndBlocker(ctx); err != nil { + b.Fatal(err) + } + } + b.StopTimer() + b.ReportMetric(float64(stakingKeeper.validatorDelegationIterations)/float64(b.N), "validator-iterations/op") + b.ReportMetric(float64(stakingKeeper.delegatorDelegationIterations)/float64(b.N), "endblock-iterations/op") + }) + } +} diff --git a/x/voting-snapshot/keeper/genesis.go b/x/voting-snapshot/keeper/genesis.go index cda279192..ba2125055 100644 --- a/x/voting-snapshot/keeper/genesis.go +++ b/x/voting-snapshot/keeper/genesis.go @@ -3,7 +3,7 @@ package keeper import ( "context" - "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" ) func (k Keeper) InitGenesis(ctx context.Context, gs *types.GenesisState) error { diff --git a/x/voting-snapshot/keeper/grpc_query.go b/x/voting-snapshot/keeper/grpc_query.go index a7a7efee8..dbd6bf54f 100644 --- a/x/voting-snapshot/keeper/grpc_query.go +++ b/x/voting-snapshot/keeper/grpc_query.go @@ -9,7 +9,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" ) // QueryServer adapts Keeper into the proto-generated types.QueryServer diff --git a/x/voting-snapshot/keeper/keeper.go b/x/voting-snapshot/keeper/keeper.go index 60bd776f8..d9be4bf65 100644 --- a/x/voting-snapshot/keeper/keeper.go +++ b/x/voting-snapshot/keeper/keeper.go @@ -11,7 +11,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" ) // Keeper holds the event-driven voting-power index for staked JUNO. diff --git a/x/voting-snapshot/keeper/keeper_test.go b/x/voting-snapshot/keeper/keeper_test.go index c455e5001..8176c488b 100644 --- a/x/voting-snapshot/keeper/keeper_test.go +++ b/x/voting-snapshot/keeper/keeper_test.go @@ -30,8 +30,8 @@ import ( stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/CosmosContracts/juno/v30/x/voting-snapshot/keeper" - "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + "github.com/CosmosContracts/juno/v31/x/voting-snapshot/keeper" + "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" ) const mintModuleName = "mint" // faucet module account for funding test delegators diff --git a/x/voting-snapshot/keeper/msg_server.go b/x/voting-snapshot/keeper/msg_server.go index d362fc574..c6264cf29 100644 --- a/x/voting-snapshot/keeper/msg_server.go +++ b/x/voting-snapshot/keeper/msg_server.go @@ -8,7 +8,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" ) // MsgServer adapts Keeper into the proto-generated types.MsgServer diff --git a/x/voting-snapshot/keeper/prune.go b/x/voting-snapshot/keeper/prune.go index e372861a6..9d4d4dab0 100644 --- a/x/voting-snapshot/keeper/prune.go +++ b/x/voting-snapshot/keeper/prune.go @@ -10,7 +10,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" ) // MaxPruneDeletionsPerRun bounds how many snapshot keys a single prune diff --git a/x/voting-snapshot/module/module.go b/x/voting-snapshot/module/module.go index ddfba337a..856c3c2d4 100644 --- a/x/voting-snapshot/module/module.go +++ b/x/voting-snapshot/module/module.go @@ -20,8 +20,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/CosmosContracts/juno/v30/x/voting-snapshot/keeper" - "github.com/CosmosContracts/juno/v30/x/voting-snapshot/types" + "github.com/CosmosContracts/juno/v31/x/voting-snapshot/keeper" + "github.com/CosmosContracts/juno/v31/x/voting-snapshot/types" ) const ConsensusVersion = 1 diff --git a/x/voting-snapshot/types/query.pb.go b/x/voting-snapshot/types/query.pb.go index 9fc75f7cc..d56491633 100644 --- a/x/voting-snapshot/types/query.pb.go +++ b/x/voting-snapshot/types/query.pb.go @@ -29,6 +29,7 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// QueryParamsRequest requests the current module parameters. type QueryParamsRequest struct { } @@ -65,6 +66,7 @@ func (m *QueryParamsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo +// QueryParamsResponse contains the current module parameters. type QueryParamsResponse struct { Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` } @@ -109,6 +111,7 @@ func (m *QueryParamsResponse) GetParams() Params { return Params{} } +// QueryVotingPowerAtRequest requests an address's voting power at a height. type QueryVotingPowerAtRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` // at_height is the chain height to look up power for. Named @@ -164,6 +167,7 @@ func (m *QueryVotingPowerAtRequest) GetAtHeight() int64 { return 0 } +// QueryVotingPowerAtResponse contains an address's voting power. type QueryVotingPowerAtResponse struct { // power is the bonded stake amount as a base-10 string (uint). Power string `protobuf:"bytes,1,opt,name=power,proto3" json:"power,omitempty"` @@ -209,6 +213,7 @@ func (m *QueryVotingPowerAtResponse) GetPower() string { return "" } +// QueryTotalVotingPowerAtRequest requests total voting power at a height. type QueryTotalVotingPowerAtRequest struct { AtHeight int64 `protobuf:"varint,1,opt,name=at_height,json=atHeight,proto3" json:"at_height,omitempty"` } @@ -253,6 +258,7 @@ func (m *QueryTotalVotingPowerAtRequest) GetAtHeight() int64 { return 0 } +// QueryTotalVotingPowerAtResponse contains total voting power. type QueryTotalVotingPowerAtResponse struct { Power string `protobuf:"bytes,1,opt,name=power,proto3" json:"power,omitempty"` } @@ -297,6 +303,7 @@ func (m *QueryTotalVotingPowerAtResponse) GetPower() string { return "" } +// QueryVotingPowerOverRangeRequest requests an address's snapshots over a height range. type QueryVotingPowerOverRangeRequest struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` FromHeight int64 `protobuf:"varint,2,opt,name=from_height,json=fromHeight,proto3" json:"from_height,omitempty"` @@ -357,6 +364,7 @@ func (m *QueryVotingPowerOverRangeRequest) GetToHeight() int64 { return 0 } +// QueryVotingPowerOverRangeResponse contains voting-power snapshots over a height range. type QueryVotingPowerOverRangeResponse struct { Rows []HeightPower `protobuf:"bytes,1,rep,name=rows,proto3" json:"rows"` } @@ -401,6 +409,7 @@ func (m *QueryVotingPowerOverRangeResponse) GetRows() []HeightPower { return nil } +// HeightPower pairs a block height with its recorded voting power. type HeightPower struct { Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` Power string `protobuf:"bytes,2,opt,name=power,proto3" json:"power,omitempty"` diff --git a/x/voting-snapshot/types/tx.pb.go b/x/voting-snapshot/types/tx.pb.go index 430be5d7d..6071ef3cb 100644 --- a/x/voting-snapshot/types/tx.pb.go +++ b/x/voting-snapshot/types/tx.pb.go @@ -88,6 +88,7 @@ func (m *MsgUpdateParams) GetParams() Params { return Params{} } +// MsgUpdateParamsResponse is returned after module parameters are updated. type MsgUpdateParamsResponse struct { } diff --git a/x/wrappers/gov/module/module.go b/x/wrappers/gov/module/module.go index 34f31a0a2..ea98e3cf6 100644 --- a/x/wrappers/gov/module/module.go +++ b/x/wrappers/gov/module/module.go @@ -11,7 +11,7 @@ import ( v1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "github.com/CosmosContracts/juno/v30/x/wrappers/gov/keeper" + "github.com/CosmosContracts/juno/v31/x/wrappers/gov/keeper" ) // AppModuleBasic defines the basic application module used for the wrapped gov module.